Hello community,
here is the log from the commit of package yast2-users
checked in at Tue Sep 12 16:18:24 CEST 2006.
--------
--- yast2-users/yast2-users.changes 2006-09-07 13:35:18.000000000 +0200
+++ yast2-users/yast2-users.changes 2006-09-12 15:35:58.000000000 +0200
@@ -1,0 +2,9 @@
+Thu Sep 7 13:43:23 CEST 2006 - jsuchome@suse.cz
+
+- minor fixes in help text (#203819)
+- allowed changing of new user's home mode and default umask (F3621)
+- fixed wrong usage of Progress->set
+- fixed setting of user's default group (#203761)
+- 2.13.25
+
+-------------------------------------------------------------------
Old:
----
yast2-users-2.13.24.tar.bz2
New:
----
yast2-users-2.13.25.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ yast2-users.spec ++++++
--- /var/tmp/diff_new_pack.1ul7MY/_old 2006-09-12 16:18:14.000000000 +0200
+++ /var/tmp/diff_new_pack.1ul7MY/_new 2006-09-12 16:18:14.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package yast2-users (Version 2.13.24)
+# spec file for package yast2-users (Version 2.13.25)
#
# Copyright (c) 2006 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.13.24
+Version: 2.13.25
Release: 1
License: GPL
Group: System/YaST
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-Source0: yast2-users-2.13.24.tar.bz2
+Source0: yast2-users-2.13.25.tar.bz2
prefix: /usr
BuildRequires: cracklib-devel doxygen gcc-c++ perl-Digest-SHA1 perl-XML-Writer update-desktop-files yast2 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-gettext yast2-ldap-client
@@ -42,7 +42,7 @@
Jiri Suchomel
%prep
-%setup -n yast2-users-2.13.24
+%setup -n yast2-users-2.13.25
%build
%{prefix}/bin/y2tool y2autoconf
@@ -86,6 +86,12 @@
%changelog -n yast2-users
* Thu Sep 07 2006 - jsuchome@suse.cz
+- minor fixes in help text (#203819)
+- allowed changing of new user's home mode and default umask (F3621)
+- fixed wrong usage of Progress->set
+- fixed setting of user's default group (#203761)
+- 2.13.25
+* Thu Sep 07 2006 - jsuchome@suse.cz
- enhanced writing performance using UserPasswd.pm (#148482, F301176)
- because of UserPasswd.pm, disabled the tests relying on input data
- 2.13.24
++++++ yast2-users-2.13.24.tar.bz2 -> yast2-users-2.13.25.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-users-2.13.24/VERSION new/yast2-users-2.13.25/VERSION
--- old/yast2-users-2.13.24/VERSION 2006-09-07 11:25:21.000000000 +0200
+++ new/yast2-users-2.13.25/VERSION 2006-09-07 15:50:00.000000000 +0200
@@ -1 +1 @@
-2.13.24
+2.13.25
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-users-2.13.24/src/Users.pm new/yast2-users-2.13.25/src/Users.pm
--- old/yast2-users-2.13.24/src/Users.pm 2006-09-07 11:34:28.000000000 +0200
+++ new/yast2-users-2.13.25/src/Users.pm 2006-09-11 11:20:05.000000000 +0200
@@ -4,7 +4,7 @@
# Package: Configuration of users and groups
# Summary: I/O routines + main data structures
#
-# $Id: Users.pm 32367 2006-08-16 08:30:50Z jsuchome $
+# $Id: Users.pm 32758 2006-09-07 11:37:57Z jsuchome $
#
package Users;
@@ -117,6 +117,7 @@
my $customs_modified = 0;
my $defaults_modified = 0;
my $security_modified = 0;
+my $login_defs_modified = 0;
# variables describing available users sets:
my $nis_available = 1;
@@ -215,6 +216,7 @@
YaST::YCP::Import ("Security");
YaST::YCP::Import ("Service");
YaST::YCP::Import ("Stage");
+YaST::YCP::Import ("String");
YaST::YCP::Import ("ProductFeatures");
YaST::YCP::Import ("Progress");
YaST::YCP::Import ("Report");
@@ -281,6 +283,7 @@
$ldap_modified ||
$customs_modified ||
$defaults_modified ||
+ $login_defs_modified ||
$security_modified;
return $ret;
@@ -374,6 +377,23 @@
return \@available_groupsets;
}
+# return the global $umask value
+BEGIN { $TYPEINFO{GetUmask} = ["function", "string"]; }
+sub GetUmask {
+ return $umask;
+}
+
+# set the new value of umask
+BEGIN { $TYPEINFO{SetUmask} = ["function", "void", "string"]; }
+sub SetUmask {
+ my $self = shift;
+ my $u = shift;
+ if (defined ($u) && $u ne "" && $u ne $umask) {
+ $umask = $u;
+ $login_defs_modified = 1;
+ }
+}
+
##------------------------------------
# current users = name of user sets currently shown in table ("local", "nis")
BEGIN { $TYPEINFO{GetCurrentUsers} = ["function", ["list", "string"]]; }
@@ -1193,7 +1213,7 @@
if (! Security->GetModified ()) {
my $progress_orig = Progress->set (0);
Security->Read ();
- if ($use_gui) { Progress->set ($progress_orig); }
+ Progress->set ($progress_orig);
}
my %security = %{Security->Export ()};
@@ -3713,6 +3733,20 @@
}
##------------------------------------
+# Writes settings to /etc/login.defs
+sub WriteLoginDefs {
+
+ my $ret = 1;
+
+ $ret = SCR->Write (".etc.login_defs.UMASK", $umask);
+ if ($ret) {
+ SCR->Write (".etc.login_defs", "force");
+ }
+ y2milestone ("Succesfully written /etc/login.defs: $ret");
+ return $ret;
+}
+
+##------------------------------------
# Save Security settings (encryption method) if changed in Users module
BEGIN { $TYPEINFO{WriteSecurity} = ["function", "boolean"]; }
sub WriteSecurity {
@@ -3727,9 +3761,7 @@
Security->Import (\%security);
my $progress_orig = Progress->set (0);
$ret = Security->Write();
- if (!$write_only && $use_gui) {
- Progress->set ($progress_orig);
- }
+ Progress->set ($progress_orig);
}
y2milestone ("Security module settings written: $ret");
return $ret;
@@ -4198,10 +4230,17 @@
if ((bool ($create_home) || $user_mod eq "imported")
&& !%{SCR->Read (".target.stat", $home)})
{
- UsersRoutines->CreateHome ($skel, $home, $umask);
+ UsersRoutines->CreateHome ($skel, $home);
}
if ($home ne "/var/lib/nobody") {
- UsersRoutines->ChownHome ($uid, $gid, $home);
+ if (UsersRoutines->ChownHome ($uid, $gid, $home))
+ {
+ my $mode = 777 - String->CutZeros ($umask);
+ if (defined ($user{"home_mode"})) {
+ $mode = $user{"home_mode"};
+ }
+ UsersRoutines->ChmodHome($home, $mode);
+ }
}
if ($useradd_cmd ne "" && FileUtils->Exists ($useradd_cmd))
{
@@ -4310,6 +4349,9 @@
$defaults_modified = 0;
}
}
+ if ($login_defs_modified && $self->WriteLoginDefs ()) {
+ $login_defs_modified = 0;
+ }
if ($security_modified) {
if ($self->WriteSecurity()) {
@@ -6321,7 +6363,7 @@
sub SetModified {
my $self = shift;
$users_modified = $groups_modified = $customs_modified =
- $defaults_modified = $security_modified = $_[0];
+ $defaults_modified = $security_modified = $login_defs_modified = $_[0];
}
BEGIN { $TYPEINFO{SetExportAll} = ["function", "void", "boolean"];}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-users-2.13.24/src/UsersRoutines.pm new/yast2-users-2.13.25/src/UsersRoutines.pm
--- old/yast2-users-2.13.24/src/UsersRoutines.pm 2006-07-26 09:39:07.000000000 +0200
+++ new/yast2-users-2.13.25/src/UsersRoutines.pm 2006-09-08 16:49:44.000000000 +0200
@@ -35,7 +35,6 @@
my $self = shift;
my $skel = $_[0];
my $home = $_[1];
- my $umask = $_[2];
# create a path to new home directory, if not exists
my $home_path = substr ($home, 0, rindex ($home, "/"));
@@ -61,9 +60,6 @@
# now copy homedir from skeleton
else {
my $command = "/bin/cp -r $skel $home";
- if (defined $umask && $umask ne "") {
- $command = "umask $umask; $command";
- }
my %out = %{SCR->Execute (".target.bash_output", $command)};
if (($out{"stderr"} || "") ne "") {
y2error ("error calling $command: ", $out{"stderr"} || "");
@@ -113,6 +109,36 @@
}
##------------------------------------
+# Change mode of directory
+# @param home name of new home directory
+# @param mode for the directory
+# @return success
+BEGIN { $TYPEINFO{ChmodHome} = ["function",
+ "boolean",
+ "integer", "integer", "string"];
+}
+sub ChmodHome {
+
+ my $self = shift;
+ my $home = shift;
+ my $mode = shift;
+
+ if (!defined $home || !defined $mode) {
+ y2error ("missing arguments");
+ return 0;
+ }
+
+ my $command = "/bin/chmod $mode $home";
+ my %out = %{SCR->Execute (".target.bash_output", $command)};
+ if (($out{"stderr"} || "") ne "") {
+ y2error ("error calling $command: ", $out{"stderr"} || "");
+ return 0;
+ }
+ y2milestone ("Mode of directory $home changed to $mode");
+ return 1;
+}
+
+##------------------------------------
# Move the directory
# @param org_home original name of directory
# @param home name of new home directory
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-users-2.13.24/src/dialogs.ycp new/yast2-users-2.13.25/src/dialogs.ycp
--- old/yast2-users-2.13.24/src/dialogs.ycp 2006-09-07 09:39:56.000000000 +0200
+++ new/yast2-users-2.13.25/src/dialogs.ycp 2006-09-12 13:24:16.000000000 +0200
@@ -5,7 +5,7 @@
* Authors: Johannes Buchhold ,
* Jiri Suchomel
*
- * $Id: dialogs.ycp 31989 2006-07-26 07:42:34Z jsuchome $
+ * $Id: dialogs.ycp 31992 2006-07-26 07:43:01Z jsuchome $
*/
{
@@ -23,6 +23,7 @@
import "Progress";
import "Report";
import "Stage";
+import "String";
import "Summary";
import "Users";
import "UsersCache";
@@ -152,6 +153,9 @@
string default_home = Users::GetDefaultHome (user_type);
string home = user["homedirectory"]:default_home;
string org_home = user["org_homedirectory"]:home;
+ string default_mode =
+ sformat ("%1", 777 - tointeger (String::CutZeros (Users::GetUmask ())));
+ string mode = user["home_mode"]:default_mode;
string password = (string)user["userpassword"]:nil;
string org_username = user["org_uid"]:username;
integer uid = GetInt (user["uidnumber"]:nil, nil);
@@ -227,6 +231,7 @@
cn = user["cn"]:cn;
home = user["homedirectory"]:home;
org_home = user["org_homedirectory"]:org_home;
+ mode = user["home_mode"]:default_mode;
password = user["userpassword"]:password;
org_username = user["org_uid"]:org_username;
uid = GetInt (user["uidnumber"]:nil, uid);
@@ -477,6 +482,12 @@
// textentry label
`TextEntry( `id(`home), _("&Home Directory"), home )
);
+ term new_user_term = what != "add_user" ? `VBox () : `VBox (
+ // textentry label
+ `TextEntry (`id(`mode), _("Home Directory &Permission Mode"), mode),
+ // check box label
+ `Left (`CheckBox (`id(`skel), _("E&mpty Home"), no_skel))
+ );
return `HBox (
`HSpacing(1),
`VBox(
@@ -493,11 +504,7 @@
sformat("%1",uid ))),
`Top(`VBox(
`HBox ( home_w, browse),
- what != "add_user" ? `VSpacing (0) :
- `Left (
- // check box label
- `CheckBox (`id(`skel), _("E&mpty Home"), no_skel)
- )
+ new_user_term
)),
additional_data,
`Top(edit_shell),
@@ -1097,6 +1104,7 @@
if (what == "add_user")
{
no_skel = (boolean) UI::QueryWidget(`id(`skel),`Value);
+ mode = (string) UI::QueryWidget(`id(`mode), `Value);
}
if ((findlastof (new_home, "/") + 1) == size (new_home))
{
@@ -1155,6 +1163,8 @@
if (defaultgroup != new_defaultgroup)
{
map g = Users::GetGroupByName (new_defaultgroup, new_type);
+ if (g == $[])
+ g = Users::GetGroupByName (new_defaultgroup, "");
gid = GetInt (g["gidnumber"]:nil, gid);
}
@@ -1237,6 +1247,7 @@
user["create_home"] = create_home;
user["addit_data"] = addit_data;
user["no_skeleton"] = no_skel;
+ user["home_mode"] = mode;
}
if (current == `passwordsettings && (ret == `next || tab))
@@ -1437,6 +1448,11 @@
{
UI::ChangeWidget (`id (`browse), `Enabled, false);
}
+ if (UI::WidgetExists (`id (`mode)))
+ {
+ UI::ChangeWidget (`id (`mode), `ValidChars, "01234567");
+ UI::ChangeWidget (`id (`mode), `InputMaxLength, 3);
+ }
UI::ChangeWidget(`id(`shell), `Value, shell);
current = ret;
@@ -2061,6 +2077,7 @@
(list<string>) maplist (string g,integer i, groups, ``(g)), ",");
string exp_date = "";
+ string umask = Users::GetUmask ();
list available_groups = [];
list available_shells = Users::AllShells ();
@@ -2122,6 +2139,7 @@
`PushButton(`id(`brow_s),`opt(`key_F7), _("Bro&wse..."))
)
),
+ `TextEntry (`id(`umask), _("&Umask for Home Directory"), umask),
// text entry
`TextEntry( `id(`exp), _("Default E&xpiration Date"), exp_date),
// intfield
@@ -2142,8 +2160,11 @@
Wizard::HideAbortButton ();
UI::ChangeWidget(`id(`shell), `Value, shell);
+ UI::ChangeWidget (`id (`umask), `ValidChars, "01234567");
+ UI::ChangeWidget (`id (`umask), `InputMaxLength, 3);
boolean modified = false;
+ boolean login_defs_modified = false;
string new_home = home;
string new_shell = shell;
@@ -2153,6 +2174,7 @@
integer new_inact = inact;
string new_expire = expire;
string new_grouplist = grouplist;
+ string new_umask = umask;
symbol ret = `next;
while (true)
@@ -2193,6 +2215,7 @@
new_defgroup = (string)UI::QueryWidget(`id(`defaultgroup),`Value);
new_exp_date = (string)UI::QueryWidget(`id(`exp),`Value);
new_grouplist = (string)UI::QueryWidget(`id(`grouplist),`Value);
+ new_umask = (string)UI::QueryWidget(`id(`umask), `Value);
// check new grouplist...
if (new_grouplist != grouplist)
{
@@ -2324,6 +2347,8 @@
}
if (defaultgroup != new_defgroup || inact != new_inact)
modified = true;
+ if (new_umask != umask)
+ login_defs_modified = true;
break;
}
}
@@ -2341,6 +2366,10 @@
];
Users::SetLoginDefaults (new_defaults, new_defgroup);
}
+ if (login_defs_modified)
+ {
+ Users::SetUmask (new_umask);
+ }
return ret;
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/yast2-users-2.13.24/src/helps.ycp new/yast2-users-2.13.25/src/helps.ycp
--- old/yast2-users-2.13.24/src/helps.ycp 2006-07-26 09:39:10.000000000 +0200
+++ new/yast2-users-2.13.25/src/helps.ycp 2006-09-07 14:35:03.000000000 +0200
@@ -107,6 +107,11 @@
The contents of this directory are copied to a user's home directory when a new user is added. </p>
")
+
+
+// Help text 4.5/6
+_("<p><b>Umask for Home Directory</b><br>
+Umask which is used by for creating new home directories.</p>") +
+
// Help text 5/6:
// Don't reorder letters YYYY-MM-DD, date must be set in this format
_("<p><b>Expiration Date</b><br>
@@ -198,7 +203,7 @@
help = help +
// help text 2/7
_("<p>
-Create the <b>User Login</b> from components of the full name by
+Create the <b>Username</b> from components of the full name by
clicking <b>Suggestion</b>. It may be modified, but use only
letters (no accented characters), digits, and <tt>._-</tt>.
Do not use uppercase letters in this entry unless you know what you are doing.
@@ -225,7 +230,7 @@
{
// help text 4/7 (only during installation)
help = help + _("<p>
-The username and password created here are needed to log in and work with your Linux system. With <b>Auto Login</b> enabled, the login procedure is skipped. This user is logged in automatically.</p>
+The username and password created here are needed to log in and work with your Linux system. With <b>Automatic Login</b> enabled, the login procedure is skipped. This user is logged in automatically.</p>
") +
// help text 5/7 (only during installation)
@@ -365,6 +370,9 @@
");
if (what == "add_user")
{
+ // help text for user's home directory mode
+ helptext = helptext + _("<p>Optionally, set the <b>Home Directory Permission Mode</b> for this user's home directory differenty from the default.</p>");
+
map defaults = Users::GetLoginDefaults ();
helptext = helptext +
// alternate helptext 4.5/8; %1 is directory (e.g. '/etc/skel')
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org