Hello community,
here is the log from the commit of package yast2-users
checked in at Thu Mar 1 22:02:08 CET 2007.
--------
--- yast2-users/yast2-users.changes 2007-02-26 13:59:08.000000000 +0100
+++ /mounts/work_src_done/STABLE/yast2-users/yast2-users.changes 2007-02-28 14:38:56.215438000 +0100
@@ -1,0 +2,8 @@
+Wed Feb 28 13:46:19 CET 2007 - jsuchome@suse.cz
+
+- ask for current user password for any change with crypted
+ directory (#242531)
+- correctly change the password for directory image (#242531)
+- 2.15.16
+
+-------------------------------------------------------------------
Old:
----
yast2-users-2.15.15.tar.bz2
New:
----
yast2-users-2.15.16.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-users.spec ++++++
--- /var/tmp/diff_new_pack.r21281/_old 2007-03-01 22:01:49.000000000 +0100
+++ /var/tmp/diff_new_pack.r21281/_new 2007-03-01 22:01:49.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-users (Version 2.15.15)
+# spec file for package yast2-users (Version 2.15.16)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -11,12 +11,12 @@
# norootforbuild
Name: yast2-users
-Version: 2.15.15
+Version: 2.15.16
Release: 1
License: GNU General Public License (GPL)
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-users-2.15.15.tar.bz2
+Source0: yast2-users-2.15.16.tar.bz2
prefix: /usr
BuildRequires: cracklib-devel doxygen gcc-c++ perl-Digest-SHA1 perl-XML-Writer update-desktop-files yast2 yast2-core-devel yast2-devtools yast2-ldap-client yast2-mail-aliases yast2-perl-bindings yast2-security yast2-testsuite
Requires: yast2 yast2-perl-bindings yast2-country yast2-pam yast2-security yast2-mail-aliases cracklib perl-Digest-SHA1 perl-X500-DN perl-gettext yast2-ldap-client
@@ -42,7 +42,7 @@
Jiri Suchomel
%prep
-%setup -n yast2-users-2.15.15
+%setup -n yast2-users-2.15.16
%build
%{prefix}/bin/y2tool y2autoconf
@@ -86,6 +86,11 @@
%doc %{prefix}/share/doc/packages/yast2-users
%changelog
+* Wed Feb 28 2007 - jsuchome@suse.cz
+- ask for current user password for any change with crypted
+ directory (#242531)
+- correctly change the password for directory image (#242531)
+- 2.15.16
* Mon Feb 26 2007 - jsuchome@suse.cz
- fixed usage of new Package::Available
- 2.15.15
++++++ yast2-users-2.15.15.tar.bz2 -> yast2-users-2.15.16.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-users-2.15.15/src/dialogs.ycp new/yast2-users-2.15.16/src/dialogs.ycp
--- old/yast2-users-2.15.15/src/dialogs.ycp 2007-02-22 15:35:18.000000000 +0100
+++ new/yast2-users-2.15.16/src/dialogs.ycp 2007-02-28 13:34:59.000000000 +0100
@@ -88,6 +88,47 @@
return ret;
}
+/**
+ * Ask user for current password, see bugs 242531, 244718
+ * @return string or nil when dialog was canceled
+ */
+string AskForOldPassword () {
+
+ UI::OpenDialog (`opt(`decorated), `HBox (`HSpacing (0.5),
+ `VBox (
+ `VSpacing (0.5),
+ // password entry label
+ `Password (`id (`pw1), _("To access the data required to modify
+the encryption settings for this user,
+enter the user's current password.")),
+ `Password (`id(`pw2), Label::ConfirmPassword(), ""),
+ `HBox(
+ `PushButton (`id(`ok),`opt(`key_F10), Label::OKButton()),
+ `PushButton (`id(`cancel),`opt(`key_F9), Label::CancelButton())
+ ),
+ `VSpacing (0.5)
+ ), `HSpacing (0.5))
+ );
+ any ret = `cancel;
+ repeat
+ {
+ ret = UI::UserInput ();
+ if (ret == `ok)
+ {
+ if (UI::QueryWidget (`id(`pw1), `Value) != UI::QueryWidget (`id(`pw2), `Value))
+ {
+ Report::Error(_("The passwords do not match.
+Try again."));
+ ret = `notnext;
+ continue;
+ }
+ }
+ } until (ret == `ok || ret == `cancel);
+
+ string pw = (string) UI::QueryWidget (`id(`pw1), `Value);
+ UI::CloseDialog();
+ return (ret == `ok) ? pw : nil;
+}
/**
* Dialog for adding or editing a user.
@@ -139,6 +180,7 @@
string mode = user["home_mode"]:default_mode;
integer default_crypted_size = 100;
integer crypted_home_size = GetInt (user["crypted_home_size"]:nil, 0);
+ integer org_crypted_home_size = GetInt (user["org_user","crypted_home_size"]:nil, 0);
string password = (string)user["userpassword"]:nil;
string org_username = user["org_uid"]:username;
integer uid = GetInt (user["uidnumber"]:nil, nil);
@@ -1531,17 +1573,45 @@
ret = `notnext;
continue;
}
- if ((crypted_home_enabled && action == "edited" && user["encrypted"]:false
- && user["text_userpassword"]:nil == nil) &&
- (GetInt (user["crypted_home_size"]:nil, 0) != GetInt (user["org_user","crypted_home_size"]:nil, 0)
- ||
- (org_username != username))
+ if ((crypted_home_enabled && action == "edited" &&
+ user["current_text_userpassword"]:nil == nil) &&
+ (
+ crypted_home_size != org_crypted_home_size
+ ||
+ org_username != username
+ ||
+ // only password was changed
+ (crypted_home_size > 0 && user["encrypted"]:false == false)
+ )
)
+//FIXME also when changing the password!
{
- // popup message
- Report::Error (_("To encrypt the user's home directory, you must change the password."));
- ret = `notnext;
- continue;
+ if (false)
+ {
+ // popup message
+ Report::Error (_("To encrypt the user's home directory, you must change the password."));
+ }
+
+ // do not ask when enabling for first time and password was already entered
+ if ((user["encrypted"]:false == false || user["text_userpassword"]:nil != nil) &&
+ org_crypted_home_size == 0)
+ {
+ user["current_text_userpassword"] = (user["text_userpassword"]:nil != nil) ?
+ user["text_userpassword"]:nil : user["userpassword"]:"";
+ }
+ else
+ {
+ string old_pw = AskForOldPassword ();
+ if (old_pw != nil)
+ {
+ user["current_text_userpassword"] = old_pw;
+ }
+ else
+ {
+ ret = `notnext;
+ continue;
+ }
+ }
}
// --------------------------------- save the settings
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-users-2.15.15/src/inst_auth.ycp new/yast2-users-2.15.16/src/inst_auth.ycp
--- old/yast2-users-2.15.15/src/inst_auth.ycp 2007-02-26 10:27:33.000000000 +0100
+++ new/yast2-users-2.15.16/src/inst_auth.ycp 2007-02-26 13:59:29.000000000 +0100
@@ -5,7 +5,7 @@
* Authors: Arvin Schnell
* Michal Svec
*
- * $Id: inst_auth.ycp 35785 2007-02-01 13:21:00Z jsuchome $
+ * $Id: inst_auth.ycp 36486 2007-02-26 12:59:27Z jsuchome $
*/
{
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-users-2.15.15/src/UsersRoutines.pm new/yast2-users-2.15.16/src/UsersRoutines.pm
--- old/yast2-users-2.15.15/src/UsersRoutines.pm 2007-02-21 15:29:28.000000000 +0100
+++ new/yast2-users-2.15.16/src/UsersRoutines.pm 2007-02-28 13:43:32.000000000 +0100
@@ -290,10 +290,15 @@
my $org_size = $user->{"org_user"}{"crypted_home_size"} || 0;
my $org_home = $user->{"org_user"}{"homedirectory"} || $home;
my $org_username = $user->{"org_user"}{"uid"} || $username;
- my $pw = $user->{"text_userpassword"};
+ my $pw = $user->{"current_text_userpassword"};
+ my $new_pw = $user->{"text_userpassword"};
+ my $modified = $user->{"modified"} || "nothing";
+ if ($modified eq "added" && !defined $pw) {
+ $pw = $new_pw;
+ }
return 1 if ($home_size == 0 && $org_size == 0); # nothing to do
- return 1 if ($home eq $org_home && $username eq $org_username && $home_size == $org_size);
+ return 1 if ($home eq $org_home && $username eq $org_username && $home_size == $org_size && $pw eq $new_pw);
return 0 if !defined $pw; # no change without password provided :-(
# now crypt the home directories
@@ -317,9 +322,9 @@
my $command = "$cryptconfig open --key-file=$org_key $org_img < $pw_path";
my $out = SCR->Execute (".target.bash_output", $command);
SCR->Execute (".target.remove", $pw_path);
- if ($out->{"exit"} ne 0 && $out->{"stderr"}) {
- y2error ("error calling $command: ", $out->{"stderr"});
- Report->Error ($out->{"stderr"});
+ if ($out->{"exit"} ne 0) {
+ y2error ("error calling $command");
+ Report->Error ($out->{"stderr"}) if ($out->{"stderr"});
return 0;
}
my @stdout_l = split (/ /, $out->{"stdout"} || "");
@@ -411,14 +416,35 @@
$image_file = "$hp/$username.img";
}
+ # now solve user password change
+ if ($modified eq "edited" && defined $key_file && defined $new_pw && $new_pw ne $pw) {
+ SCR->Write (".target.string", $pw_path, "$pw\n$new_pw");
+ my $command = "$cryptconfig passwd --no-verify $key_file < $pw_path";
+ my $out = SCR->Execute (".target.bash_output", $command);
+ if ($out->{"exit"} ne 0) {
+ y2error ("error calling $command");
+ SCR->Execute (".target.remove", $pw_path);
+ Report->Error ($out->{"stderr"}) if ($out->{"stderr"});
+ return 0;
+ }
+ # from now, new password is active
+ SCR->Write (".target.string", $pw_path, $new_pw);
+ }
+
+ # resize existing image
if ($org_size < $home_size && defined $key_file && defined $image_file) {
my $add = $home_size - $org_size;
$cmd = "$cryptconfig enlarge-image --key-file=$key_file $image_file $add < $pw_path";
}
- else {
- # default command for creating the image
+ # create new image
+ elsif ($home_size > $org_size) {
$cmd = "$cryptconfig make-ehd --no-verify $username $home_size < $pw_path";
}
+ # ok, only password change was needed
+ else {
+ SCR->Execute (".target.remove", $pw_path);
+ return 1;
+ }
my $out = SCR->Execute (".target.bash_output", $cmd);
if ($out->{"exit"} ne 0 && $out->{"stderr"}) {
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-users-2.15.15/VERSION new/yast2-users-2.15.16/VERSION
--- old/yast2-users-2.15.15/VERSION 2007-02-26 13:52:16.000000000 +0100
+++ new/yast2-users-2.15.16/VERSION 2007-02-28 13:46:35.000000000 +0100
@@ -1 +1 @@
-2.15.15
+2.15.16
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org