Mailinglist Archive: yast-commit (590 mails)

< Previous Next >
[yast-commit] r61558 - in /branches/SuSE-Code-11-SP1-Branch/users: VERSION package/yast2-users.changes src/Users.pm testsuite/tests/YaPIGroupAdd.out testsuite/tests/YaPIGroupAdd.ycp
  • From: jsuchome@xxxxxxxxxxxxxxxx
  • Date: Thu, 01 Apr 2010 11:18:10 -0000
  • Message-id: <E1NxIPa-0002qF-Pr@xxxxxxxxxxxxxxxx>
Author: jsuchome
Date: Thu Apr 1 13:18:10 2010
New Revision: 61558

URL: http://svn.opensuse.org/viewcvs/yast?rev=61558&view=rev
Log:
- check user existence before adding to the group (bnc#592223)
- 2.17.40


Modified:
branches/SuSE-Code-11-SP1-Branch/users/VERSION
branches/SuSE-Code-11-SP1-Branch/users/package/yast2-users.changes
branches/SuSE-Code-11-SP1-Branch/users/src/Users.pm
branches/SuSE-Code-11-SP1-Branch/users/testsuite/tests/YaPIGroupAdd.out
branches/SuSE-Code-11-SP1-Branch/users/testsuite/tests/YaPIGroupAdd.ycp

Modified: branches/SuSE-Code-11-SP1-Branch/users/VERSION
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/users/VERSION?rev=61558&r1=61557&r2=61558&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/users/VERSION (original)
+++ branches/SuSE-Code-11-SP1-Branch/users/VERSION Thu Apr 1 13:18:10 2010
@@ -1 +1 @@
-2.17.39
+2.17.40

Modified: branches/SuSE-Code-11-SP1-Branch/users/package/yast2-users.changes
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/users/package/yast2-users.changes?rev=61558&r1=61557&r2=61558&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/users/package/yast2-users.changes
(original)
+++ branches/SuSE-Code-11-SP1-Branch/users/package/yast2-users.changes Thu Apr
1 13:18:10 2010
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Thu Apr 1 12:57:31 CEST 2010 - jsuchome@xxxxxxx
+
+- check user existence before adding to the group (bnc#592223)
+- 2.17.40
+
+-------------------------------------------------------------------
Tue Mar 30 16:09:23 CEST 2010 - jsuchome@xxxxxxx

- change home directory onwer in case of GID change (bnc#592229)

Modified: branches/SuSE-Code-11-SP1-Branch/users/src/Users.pm
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/users/src/Users.pm?rev=61558&r1=61557&r2=61558&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/users/src/Users.pm (original)
+++ branches/SuSE-Code-11-SP1-Branch/users/src/Users.pm Thu Apr 1 13:18:10 2010
@@ -5541,6 +5541,16 @@
$error = $self->CheckGroupname ($group{"cn"});
}

+ if ($error eq "") {
+ my %userlist = ();
+ if (defined $group{"userlist"}) {
+ %userlist = %{$group{"userlist"}};
+ }
+ foreach my $user (keys %userlist) {
+ my %u = %{$self->GetUserByName ($user, "")};
+ $error = sprintf (__("User %s does not exist."), $user) unless %u;
+ }
+ }
my $error_map =
UsersPlugins->Apply ("Check", {
"what" => "group",

Modified:
branches/SuSE-Code-11-SP1-Branch/users/testsuite/tests/YaPIGroupAdd.out
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/users/testsuite/tests/YaPIGroupAdd.out?rev=61558&r1=61557&r2=61558&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/users/testsuite/tests/YaPIGroupAdd.out
(original)
+++ branches/SuSE-Code-11-SP1-Branch/users/testsuite/tests/YaPIGroupAdd.out Thu
Apr 1 13:18:10 2010
@@ -34,7 +34,7 @@
Write .target.ycp "/var/lib/YaST2/users.ycp" $[] true
Execute .target.bash_output "echo 'gg2' | grep
'^[[:alpha:]_][[:alnum:]_.-]*[[:alnum:]_.$-]\\?$'" $["LANG":"C"]
$["stdout":"gg2"]
Execute .target.bash "/bin/cp /etc/group /etc/group.YaST2save" 0
-Write .target.string "/etc/group"
"audio:x:17:ii\nnobody:x:65533:\nroot:x:0:\ngg:x:1000:\ngg2:x:1001:hh1,hh2\nusers:x:100:\n+:::\n"
true
+Write .target.string "/etc/group"
"audio:x:17:ii\nnobody:x:65533:\nroot:x:0:\ngg:x:1000:\ngg2:x:1001:hh\nusers:x:100:\n+:::\n"
true
Execute .target.bash "/usr/sbin/nscd -i group" 0
Write .target.ycp "/var/lib/YaST2/users.ycp" $["custom_groups":["local"],
"custom_users":["local"], "dont_warn_when_nisserver_notdes":false,
"dont_warn_when_uppercase":false] true
Return
@@ -53,11 +53,26 @@
Write .target.ycp "/var/lib/YaST2/users.ycp" $[] true
Execute .target.bash_output "echo 'gg3' | grep
'^[[:alpha:]_][[:alnum:]_.-]*[[:alnum:]_.$-]\\?$'" $["LANG":"C"]
$["stdout":"gg3"]
Execute .target.bash "/bin/cp /etc/group /etc/group.YaST2save" 0
-Write .target.string "/etc/group"
"audio:x:17:ii\nnobody:x:65533:\nroot:x:0:\ngg:x:1000:\ngg2:x:1001:hh1,hh2\ngg3:x:1002:hh1,hh2\nusers:x:100:\n+:::\n"
true
+Write .target.string "/etc/group"
"audio:x:17:ii\nnobody:x:65533:\nroot:x:0:\ngg:x:1000:\ngg2:x:1001:hh\ngg3:x:1002:hh,ii\nusers:x:100:\n+:::\n"
true
Execute .target.bash "/usr/sbin/nscd -i group" 0
Write .target.ycp "/var/lib/YaST2/users.ycp" $["custom_groups":["local"],
"custom_users":["local"], "dont_warn_when_nisserver_notdes":false,
"dont_warn_when_uppercase":false] true
Return
Dump ============ add new group 'gg3' - done ====================
+Dump ============ add new group 'gg4' with non existent user ==
+Read .etc.default.useradd."expire" 0
+Read .etc.default.useradd."group" 100
+Read .etc.default.useradd."groups" "audio,video"
+Read .etc.default.useradd."home" "/tmp/local/home"
+Read .etc.default.useradd."inactive" 0
+Read .etc.default.useradd."shell" 0
+Read .etc.default.useradd."skel" 0
+Read .target.string "/etc/shells" 0
+Read .etc.nsswitch_conf.passwd 0
+Read .etc.nsswitch_conf.passwd 0
+Write .target.ycp "/var/lib/YaST2/users.ycp" $[] true
+Execute .target.bash_output "echo 'gg4' | grep
'^[[:alpha:]_][[:alnum:]_.-]*[[:alnum:]_.$-]\\?$'" $["LANG":"C"]
$["stdout":"gg4"]
+Return User hh2 does not exist.
+Dump ============ add new group 'gg4' - done ====================
Dump ============ add new group 'root' (groupname conflict): ======
Read .etc.default.useradd."expire" 0
Read .etc.default.useradd."group" 100

Modified:
branches/SuSE-Code-11-SP1-Branch/users/testsuite/tests/YaPIGroupAdd.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/branches/SuSE-Code-11-SP1-Branch/users/testsuite/tests/YaPIGroupAdd.ycp?rev=61558&r1=61557&r2=61558&view=diff
==============================================================================
--- branches/SuSE-Code-11-SP1-Branch/users/testsuite/tests/YaPIGroupAdd.ycp
(original)
+++ branches/SuSE-Code-11-SP1-Branch/users/testsuite/tests/YaPIGroupAdd.ycp Thu
Apr 1 13:18:10 2010
@@ -84,7 +84,7 @@
Testsuite::Dump ("============ add new group 'gg' - done
====================");


- data_map ["userlist"] = [ "hh1", "hh2" ];
+ data_map ["userlist"] = [ "hh" ];
data_map ["cn"] = "gg2";
E ["target", "bash_output", "stdout"] = "gg2";

@@ -93,8 +93,8 @@
Testsuite::Dump ("============ add new group 'gg2' - done
====================");

data_map ["userlist"] = $[
- "hh1" : 1,
- "hh2" : 1
+ "hh" : 1,
+ "ii" : 1
];
data_map ["cn"] = "gg3";
E ["target", "bash_output", "stdout"] = "gg3";
@@ -103,6 +103,16 @@
Testsuite::Test (``(YaPI::USERS::GroupAdd (config_map, data_map)),
[R,W,E], 0);
Testsuite::Dump ("============ add new group 'gg3' - done
====================");

+ data_map ["userlist"] = $[
+ "hh2" : 1,
+ ];
+ data_map ["cn"] = "gg4";
+ E ["target", "bash_output", "stdout"] = "gg4";
+
+ Testsuite::Dump ("============ add new group 'gg4' with non existent user
==");
+ Testsuite::Test (``(YaPI::USERS::GroupAdd (config_map, data_map)),
[R,W,E], 0);
+ Testsuite::Dump ("============ add new group 'gg4' - done
====================");
+
Testsuite::Dump ("============ add new group 'root' (groupname conflict):
======");

data_map = $[

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages