[yast-commit] r52458 - in /trunk/storage: package/yast2-storage.changes storage/src/include/custom_part_lib.ycp
Author: aschnell Date: Thu Oct 23 14:42:47 2008 New Revision: 52458 URL: http://svn.opensuse.org/viewcvs/yast?rev=52458&view=rev Log: - disallow mounting of file systems other than swap as swap (bnc #384301) Modified: trunk/storage/package/yast2-storage.changes trunk/storage/storage/src/include/custom_part_lib.ycp Modified: trunk/storage/package/yast2-storage.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/package/yast2-storage.changes?rev=52458&r1=52457&r2=52458&view=diff ============================================================================== --- trunk/storage/package/yast2-storage.changes (original) +++ trunk/storage/package/yast2-storage.changes Thu Oct 23 14:42:47 2008 @@ -2,6 +2,8 @@ Thu Oct 23 12:35:19 CEST 2008 - aschnell@suse.de - allow ommission of 'B' in size input fields (bnc #437914) +- disallow mounting of file systems other than swap as swap (bnc + #384301) ------------------------------------------------------------------- Wed Oct 22 12:12:27 CEST 2008 - aschnell@suse.de Modified: trunk/storage/storage/src/include/custom_part_lib.ycp URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/custom_part_lib.ycp?rev=52458&r1=52457&r2=52458&view=diff ============================================================================== --- trunk/storage/storage/src/include/custom_part_lib.ycp (original) +++ trunk/storage/storage/src/include/custom_part_lib.ycp Thu Oct 23 14:42:47 2008 @@ -369,7 +369,7 @@ **/ define boolean check_mount_point( map<string,map> targetMap, string dev, map part ) - ``{ +{ string mount = part["mount"]:""; symbol used_fs = part["used_fs"]:`unknown; y2milestone( "check_mount_point part:%1", part ); @@ -379,8 +379,23 @@ [ "/proc", "/dev", "/mnt", "/var/adm/mnt", "/lost+found", "/lib", "/bin", "/etc", "/sbin" ]; - if( mount != "" && - (mount != "swap" || part["type"]:`unknown==`loop) ) + if (mount == "") + { + allowed = true; + } + else if (used_fs == `swap && mount != "swap") + { + allowed = false; + // error popup + Popup::Error(_("Swap devices must have swap as mount point.")); + } + else if (used_fs != `swap && mount == "swap") + { + allowed = false; + // error popup + Popup::Error(_("Only swap devices may have swap as mount point.")); + } + else if (mount != "swap" || part["type"]:`unknown == `loop) { // check if the mount point is already in use foreach( string disk, map diskinfo, targetMap, ``{ @@ -445,16 +460,14 @@ allowed = !Popup::YesNo(message); } - else - { - allowed = true; - } + if( allowed ) { allowed = CheckFstabOptions( part ); } - return( allowed ); - }; + return allowed; +} + define boolean check_ok_fssize( integer siz, map part ) ``{ -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
aschnell@svn.opensuse.org