Author: fehr
Date: Thu Mar 18 18:56:35 2010
New Revision: 61391
URL: http://svn.opensuse.org/viewcvs/yast?rev=61391&view=rev
Log:
- make update and detection of encrypted LVM VGs possible
Modified:
trunk/storage/package/yast2-storage.changes
trunk/storage/storage/src/include/custom_part_dialogs.ycp
trunk/storage/storage/src/include/custom_part_lib.ycp
trunk/storage/storage/src/include/ep-dialogs.ycp
trunk/storage/storage/src/modules/Storage.ycp
Modified: trunk/storage/package/yast2-storage.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/package/yast2-storage.changes?rev=61391&r1=61390&r2=61391&view=diff
==============================================================================
--- trunk/storage/package/yast2-storage.changes (original)
+++ trunk/storage/package/yast2-storage.changes Thu Mar 18 18:56:35 2010
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Thu Mar 18 18:54:31 CET 2010 - fehr@suse.de
+
+- make update and detection of encrypted LVM VGs possible
+
+-------------------------------------------------------------------
Thu Mar 18 11:29:58 CET 2010 - aschnell@suse.de
- fixed proposal name for DM and MD RAIDs
Modified: trunk/storage/storage/src/include/custom_part_dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/custom_part_dialogs.ycp?rev=61391&r1=61390&r2=61391&view=diff
==============================================================================
--- trunk/storage/storage/src/include/custom_part_dialogs.ycp (original)
+++ trunk/storage/storage/src/include/custom_part_dialogs.ycp Thu Mar 18 18:56:35 2010
@@ -49,104 +49,21 @@
device, minpwlen, format, tmpcrypt );
// heading text
- string h = _("Enter your password for the encrypted file system.");
+ string h = _("Enter your Password for the Encrypted File System.");
// label text
string label = _("Don't forget what you enter here!");
if( tmpcrypt )
{
label = label + " ";
- label = label + ("Empty password allowed.");
+ label = label + _("Empty password allowed.");
}
if( size(device)>0 )
// heading text, %1 is replaced by device name (e.g. /dev/hda1)
h = sformat( _("Password for Encrypted File System on %1"), device );
- UI::OpenDialog(
- `opt(`decorated ),
- `HBox(
- `HWeight(3, `RichText( helptext ) ),
- `HWeight(6, `VBox(
- `VSpacing(0.3),
- `HBox(
- `HSpacing(1),
- `Heading(h),
- `HSpacing(1)
- ),
- `VSpacing(4),
- `HBox(
- `HSpacing(4),
- `VBox(
- // label text
- `Label(label),
- `VSpacing(),
-
- `HBox(
- `Password(`id("pw1"),
- // Label: get password for user root
- // Please use newline if label is longer than 40 characters
- _("&Enter a password for your file system:"), ""),
- `HSpacing(15)),
-
- `VSpacing(0.5),
-
- `HBox(
- `Password(`id("pw2"),
- // Label: get same password again for verification
- // Please use newline if label is longer than 40 characters
- _("Reenter the password for &verification:"), ""),
- `HSpacing(15))
- ),
- `HSpacing(4)
- ),
- `VSpacing(3),
- `ButtonBox(
- `PushButton(`id("ok"), `opt(`default), Label::OKButton()),
- `PushButton(`id("cancel"), Label::CancelButton())
- ),
- `VSpacing(0.5)
- )
- )
- ));
-
- string password = "";
- symbol widget = nil;
-
- repeat
- {
- // Clear password fields on every round.
- UI::ChangeWidget(`id(`pw1), `Value, "");
- UI::ChangeWidget(`id(`pw2), `Value, "");
-
- UI::SetFocus(`id(`pw1));
-
- widget = (symbol) UI::UserInput();
-
- switch (widget)
- {
- case `ok:
-
- password = (string) UI::QueryWidget(`id(`pw1), `Value);
- string tmp = (string) UI::QueryWidget(`id(`pw2), `Value);
-
- if (!Storage::CheckEncryptionPasswords(password, tmp, minpwlen, tmpcrypt))
- widget = `again;
-
- break;
- }
-
- } until (widget == `cancel || widget == `ok);
-
- UI::CloseDialog();
-
- if (widget == `ok)
- {
- return password;
- }
- else
- {
- return "";
- }
+ string ret = Storage::PasswdPopup( helptext, h, label, format, minpwlen, tmpcrypt );
+ return( ret );
}
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=61391&r1=61390&r2=61391&view=diff
==============================================================================
--- trunk/storage/storage/src/include/custom_part_lib.ycp (original)
+++ trunk/storage/storage/src/include/custom_part_lib.ycp Thu Mar 18 18:56:35 2010
@@ -530,94 +530,6 @@
return( ret );
}
-
-/**
- * Do all checks concerning handling of crypt fs
- * @param new partition map
- * @return map
- **/
-define map CheckCryptOk( map new )
- ``{
- map ret = $[ "ok" : true ];
- boolean crypt_fs = false;
- if( UI::WidgetExists( `id(`crypt_fs) ))
- {
- crypt_fs = (boolean)UI::QueryWidget(`id(`crypt_fs), `Value );
- }
- if( crypt_fs )
- new["enc_type"] = new["format"]:false?`luks:`twofish;
- else
- new["enc_type"] = `none;
- if( crypt_fs && size(Storage::GetCryptPwd( new["device"]:"" ))==0 )
- {
- boolean tmpc = EmptyCryptPwdAllowed( new );
- string fs_passwd = DlgCreateCryptFs( new["device"]:"",
- new["format"]:false?8:1,
- new["format"]:false, tmpc );
- // Ask the user for a password for cryptofs, else set crypto to nil??
- if( fs_passwd != nil && size(fs_passwd)>0 )
- {
- string dev = new["device"]:"";
- boolean popup = !new["format"]:false;
- y2milestone( "CheckCryptOk dev %1 popup %2", dev, popup );
- if( popup )
- UI::OpenDialog( `opt(`decorated),
- `VBox(
- `VSpacing(1),
- `HBox(`HSpacing(1),
- `Label(_("Detecting encryption type...")),
- `HSpacing(1)),
- `VSpacing(1)));
-
- ret["ok"] = Storage::SetCryptPwd( dev, fs_passwd ) &&
- (new["format"]:false ||
- Storage::SetCrypt( dev, true, new["format"]:false ));
- if( popup )
- UI::CloseDialog();
- }
- else
- {
- ret["ok"] = tmpc;
- }
- }
- ret["map"] = new;
- y2milestone( "CheckCryptOk ret:%1", ret );
- return( ret );
- };
-
-define map CheckFormatOk( map new )
- ``{
- map ret = $[ "ok" : true ];
- if( new["format"]:false )
- {
- symbol ufs = new["used_fs"]:`unknown;
- y2milestone( "GetSupportFormat %1", FileSystems::GetSupportFormat(ufs));
- if( !FileSystems::GetSupportFormat(ufs) )
- {
- // Popup text
- string txt = sformat( "The file system of type %1 cannot be created.",
- FileSystems::GetName( ufs, "" ));
- Popup::Error(txt);
- ret["ok"] = false;
- }
- }
- ret["map"] = new;
- y2milestone( "CheckFormatOk ret:%1", ret["ok"]:false );
- return( ret );
- };
-
-define map CheckDeviceFinalOk( map new )
- ``{
- y2milestone( "CheckDeviceFinalOk new:%1", new );
- map ret = CheckFormatOk( new );
- if( ret["ok"]:false )
- {
- ret = CheckCryptOk( ret["map"]:$[] );
- }
- y2milestone( "CheckDeviceFinalOk ret:%1", ret );
- return( ret );
- }
-
map pkg_for_fs = $[
`ext2 : [ "e2fsprogs" ],
`ext3 : [ "e2fsprogs" ],
Modified: trunk/storage/storage/src/include/ep-dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/ep-dialogs.ycp?rev=61391&r1=61390&r2=61391&view=diff
==============================================================================
--- trunk/storage/storage/src/include/ep-dialogs.ycp (original)
+++ trunk/storage/storage/src/include/ep-dialogs.ycp Thu Mar 18 18:56:35 2010
@@ -480,10 +480,25 @@
integer min_pw_len = data["format"]:false ? 8 : 1;
boolean empty_pw_allowed = EmptyCryptPwdAllowed(data);
+ boolean two_pw = data["format"]:false || size(data["mount"]:"")==0;
- string label = _("Don't forget what you enter here!");
+ string label = "";
+
+ if( two_pw )
+ {
+ label = _("Don't forget what you enter here!");
+ label = label + "\n";
+ }
if (empty_pw_allowed)
- label = label + "\n" + _("Empty password allowed.");
+ label = label + _("Empty password allowed.");
+
+ term ad = `Empty();
+ if( two_pw )
+ ad = `Password( `id(`pw2), `opt(`hstretch),
+ // Label: get same password again for verification
+ // Please use newline if label is longer than 40 characters
+ _("Reenter the password for &verification:"), "");
+
term contents = `HVSquash(`FrameWithMarginBox(_("Password"),
`VBox(
@@ -491,10 +506,7 @@
// Label: get password for user root
// Please use newline if label is longer than 40 characters
_("&Enter a password for your file system:"), ""),
- `Password(`id(`pw2), `opt(`hstretch),
- // Label: get same password again for verification
- // Please use newline if label is longer than 40 characters
- _("Reenter the password for &verification:"), ""),
+ ad,
`VSpacing(0.5),
`Left(`Label(label))
)
@@ -525,7 +537,7 @@
size(data["mount"]:"")>0;
if (!Storage::CheckEncryptionPasswords(password, tmp, min_pw_len, empty_pw_allowed) ||
- (need_verify && !Storage::CheckCryptOk(dev, password)) )
+ (need_verify && !Storage::CheckCryptOk(dev, password, false, false)) )
{
UI::SetFocus(`id(`pw1) );
widget = `again;
Modified: trunk/storage/storage/src/modules/Storage.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/Storage.ycp?rev=61391&r1=61390&r2=61391&view=diff
==============================================================================
--- trunk/storage/storage/src/modules/Storage.ycp (original)
+++ trunk/storage/storage/src/modules/Storage.ycp Thu Mar 18 18:56:35 2010
@@ -32,6 +32,7 @@
import "FileUtils";
import "Installation";
import "Label";
+ import "Icon";
import "Mode";
import "Partitions";
import "Popup";
@@ -189,6 +190,7 @@
string part_insts = nil;
+global map