[yast-commit] r62319 - in /branches/SuSE-Linux-11_3-Branch/storage: package/yast2-storage.changes storage/src/include/custom_part_dialogs.ycp storage/src/include/ep-import.ycp storage/src/modules/StorageUpdate.ycp
Author: fehr Date: Thu Jul 29 16:04:19 2010 New Revision: 62319 URL: http://svn.opensuse.org/viewcvs/yast?rev=62319&view=rev Log: - fix bug that destroys encrypted volumes when wron password is entered in read fstab dialog (#625490) - replace "nofail" with "noauto" for encrypted volumes in fstab during update Modified: branches/SuSE-Linux-11_3-Branch/storage/package/yast2-storage.changes branches/SuSE-Linux-11_3-Branch/storage/storage/src/include/custom_part_dialogs.ycp branches/SuSE-Linux-11_3-Branch/storage/storage/src/include/ep-import.ycp branches/SuSE-Linux-11_3-Branch/storage/storage/src/modules/StorageUpdate.ycp Modified: branches/SuSE-Linux-11_3-Branch/storage/package/yast2-storage.changes URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-11_3-Branch/storage/package/yast2-storage.changes?rev=62319&r1=62318&r2=62319&view=diff ============================================================================== --- branches/SuSE-Linux-11_3-Branch/storage/package/yast2-storage.changes (original) +++ branches/SuSE-Linux-11_3-Branch/storage/package/yast2-storage.changes Thu Jul 29 16:04:19 2010 @@ -1,4 +1,12 @@ ------------------------------------------------------------------- +Thu Jul 29 15:53:11 CEST 2010 - fehr@suse.de + +- fix bug that destroys encrypted volumes when wron password is + entered in read fstab dialog (#625490) +- replace "nofail" with "noauto" for encrypted volumes in fstab + during update + +------------------------------------------------------------------- Mon Jun 21 16:42:34 CEST 2010 - aschnell@suse.de - avoid unreadable buttons (bnc #615377) Modified: branches/SuSE-Linux-11_3-Branch/storage/storage/src/include/custom_part_dialogs.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-11_3-Branch/storage/storage/src/include/custom_part_dialogs.ycp?rev=62319&r1=62318&r2=62319&view=diff ============================================================================== --- branches/SuSE-Linux-11_3-Branch/storage/storage/src/include/custom_part_dialogs.ycp (original) +++ branches/SuSE-Linux-11_3-Branch/storage/storage/src/include/custom_part_dialogs.ycp Thu Jul 29 16:04:19 2010 @@ -41,20 +41,23 @@ symbol check_devices_used( list<map> partitions, boolean not_cr ); -define string DlgCreateCryptFs( string device, integer minpwlen, boolean format, +define string DlgPasswdCryptFs( string device, integer minpwlen, boolean format, boolean tmpcrypt ) ``{ string helptext = GetCreateCryptFsHelptext(minpwlen, format, tmpcrypt); - y2milestone( "DlgCreateCryptFs device:%1 minpwlen:%2 format:%3 tmpcrypt:%4", + y2milestone( "DlgPasswdCryptFs device:%1 minpwlen:%2 format:%3 tmpcrypt:%4", device, minpwlen, format, tmpcrypt ); // heading text string h = _("Enter your Password for the Encrypted File System."); - // label text - string label = _("Don't forget what you enter here!"); + string label = ""; + if( format ) + // label text + label = _("Don't forget what you enter here!"); if( tmpcrypt ) { - label = label + " "; + if( size(label)>0 ) + label = label + " "; label = label + _("Empty password allowed."); } Modified: branches/SuSE-Linux-11_3-Branch/storage/storage/src/include/ep-import.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-11_3-Branch/storage/storage/src/include/ep-import.ycp?rev=62319&r1=62318&r2=62319&view=diff ============================================================================== --- branches/SuSE-Linux-11_3-Branch/storage/storage/src/include/ep-import.ycp (original) +++ branches/SuSE-Linux-11_3-Branch/storage/storage/src/include/ep-import.ycp Thu Jul 29 16:04:19 2010 @@ -346,31 +346,59 @@ boolean format_sys = true; string device = FstabAddDialog(target_map, fstabs, format_sys); + map<string, map> new_target_map = $[]; + boolean import_ok = false; if (!isempty(device)) { y2milestone("ImportMountPoints device:%1", device); list<map> fstab = (list<map>) fstabs[device]:[]; + import_ok = true; - map<string, map> new_target_map = AddFstabToTargetMap(target_map, fstab, format_sys); + new_target_map = AddFstabToTargetMap(target_map, fstab, format_sys); foreach(string d, map disk, new_target_map, { foreach(map p, disk["partitions"]:[], { + string key = (p["type"]:`unknown != `loop) ? (p["device"]:"error") : (p["fpath"]:"error"); if (!isempty(p["mount"]:"") && p["enc_type"]:`none!=`none && - !p["tmpcrypt"]:false) + !p["tmpcrypt"]:false && Storage::NeedCryptPwd(key) ) { - string pwd = DlgCreateCryptFs( p["device"]:"", 1, false, false ); - if( pwd != nil && !isempty(pwd) ) - Storage::SetCryptPwd( p["device"]:"", pwd ); + boolean ok = false; + string dev = p["device"]:""; + string pwd = ""; + do + { + ok = false; + pwd = DlgPasswdCryptFs( dev, 1, false, false ); + if( pwd != nil && !isempty(pwd) ) + { + if( Storage::CheckCryptOk( dev, pwd, true, + false ) ) + { + ok = Storage::SetCryptPwd( dev, pwd ) && + Storage::SetCrypt( dev, true, false ); + } + else + { + Popup::Error(_("Wrong Password provided.")); + } + } + else if( size(pwd)==0 ) + { + ok = true; + import_ok = false; + } + } + while( !ok ); + } }); }); - Storage::SetTargetMap(new_target_map); } + if( import_ok ) + Storage::SetTargetMap(new_target_map); else - { Storage::RestoreTargetBackup("import"); - } Storage::DisposeTargetBackup("import"); } Modified: branches/SuSE-Linux-11_3-Branch/storage/storage/src/modules/StorageUpdate.ycp URL: http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Linux-11_3-Branch/storage/storage/src/modules/StorageUpdate.ycp?rev=62319&r1=62318&r2=62319&view=diff ============================================================================== --- branches/SuSE-Linux-11_3-Branch/storage/storage/src/modules/StorageUpdate.ycp (original) +++ branches/SuSE-Linux-11_3-Branch/storage/storage/src/modules/StorageUpdate.ycp Thu Jul 29 16:04:19 2010 @@ -288,6 +288,35 @@ AsciiFile::RewriteFile( crtab, tabpath ); } +void UpdateFstabCryptNofail() + { + y2milestone( "UpdateFstabCryptNofail called" ); + string tabpath = Storage::PathToDestdir( "/etc/fstab" ); + map fstab = Partitions::GetFstab( tabpath ); + integer line = 0; + boolean update = false; + while( line<=AsciiFile::NumLines( fstab ) ) + { + map l = AsciiFile::GetLine( fstab, line ); + if( search( l["fields",0]:"", "/dev/mapper/cr_" )==0 ) + { + list<string> ls = splitstring( l["fields",3]:"", "," ); + ls = filter( string s, ls, ``(s!="noauto")); + if( size(filter( string s, ls, ``(s=="nofail")))==0 ) + { + ls = add( ls, "nofail" ); + AsciiFile::ChangeLineField( fstab, line, 3, + mergestring( ls, "," )); + update = true; + } + } + line = line+1; + } + if( update ) + { + AsciiFile::RewriteFile( fstab, tabpath ); + } + } /** * Updates fstab on disk @@ -388,6 +417,8 @@ bo = (map)SCR::Execute (.target.bash_output, cmd ); y2milestone( "Update bo %1", bo ); } + if( oldv["major"]:0<11 || (oldv["major"]:0==11 && oldv["minor"]:0<=2)) + UpdateFstabCryptNofail(); // set flag -> it indicates that Update was already called called_update = true; } -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
fehr@svn.opensuse.org