Mailinglist Archive: yast-commit (759 mails)
| < Previous | Next > |
[yast-commit] r45196 - in /trunk/users: VERSION package/yast2-users.changes src/Users.pm src/dialogs.ycp src/inst_root_first.ycp src/inst_user.ycp src/inst_user_first.ycp
- From: jsuchome@xxxxxxxxxxxxxxxx
- Date: Wed, 05 Mar 2008 08:45:34 -0000
- Message-id: <20080305084534.9B50727DAE@xxxxxxxxxxxxxxxx>
Author: jsuchome
Date: Wed Mar 5 09:45:33 2008
New Revision: 45196
URL: http://svn.opensuse.org/viewcvs/yast?rev=45196&view=rev
Log:
- during installation, check if future /home doesn't contain home
directory for the first user and adapt UID of the user according
to directory owner (fate#302980)
- use internal defaults if /etc/default/useradd cannot be read
(bnc#365116)
- 2.16.15
Modified:
trunk/users/VERSION
trunk/users/package/yast2-users.changes
trunk/users/src/Users.pm
trunk/users/src/dialogs.ycp
trunk/users/src/inst_root_first.ycp
trunk/users/src/inst_user.ycp
trunk/users/src/inst_user_first.ycp
Modified: trunk/users/VERSION
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/users/VERSION?rev=45196&r1=45195&r2=45196&view=diff
==============================================================================
--- trunk/users/VERSION (original)
+++ trunk/users/VERSION Wed Mar 5 09:45:33 2008
@@ -1 +1 @@
-2.16.14
+2.16.15
Modified: trunk/users/package/yast2-users.changes
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/users/package/yast2-users.changes?rev=45196&r1=45195&r2=45196&view=diff
==============================================================================
--- trunk/users/package/yast2-users.changes (original)
+++ trunk/users/package/yast2-users.changes Wed Mar 5 09:45:33 2008
@@ -1,4 +1,14 @@
-------------------------------------------------------------------
+Wed Mar 5 09:36:14 CET 2008 - jsuchome@xxxxxxx
+
+- during installation, check if future /home doesn't contain home
+ directory for the first user and adapt UID of the user according
+ to directory owner (fate#302980)
+- use internal defaults if /etc/default/useradd cannot be read
+ (bnc#365116)
+- 2.16.15
+
+-------------------------------------------------------------------
Fri Feb 29 13:45:31 CET 2008 - jsuchome@xxxxxxx
- fixed removing LDAP Shadow Account plugin (bnc#364833)
Modified: trunk/users/src/Users.pm
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/users/src/Users.pm?rev=45196&r1=45195&r2=45196&view=diff
==============================================================================
--- trunk/users/src/Users.pm (original)
+++ trunk/users/src/Users.pm Wed Mar 5 09:45:33 2008
@@ -1339,9 +1339,7 @@
my $self = shift;
foreach my $key (sort keys %useradd_defaults) {
my $entry = SCR->Read (".etc.default.useradd.\"\Q$key\E\"");
- if (!$entry) {
- $entry = "";
- }
+ next if (!$entry); # use the defatuls set in this file
$entry =~ s/\"//g;
$useradd_defaults{$key} = $entry;
}
Modified: trunk/users/src/dialogs.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/users/src/dialogs.ycp?rev=45196&r1=45195&r2=45196&view=diff
==============================================================================
--- trunk/users/src/dialogs.ycp (original)
+++ trunk/users/src/dialogs.ycp Wed Mar 5 09:45:33 2008
@@ -97,10 +97,10 @@
`VBox (
`VSpacing (0.5),
// password entry label
- `Password (`id (`pw1), _("To access the data required to modify
+ `Password (`id (`pw1), `opt (`hstretch), _("To access the data
required to modify
the encryption settings for this user,
enter the user's current password.")),
- `Password (`id(`pw2), Label::ConfirmPassword(), ""),
+ `Password (`id(`pw2),`opt (`hstretch), Label::ConfirmPassword(),""),
`HBox(
`PushButton (`id(`ok),`opt(`key_F10), Label::OKButton()),
`PushButton (`id(`cancel),`opt(`key_F9), Label::CancelButton())
Modified: trunk/users/src/inst_root_first.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/users/src/inst_root_first.ycp?rev=45196&r1=45195&r2=45196&view=diff
==============================================================================
--- trunk/users/src/inst_root_first.ycp (original)
+++ trunk/users/src/inst_root_first.ycp Wed Mar 5 09:45:33 2008
@@ -5,7 +5,7 @@
* Dialog for setting root's password during 1st stage of the installation
* Authors: Jiri Suchomel <jsuchome@xxxxxxx>
*
- * $Id:$
+ * $Id$
*/
{
textdomain "users";
@@ -39,11 +39,13 @@
// advise user to remember his new password
`Label(_("Do not forget what you enter here.")),
`VSpacing(0.8),
- // Label: get password for user root
- `Password (`id(`pw1), _("&Password for root User"), ""),
+ `Password (`id(`pw1), `opt (`hstretch),
+ // Label: get password for user root
+ _("&Password for root User"), ""),
`VSpacing(0.8),
- // Label: get same password again for verification
- `Password (`id(`pw2), _("Con&firm Password"), "")
+ `Password (`id(`pw2), `opt (`hstretch),
+ // Label: get same password again for verification
+ _("Con&firm Password"), "")
)),
`VStretch ()
);
Modified: trunk/users/src/inst_user.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/users/src/inst_user.ycp?rev=45196&r1=45195&r2=45196&view=diff
==============================================================================
--- trunk/users/src/inst_user.ycp (original)
+++ trunk/users/src/inst_user.ycp Wed Mar 5 09:45:33 2008
@@ -38,9 +38,10 @@
y2milestone ("user defined in 1st stage, let's save now...");
boolean progress_orig = Progress::set (false);
Users::Read ();
- string error = Users::AddUser (user); //TODO check ret values
- error = Users::CheckUser ($[]);
- if (Users::CommitUser ())
+ string error = Users::AddUser (user);
+ if (error == "")
+ error = Users::CheckUser ($[]);
+ if (error == "" && Users::CommitUser ())
{
if (UsersSimple::AutologinUsed ())
{
@@ -56,6 +57,8 @@
error = Users::Write ();
UsersSimple::SetUser ($[]);
}
+ if (error != "")
+ y2error ("error while creating user: %1", error);
Progress::set (progress_orig);
return `next;
}
Modified: trunk/users/src/inst_user_first.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/users/src/inst_user_first.ycp?rev=45196&r1=45195&r2=45196&view=diff
==============================================================================
--- trunk/users/src/inst_user_first.ycp (original)
+++ trunk/users/src/inst_user_first.ycp Wed Mar 5 09:45:33 2008
@@ -8,6 +8,7 @@
*/
{
import "Arch";
+ import "Directory";
import "GetInstArgs";
import "Label";
import "Mode";
@@ -16,13 +17,16 @@
import "Package";
import "Progress";
import "Report";
+ import "Storage";
import "String";
import "UsersSimple";
import "Wizard";
textdomain "users";
- map display_info = UI::GetDisplayInfo ();
+ map home_map = Storage::GetEntryForMountpoint( "/home" );
+ string tmpdir = Directory::tmpdir;
+ map display_info = UI::GetDisplayInfo ();
boolean text_mode = display_info["TextMode"]:false;
string arch = Arch::architecture ();
@@ -334,6 +338,7 @@
string username = user["uid"]:"";
string cn = user["cn"]:"";
string password = (string)user["userpassword"]:nil;
+ integer uidnumber = user["uidnumber"]:-1;
// this user gets root's mail
boolean root_mail =
@@ -519,9 +524,19 @@
UI::SetFocus (`id (`pw1));
continue;
}
-
- // FIXME home dir checks -> change UID if home is found
- // all the checks are done, we can save the data
+ // set UID if home directory is found on future home partition
+ if (home_map != $[] && home_map["format"]:false == false)
+ {
+ string dir = tmpdir + "/home";
+ SCR::Execute (.target.mkdir, dir);
+ if ((boolean)
+ SCR::Execute (.target.mount, [home_map["device"]:"", dir]))
+ {
+ map stat = (map)SCR::Read (.target.stat, dir+"/"+ username);
+ uidnumber = stat["uid"]:-1;
+ SCR::Execute (.target.umount, dir);
+ }
+ }
password = pw1;
}
if (contains ([`back, `abort, `cancel, `next], ret))
@@ -534,11 +549,14 @@
if (auth_method == "users" && username != "")
{
// save the first user data
- UsersSimple::SetUser ($[
+ map<string,any> user_map = $[
"uid" : username,
"userpassword" : password,
"cn" : cn
- ]);
+ ];
+ if (uidnumber != -1)
+ user_map["uidnumber"] = uidnumber;
+ UsersSimple::SetUser (user_map);
boolean root_pw = (boolean) UI::QueryWidget (`id (`root_pw),`Value);
UsersSimple::SkipRootPasswordDialog (root_pw);
UsersSimple::SetRootPassword (root_pw ? password : "");
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx
Date: Wed Mar 5 09:45:33 2008
New Revision: 45196
URL: http://svn.opensuse.org/viewcvs/yast?rev=45196&view=rev
Log:
- during installation, check if future /home doesn't contain home
directory for the first user and adapt UID of the user according
to directory owner (fate#302980)
- use internal defaults if /etc/default/useradd cannot be read
(bnc#365116)
- 2.16.15
Modified:
trunk/users/VERSION
trunk/users/package/yast2-users.changes
trunk/users/src/Users.pm
trunk/users/src/dialogs.ycp
trunk/users/src/inst_root_first.ycp
trunk/users/src/inst_user.ycp
trunk/users/src/inst_user_first.ycp
Modified: trunk/users/VERSION
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/users/VERSION?rev=45196&r1=45195&r2=45196&view=diff
==============================================================================
--- trunk/users/VERSION (original)
+++ trunk/users/VERSION Wed Mar 5 09:45:33 2008
@@ -1 +1 @@
-2.16.14
+2.16.15
Modified: trunk/users/package/yast2-users.changes
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/users/package/yast2-users.changes?rev=45196&r1=45195&r2=45196&view=diff
==============================================================================
--- trunk/users/package/yast2-users.changes (original)
+++ trunk/users/package/yast2-users.changes Wed Mar 5 09:45:33 2008
@@ -1,4 +1,14 @@
-------------------------------------------------------------------
+Wed Mar 5 09:36:14 CET 2008 - jsuchome@xxxxxxx
+
+- during installation, check if future /home doesn't contain home
+ directory for the first user and adapt UID of the user according
+ to directory owner (fate#302980)
+- use internal defaults if /etc/default/useradd cannot be read
+ (bnc#365116)
+- 2.16.15
+
+-------------------------------------------------------------------
Fri Feb 29 13:45:31 CET 2008 - jsuchome@xxxxxxx
- fixed removing LDAP Shadow Account plugin (bnc#364833)
Modified: trunk/users/src/Users.pm
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/users/src/Users.pm?rev=45196&r1=45195&r2=45196&view=diff
==============================================================================
--- trunk/users/src/Users.pm (original)
+++ trunk/users/src/Users.pm Wed Mar 5 09:45:33 2008
@@ -1339,9 +1339,7 @@
my $self = shift;
foreach my $key (sort keys %useradd_defaults) {
my $entry = SCR->Read (".etc.default.useradd.\"\Q$key\E\"");
- if (!$entry) {
- $entry = "";
- }
+ next if (!$entry); # use the defatuls set in this file
$entry =~ s/\"//g;
$useradd_defaults{$key} = $entry;
}
Modified: trunk/users/src/dialogs.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/users/src/dialogs.ycp?rev=45196&r1=45195&r2=45196&view=diff
==============================================================================
--- trunk/users/src/dialogs.ycp (original)
+++ trunk/users/src/dialogs.ycp Wed Mar 5 09:45:33 2008
@@ -97,10 +97,10 @@
`VBox (
`VSpacing (0.5),
// password entry label
- `Password (`id (`pw1), _("To access the data required to modify
+ `Password (`id (`pw1), `opt (`hstretch), _("To access the data
required to modify
the encryption settings for this user,
enter the user's current password.")),
- `Password (`id(`pw2), Label::ConfirmPassword(), ""),
+ `Password (`id(`pw2),`opt (`hstretch), Label::ConfirmPassword(),""),
`HBox(
`PushButton (`id(`ok),`opt(`key_F10), Label::OKButton()),
`PushButton (`id(`cancel),`opt(`key_F9), Label::CancelButton())
Modified: trunk/users/src/inst_root_first.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/users/src/inst_root_first.ycp?rev=45196&r1=45195&r2=45196&view=diff
==============================================================================
--- trunk/users/src/inst_root_first.ycp (original)
+++ trunk/users/src/inst_root_first.ycp Wed Mar 5 09:45:33 2008
@@ -5,7 +5,7 @@
* Dialog for setting root's password during 1st stage of the installation
* Authors: Jiri Suchomel <jsuchome@xxxxxxx>
*
- * $Id:$
+ * $Id$
*/
{
textdomain "users";
@@ -39,11 +39,13 @@
// advise user to remember his new password
`Label(_("Do not forget what you enter here.")),
`VSpacing(0.8),
- // Label: get password for user root
- `Password (`id(`pw1), _("&Password for root User"), ""),
+ `Password (`id(`pw1), `opt (`hstretch),
+ // Label: get password for user root
+ _("&Password for root User"), ""),
`VSpacing(0.8),
- // Label: get same password again for verification
- `Password (`id(`pw2), _("Con&firm Password"), "")
+ `Password (`id(`pw2), `opt (`hstretch),
+ // Label: get same password again for verification
+ _("Con&firm Password"), "")
)),
`VStretch ()
);
Modified: trunk/users/src/inst_user.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/users/src/inst_user.ycp?rev=45196&r1=45195&r2=45196&view=diff
==============================================================================
--- trunk/users/src/inst_user.ycp (original)
+++ trunk/users/src/inst_user.ycp Wed Mar 5 09:45:33 2008
@@ -38,9 +38,10 @@
y2milestone ("user defined in 1st stage, let's save now...");
boolean progress_orig = Progress::set (false);
Users::Read ();
- string error = Users::AddUser (user); //TODO check ret values
- error = Users::CheckUser ($[]);
- if (Users::CommitUser ())
+ string error = Users::AddUser (user);
+ if (error == "")
+ error = Users::CheckUser ($[]);
+ if (error == "" && Users::CommitUser ())
{
if (UsersSimple::AutologinUsed ())
{
@@ -56,6 +57,8 @@
error = Users::Write ();
UsersSimple::SetUser ($[]);
}
+ if (error != "")
+ y2error ("error while creating user: %1", error);
Progress::set (progress_orig);
return `next;
}
Modified: trunk/users/src/inst_user_first.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/users/src/inst_user_first.ycp?rev=45196&r1=45195&r2=45196&view=diff
==============================================================================
--- trunk/users/src/inst_user_first.ycp (original)
+++ trunk/users/src/inst_user_first.ycp Wed Mar 5 09:45:33 2008
@@ -8,6 +8,7 @@
*/
{
import "Arch";
+ import "Directory";
import "GetInstArgs";
import "Label";
import "Mode";
@@ -16,13 +17,16 @@
import "Package";
import "Progress";
import "Report";
+ import "Storage";
import "String";
import "UsersSimple";
import "Wizard";
textdomain "users";
- map display_info = UI::GetDisplayInfo ();
+ map home_map = Storage::GetEntryForMountpoint( "/home" );
+ string tmpdir = Directory::tmpdir;
+ map display_info = UI::GetDisplayInfo ();
boolean text_mode = display_info["TextMode"]:false;
string arch = Arch::architecture ();
@@ -334,6 +338,7 @@
string username = user["uid"]:"";
string cn = user["cn"]:"";
string password = (string)user["userpassword"]:nil;
+ integer uidnumber = user["uidnumber"]:-1;
// this user gets root's mail
boolean root_mail =
@@ -519,9 +524,19 @@
UI::SetFocus (`id (`pw1));
continue;
}
-
- // FIXME home dir checks -> change UID if home is found
- // all the checks are done, we can save the data
+ // set UID if home directory is found on future home partition
+ if (home_map != $[] && home_map["format"]:false == false)
+ {
+ string dir = tmpdir + "/home";
+ SCR::Execute (.target.mkdir, dir);
+ if ((boolean)
+ SCR::Execute (.target.mount, [home_map["device"]:"", dir]))
+ {
+ map stat = (map)SCR::Read (.target.stat, dir+"/"+ username);
+ uidnumber = stat["uid"]:-1;
+ SCR::Execute (.target.umount, dir);
+ }
+ }
password = pw1;
}
if (contains ([`back, `abort, `cancel, `next], ret))
@@ -534,11 +549,14 @@
if (auth_method == "users" && username != "")
{
// save the first user data
- UsersSimple::SetUser ($[
+ map<string,any> user_map = $[
"uid" : username,
"userpassword" : password,
"cn" : cn
- ]);
+ ];
+ if (uidnumber != -1)
+ user_map["uidnumber"] = uidnumber;
+ UsersSimple::SetUser (user_map);
boolean root_pw = (boolean) UI::QueryWidget (`id (`root_pw),`Value);
UsersSimple::SkipRootPasswordDialog (root_pw);
UsersSimple::SetRootPassword (root_pw ? password : "");
--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx
| < Previous | Next > |