Hello community,
here is the log from the commit of package yast2-storage for openSUSE:Factory
checked in at Wed Jul 29 17:34:08 CEST 2009.
--------
--- yast2-storage/yast2-storage.changes 2009-07-23 17:41:48.000000000 +0200
+++ /mounts/work_src_done/STABLE/yast2-storage/yast2-storage.changes 2009-07-27 17:53:25.000000000 +0200
@@ -1,0 +2,6 @@
+Mon Jul 27 17:41:31 CEST 2009 - aschnell@suse.de
+
+- work on proposal UI for LVM encryption (fate #305633)
+- 2.18.17
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
yast2-storage-2.18.16.tar.bz2
New:
----
yast2-storage-2.18.17.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-storage.spec ++++++
--- /var/tmp/diff_new_pack.YpDWgJ/_old 2009-07-29 17:33:55.000000000 +0200
+++ /var/tmp/diff_new_pack.YpDWgJ/_new 2009-07-29 17:33:55.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-storage (Version 2.18.16)
+# spec file for package yast2-storage (Version 2.18.17)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
@@ -19,10 +19,10 @@
Name: yast2-storage
-Version: 2.18.16
-Release: 2
+Version: 2.18.17
+Release: 1
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-storage-2.18.16.tar.bz2
+Source0: yast2-storage-2.18.17.tar.bz2
Prefix: /usr
Group: System/YaST
License: GPL v2 or later
@@ -51,7 +51,7 @@
devices during installation and on an installed system.
%prep
-%setup -n yast2-storage-2.18.16
+%setup -n yast2-storage-2.18.17
%build
%{prefix}/bin/y2tool y2autoconf
++++++ yast2-storage-2.18.16.tar.bz2 -> yast2-storage-2.18.17.tar.bz2 ++++++
++++ 2034 lines of diff (skipped)
++++ retrying with extended exclude list
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-storage-2.18.16/VERSION new/yast2-storage-2.18.17/VERSION
--- old/yast2-storage-2.18.16/VERSION 2009-07-23 13:48:48.000000000 +0200
+++ new/yast2-storage-2.18.17/VERSION 2009-07-27 17:42:31.000000000 +0200
@@ -1 +1 @@
-2.18.16
+2.18.17
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-storage-2.18.16/configure.in new/yast2-storage-2.18.17/configure.in
--- old/yast2-storage-2.18.16/configure.in 2009-07-24 15:49:08.000000000 +0200
+++ new/yast2-storage-2.18.17/configure.in 2009-07-28 10:33:57.000000000 +0200
@@ -3,7 +3,7 @@
dnl -- This file is generated by y2autoconf 2.18.9 - DO NOT EDIT! --
dnl (edit configure.in.in instead)
-AC_INIT(yast2-storage, 2.18.16, http://bugs.opensuse.org/, yast2-storage)
+AC_INIT(yast2-storage, 2.18.17, http://bugs.opensuse.org/, yast2-storage)
dnl Check for presence of file 'RPMNAME'
AC_CONFIG_SRCDIR([RPMNAME])
@@ -18,7 +18,7 @@
AM_INIT_AUTOMAKE(tar-ustar -Wno-portability)
dnl Important YaST2 variables
-VERSION="2.18.16"
+VERSION="2.18.17"
RPMNAME="yast2-storage"
MAINTAINER="Arvin Schnell "
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-storage-2.18.16/storage/src/include/auto_part_ui.ycp new/yast2-storage-2.18.17/storage/src/include/auto_part_ui.ycp
--- old/yast2-storage-2.18.16/storage/src/include/auto_part_ui.ycp 2009-07-21 16:37:06.000000000 +0200
+++ new/yast2-storage-2.18.17/storage/src/include/auto_part_ui.ycp 2009-07-27 11:59:04.000000000 +0200
@@ -9,7 +9,7 @@
*
*
*
- * $Id: auto_part_ui.ycp 57914 2009-07-07 13:56:29Z aschnell $
+ * $Id: auto_part_ui.ycp 58156 2009-07-27 09:59:06Z aschnell $
*
* used globals:
*
@@ -263,6 +263,9 @@
`Left(`HBox(`HSpacing(3), `CheckBox(`id(`lvm), `opt(`notify),
// Label text
_("Create &LVM Based Proposal"), cfg["prop_lvm"]:false ))));
+ vb = add(vb,
+ `Left(`HBox(`HSpacing(7), `CheckBox(`id(`encrypt), `opt(`notify),
+ _("Encrypt Volume Group")))));
vbox = add (vbox, `VSpacing(1.5) );
term frame = `HVCenter(`Frame( _("Proposal type"), `HVCenter(vb) ));
vbox = add (vbox, frame );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-storage-2.18.16/storage/src/include/custom_part_dialogs.ycp new/yast2-storage-2.18.17/storage/src/include/custom_part_dialogs.ycp
--- old/yast2-storage-2.18.16/storage/src/include/custom_part_dialogs.ycp 2009-07-23 18:37:16.000000000 +0200
+++ new/yast2-storage-2.18.17/storage/src/include/custom_part_dialogs.ycp 2009-07-27 17:42:40.000000000 +0200
@@ -16,7 +16,7 @@
*
*************************************************************
- $Id: custom_part_dialogs.ycp 57661 2009-06-19 12:23:08Z aschnell $
+ $Id: custom_part_dialogs.ycp 58178 2009-07-27 15:42:43Z aschnell $
*/
{
@@ -30,6 +30,7 @@
import "Arch";
import "Label";
import "Popup";
+ import "StorageProposal";
include "partitioning/custom_part_helptexts.ycp";
@@ -99,10 +100,8 @@
`HSpacing(4)
),
`VSpacing(3),
- `HBox(
- // Ok button
+ `ButtonBox(
`PushButton(`id("ok"), `opt(`default), Label::OKButton()),
- // Cancel button
`PushButton(`id("cancel"), Label::CancelButton())
),
`VSpacing(0.5)
@@ -110,75 +109,114 @@
)
));
- string ret = "";
- boolean input_is_ok = false;
- string pw1 = "";
- string pw2 = "";
+ 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"));
+ UI::ChangeWidget(`id(`pw1), `Value, "");
+ UI::ChangeWidget(`id(`pw2), `Value, "");
- ret = (string) UI::UserInput();
+ UI::SetFocus(`id(`pw1));
+ widget = (symbol) UI::UserInput();
- if (ret != "cancel")
+ switch (widget)
{
- pw1 = (string)UI::QueryWidget(`id("pw1"), `Value);
- pw2 = (string)UI::QueryWidget(`id("pw2"), `Value);
+ case `ok:
- if ( pw1 != pw2 )
- {
- // popup text
- Popup::Message(_("The first and the second version\nof the password do not match!\nPlease try again."));
+ 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;
}
- else if( pw1=="" && !tmpcrypt )
+
+ } until (widget == `cancel || widget == `ok);
+
+ UI::CloseDialog();
+
+ if (widget == `ok)
{
- // popup text
- Popup::Message(_("You did not enter a password.
-Try again.
-"));
+ return password;
}
- else if( size(pw1) < minpwlen && !tmpcrypt )
+ else
{
- // popup text
- Popup::Message(sformat(_("The password must have at least %1 characters.
-Try again.
-"),minpwlen));
+ return "";
}
- else if( size(pw1)>=minpwlen || tmpcrypt )
+ }
+
+
+ boolean QueryProposalPassword()
{
- any ret2 = findfirstnotof( pw1, "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ#* ,.;:._-+!$%&/|\?{[()]}@^\\<>" );
- if ( ret2 != nil && size(pw1)>0 )
+ if (!isempty(StorageProposal::GetProposalPassword()))
+ return true;
+
+ UI::OpenDialog(`VBox(
+ `Label(_("Enter your password for the proposal encryption.")),
+ `MinWidth(40,
+ `Password(`id(`pw1),
+ // Label: get password for user root
+ // Please use newline if label is longer than 40 characters
+ _("Password:"), "")),
+ `VSpacing(0.5),
+ `MinWidth(40,
+ `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:"), "")),
+ `Label(_("Don't forget what you enter here!")),
+ `ButtonBox(
+ `PushButton(`id(`ok), `opt(`default), Label::OKButton()),
+ `PushButton(`id(`cancel), Label::CancelButton())
+ )
+ ));
+
+ string password = "";
+ symbol widget = nil;
+
+ repeat
{
- // popup text
- Popup::Message(_("The password may only contain the following characters:
- 0..9, a..z, A..Z, and any of \"@#* ,.;:._-+!$%&/|\?{[()]}^\\<>\".
-Try again."));
- }
- else
+ // 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)
{
- input_is_ok = true;
+ case `ok:
+
+ password = (string) UI::QueryWidget(`id(`pw1), `Value);
+ string tmp = (string) UI::QueryWidget(`id(`pw2), `Value);
+
+ if (!Storage::CheckEncryptionPasswords(password, tmp, 8, false))
+ widget = `again;
+
+ break;
}
- }
- }
- } until ( input_is_ok || ret == "cancel" );
+ } until (widget == `cancel || widget == `ok);
UI::CloseDialog();
- if (ret == "cancel")
+ if (widget == `ok)
{
- pw1 = "";
+ StorageProposal::SetProposalPassword(password);
+ return true;
}
- y2milestone( "DlgCreateCryptFs size(ret):%1", size(pw1) );
- return( pw1 );
+ else
+ {
+ return false;
}
+ }
+
//////////////////////////////////////////////////////////////////////////////
// Dialog Password for Crypted FS Update
@@ -1479,5 +1517,4 @@
return(go_on);
};
-
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-storage-2.18.16/storage/src/include/ep-dialogs.ycp new/yast2-storage-2.18.17/storage/src/include/ep-dialogs.ycp
--- old/yast2-storage-2.18.16/storage/src/include/ep-dialogs.ycp 2009-07-21 16:37:06.000000000 +0200
+++ new/yast2-storage-2.18.17/storage/src/include/ep-dialogs.ycp 2009-07-27 15:57:37.000000000 +0200
@@ -503,9 +503,7 @@
MiniWorkflow::SetContents(Greasemonkey::Transform(contents), MiniWorkflowStepPasswordHelptext(data));
MiniWorkflow::SetLastStep(true);
- string pw1 = "";
- string pw2 = "";
-
+ string password = "";
symbol widget = nil;
//don't put those inside the loop - they'd be reset after each unsuccesful try
@@ -518,47 +516,14 @@
if (widget == `next)
{
- pw1 = (string) UI::QueryWidget(`id(`pw1), `Value);
- pw2 = (string) UI::QueryWidget(`id(`pw2), `Value);
+ password = (string) UI::QueryWidget(`id(`pw1), `Value);
+ string tmp = (string) UI::QueryWidget(`id(`pw2), `Value);
- if ( pw1 != pw2 )
- {
- // popup text
- Popup::Message(_("The first and the second version\nof the password do not match!\nPlease try again."));
- UI::SetFocus(`id(`pw1) );
- widget = `again;
- }
- else if (pw1 == "" && !empty_pw_allowed)
+ if (!Storage::CheckEncryptionPasswords(password, tmp, min_pw_len, empty_pw_allowed))
{
- // popup text
- Popup::Message(_("You did not enter a password.
-Try again.
-"));
UI::SetFocus(`id(`pw1) );
widget = `again;
}
- else if (size(pw1) < min_pw_len && !empty_pw_allowed)
- {
- // popup text
- Popup::Message(sformat(_("The password must have at least %1 characters.
-Try again.
-"), min_pw_len));
- UI::SetFocus(`id(`pw1) );
- widget = `again;
- }
- else if (size(pw1) >= min_pw_len || empty_pw_allowed)
- {
- any ret2 = findfirstnotof( pw1, "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ#* ,.;:._-+!$%&/|\?{[()]}@^\\<>" );
- if ( ret2 != nil && size(pw1)>0 )
- {
- // popup text
- Popup::Message(_("The password may only contain the following characters:
-0..9, a..z, A..Z, and any of \"@#* ,.;:._-+!$%&/|\?{[()]}^\\<>\".
-Try again."));
- UI::SetFocus(`id(`pw1) );
- widget = `again;
- }
- }
}
}
until (widget == `abort || widget == `back || widget == `next);
@@ -566,9 +531,9 @@
if (widget == `next)
{
if (data["type"]:`unknown != `loop)
- Storage::UpdateClassified(data["device"]:"", pw1);
+ Storage::UpdateClassified(data["device"]:"", password);
else
- Storage::UpdateClassified(data["fpath"]:"", pw1);
+ Storage::UpdateClassified(data["fpath"]:"", password);
widget = `finish;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-storage-2.18.16/storage/src/inst_disk_proposal.ycp new/yast2-storage-2.18.17/storage/src/inst_disk_proposal.ycp
--- old/yast2-storage-2.18.16/storage/src/inst_disk_proposal.ycp 2009-07-21 16:37:07.000000000 +0200
+++ new/yast2-storage-2.18.17/storage/src/inst_disk_proposal.ycp 2009-07-27 17:40:50.000000000 +0200
@@ -31,8 +31,10 @@
import "Storage";
import "Sequencer";
import "StorageProposal";
+ import "Stage";
+
- include "partitioning/custom_part_check_generated.ycp";
+ include "partitioning/custom_part_dialogs.ycp";
define boolean AskOverwriteChanges()
@@ -128,7 +130,7 @@
// Radiobutton for partition dialog
string lvm_str = _("&LVM Based");
// Checkbox for partition dialog
-string encrypt_str = _("Encrypt TODO");
+string encrypt_str = _("Encrypt Volume Group");
string target_is = "";
@@ -170,13 +172,13 @@
term rframe =
`HBox(
`HSpacing(3),
- `MinWidth(20, `Left(`RadioButton(`id(`part), `opt(`notify), part_str,
- !StorageProposal::GetProposalLvm()))),
+ `Top(`MinWidth(20, `Left(`RadioButton(`id(`part), `opt(`notify), part_str,
+ !StorageProposal::GetProposalLvm())))),
`HSpacing(3),
- `MinWidth(20, `VBox(`Left(`RadioButton(`id(`lvm), `opt(`notify), lvm_str,
- StorageProposal::GetProposalLvm())),
- `HBox(`HSpacing(4), `CheckBox(`id(`encrypt), `opt(`notify), encrypt_str,
- StorageProposal::GetProposalEncrypt())))),
+ `Top(`MinWidth(20, `VBox(`Left(`RadioButton(`id(`lvm), `opt(`notify), lvm_str,
+ StorageProposal::GetProposalLvm())),
+ `Left(`HBox(`HSpacing(4), `CheckBox(`id(`encrypt), `opt(`notify), encrypt_str,
+ StorageProposal::GetProposalEncrypt())))))),
`HSpacing(3)
);
@@ -251,10 +253,11 @@
if( Stage::initial () )
Wizard::SetTitleIcon( "yast-partitioning" );
+ UI::ChangeWidget(`id(`encrypt), `Enabled, StorageProposal::GetProposalLvm());
+
repeat
{
- symbol old_mode = (symbol)UI::QueryWidget( `id("prop_mode"),
- `CurrentButton );
+ symbol old_mode = (symbol) UI::QueryWidget(`id("prop_mode"), `CurrentButton);
y2milestone( "old_mode %1", old_mode );
Wizard::SetFocusToNextButton();
ret = (symbol)Wizard::UserInput();
@@ -273,15 +276,32 @@
{
case `part:
StorageProposal::SetProposalLvm(false);
+ UI::ChangeWidget(`id(`encrypt), `Enabled, false);
break;
case `lvm:
StorageProposal::SetProposalLvm(true);
+ UI::ChangeWidget(`id(`encrypt), `Enabled, true);
break;
case `encrypt:
- StorageProposal::SetProposalEncrypt((boolean) UI::QueryWidget(`id(`encrypt), `Value));
- StorageProposal::SetProposalPassword("12345678"); // TODO
+
+ if ((boolean) UI::QueryWidget(`id(`encrypt), `Value))
+ {
+ if (QueryProposalPassword())
+ {
+ StorageProposal::SetProposalEncrypt(true);
+ }
+ else
+ {
+ UI::ChangeWidget(`id(`encrypt), `Value, false);
+ continue;
+ }
+ }
+ else
+ {
+ StorageProposal::SetProposalEncrypt(false);
+ }
break;
}
@@ -337,12 +357,13 @@
UI::ChangeWidget( `id("richtext"), `Value, changes );
if( ret==`detailed )
{
- if( StorageProposal::GetProposalLvm() )
- UI::ChangeWidget( `id("prop_mode"), `CurrentButton, `lvm );
- else
- UI::ChangeWidget( `id("prop_mode"), `CurrentButton, `part );
+ UI::ChangeWidget(`id(`part), `Value, !StorageProposal::GetProposalLvm());
+ UI::ChangeWidget(`id(`lvm), `Value, StorageProposal::GetProposalLvm());
+ UI::ChangeWidget(`id(`encrypt), `Enabled, StorageProposal::GetProposalLvm());
+ UI::ChangeWidget(`id(`encrypt), `Value, StorageProposal::GetProposalEncrypt());
}
}
+
} until ( ret == `next || ret == `back || ret == `cancel );
}
Storage::SaveExitKey( ret );
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-storage-2.18.16/storage/src/inst_target_part.ycp new/yast2-storage-2.18.17/storage/src/inst_target_part.ycp
--- old/yast2-storage-2.18.16/storage/src/inst_target_part.ycp 2009-07-21 16:37:07.000000000 +0200
+++ new/yast2-storage-2.18.17/storage/src/inst_target_part.ycp 2009-07-27 17:42:40.000000000 +0200
@@ -9,7 +9,7 @@
* -Ask the user which partition to use.
* -Check the input and return error-messages.
*
- * $Id: inst_target_part.ycp 57914 2009-07-07 13:56:29Z aschnell $
+ * $Id: inst_target_part.ycp 58178 2009-07-27 15:42:43Z aschnell $
*/
{
textdomain "storage";
@@ -55,6 +55,7 @@
include "partitioning/auto_part_prepare.ycp";
include "partitioning/auto_part_ui.ycp";
include "partitioning/auto_part_create.ycp";
+ include "partitioning/custom_part_dialogs.ycp";
// Displays a popup with the message (can be dismissed with OK).
// After that only `abort or `back is allowed
@@ -212,6 +213,8 @@
if( disable_full && UI::WidgetExists( `id(`full) ))
UI::ChangeWidget( `id(`full), `Enabled, false );
+ UI::ChangeWidget(`id(`encrypt), `Enabled, (boolean) UI::QueryWidget(`id(`lvm), `Value));
+
// Event handling
symbol ret = nil;
@@ -226,6 +229,18 @@
{
break;
}
+ else if (ret == `lvm)
+ {
+ UI::ChangeWidget(`id(`encrypt), `Enabled, (boolean) UI::QueryWidget(`id(`lvm), `Value));
+ }
+ else if (ret == `encrypt)
+ {
+ if ((boolean) UI::QueryWidget(`id(`encrypt), `Value))
+ {
+ if (!QueryProposalPassword())
+ UI::ChangeWidget(`id(`encrypt), `Value, false);
+ }
+ }
else if (ret == `full)
{
// Set all checkboxes
@@ -390,18 +405,15 @@
y2milestone ("partitions '%1'", partitions);
- // Check selection for plausability
- string reason = nil;
StorageProposal::SetProposalHome( (boolean)UI::QueryWidget( `id(`home), `Value ));
- if( (boolean)UI::QueryWidget( `id(`lvm), `Value )==true )
- StorageProposal::SetProposalLvm(true);
- else
- StorageProposal::SetProposalLvm(false);
+ StorageProposal::SetProposalLvm((boolean) UI::QueryWidget(`id(`lvm), `Value));
+ StorageProposal::SetProposalEncrypt((boolean) UI::QueryWidget(`id(`encrypt), `Value));
+
ok = create_partitions( targetMap, target, partitions );
StorageProposal::SetProposalDefault(true);
if( !ok )
{
- reason = _("Too few partitions are marked for removal
+ string reason = _("Too few partitions are marked for removal
or the disk is too small.
To install Linux, select more partitions to
remove or select a larger disk.");
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/yast2-storage-2.18.16/storage/src/modules/Storage.ycp new/yast2-storage-2.18.17/storage/src/modules/Storage.ycp
--- old/yast2-storage-2.18.16/storage/src/modules/Storage.ycp 2009-07-24 15:38:51.000000000 +0200
+++ new/yast2-storage-2.18.17/storage/src/modules/Storage.ycp 2009-07-28 11:05:43.000000000 +0200
@@ -19,7 +19,7 @@
* wurde versucht "intelligent" zu gestallten und ist im einzelen bei den
* entspechenden Funktionen n�her erkl�rt.
*
- * $Id: Storage.ycp 58150 2009-07-24 13:38:53Z aschnell $
+ * $Id: Storage.ycp 58185 2009-07-28 09:05:45Z aschnell $
*/
{
module "Storage";
@@ -5786,4 +5786,51 @@
}
+ global boolean CheckEncryptionPasswords(string pw1, string pw2, integer min_length, boolean empty_allowed)
+ {
+ if (pw1 != pw2)
+ {
+ // popup text
+ Popup::Message(_("The first and the second version
+of the password do not match.
+Try again."));
+ return false;
+ }
+
+ if (isempty(pw1))
+ {
+ if (!empty_allowed)
+ {
+ // popup text
+ Popup::Message(_("You did not enter a password.
+Try again.
+"));
+ return false;
+ }
+ }
+ else
+ {
+ if (size(pw1) < min_length)
+ {
+ // popup text
+ Popup::Message(sformat(_("The password must have at least %1 characters.
+Try again.
+"), min_length));
+ return false;
+ }
+
+ string allowed_chars = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ#* ,.;:._-+!$%&/|\?{[()]}@^\\<>";
+ if (findfirstnotof(pw1, allowed_chars) != nil)
+ {
+ // popup text
+ Popup::Message(_("The password may only contain the following characters:
+0..9, a..z, A..Z, and any of \"@#* ,.;:._-+!$%&/|\?{[()]}^\\<>\".
+Try again."));
+ return false;
+ }
+ }
+
+ return true;
+ }
+
}
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org