Skip to content

Commit

Permalink
Merge pull request #86 from yast/sw_02
Browse files Browse the repository at this point in the history
accept symlinks to block devices and files in dialogs (bsc#1123316)
  • Loading branch information
wfeldt committed Feb 20, 2019
2 parents 7e62818 + 0e3021f commit 70bfd83
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
6 changes: 6 additions & 0 deletions package/yast2-iscsi-lio-server.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Feb 20 13:09:38 UTC 2019 - snwint@suse.com

- accept symlinks to block devices and files in dialogs (bsc#1123316)
- 4.0.12

-------------------------------------------------------------------
Wed Jun 27 15:21:50 CEST 2018 - schubi@suse.de

Expand Down
2 changes: 1 addition & 1 deletion package/yast2-iscsi-lio-server.spec
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@


Name: yast2-iscsi-lio-server
Version: 4.0.11
Version: 4.0.12
Release: 0

BuildRoot: %{_tmppath}/%{name}-%{version}-build
Expand Down
8 changes: 3 additions & 5 deletions src/include/iscsi-lio-server/UI_dialogs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2710,8 +2710,7 @@ def validate
@lun_path_input.value = nil
return false
end
file_type = File.ftype(file)
if (file_type != 'blockSpecial') && (file_type != 'file')
if !File.file?(file) && !File.blockdev?(file)
Yast::Popup.Error(_('Please provide a normal file or a block device.'))
@lun_path_input.value = nil
return false
Expand All @@ -2727,8 +2726,7 @@ def is_valid
if !(File.exist?(file))
return false
end
file_type = File.ftype(file)
if (file_type != 'blockSpecial') && (file_type != 'file')
if !File.file?(file) && !File.blockdev?(file)
return false
end
true
Expand Down Expand Up @@ -2883,7 +2881,7 @@ def handle(event)
lun_name = ret[1]
file = ret[2]
if !file.nil? && (File.exist?(file))
@lun_table.add_lun_item([rand(9999), lun_number, lun_name, file, File.ftype(file)])
@lun_table.add_lun_item([rand(9999), lun_number, lun_name, file, File.stat(file).ftype])
end
end
when :delete
Expand Down

0 comments on commit 70bfd83

Please sign in to comment.