Mailinglist Archive: yast-commit (590 mails)

< Previous Next >
[yast-commit] r61560 - in /trunk/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:45 -0000
  • Message-id: <E1NxIQ9-0002qm-70@xxxxxxxxxxxxxxxx>
Author: jsuchome
Date: Thu Apr 1 13:18:44 2010
New Revision: 61560

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


Modified:
trunk/users/VERSION
trunk/users/package/yast2-users.changes
trunk/users/src/Users.pm
trunk/users/testsuite/tests/YaPIGroupAdd.out
trunk/users/testsuite/tests/YaPIGroupAdd.ycp

Modified: trunk/users/VERSION
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/users/VERSION?rev=61560&r1=61559&r2=61560&view=diff
==============================================================================
--- trunk/users/VERSION (original)
+++ trunk/users/VERSION Thu Apr 1 13:18:44 2010
@@ -1 +1 @@
-2.19.9
+2.19.10

Modified: trunk/users/package/yast2-users.changes
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/users/package/yast2-users.changes?rev=61560&r1=61559&r2=61560&view=diff
==============================================================================
--- trunk/users/package/yast2-users.changes (original)
+++ trunk/users/package/yast2-users.changes Thu Apr 1 13:18:44 2010
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Thu Apr 1 12:58:05 CEST 2010 - jsuchome@xxxxxxx
+
+- check user existence before adding to the group (bnc#592223)
+- 2.19.10
+
+-------------------------------------------------------------------
Tue Mar 30 16:10:13 CEST 2010 - jsuchome@xxxxxxx

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

Modified: trunk/users/src/Users.pm
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/users/src/Users.pm?rev=61560&r1=61559&r2=61560&view=diff
==============================================================================
--- trunk/users/src/Users.pm (original)
+++ trunk/users/src/Users.pm Thu Apr 1 13:18:44 2010
@@ -5505,6 +5505,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: trunk/users/testsuite/tests/YaPIGroupAdd.out
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/users/testsuite/tests/YaPIGroupAdd.out?rev=61560&r1=61559&r2=61560&view=diff
==============================================================================
--- trunk/users/testsuite/tests/YaPIGroupAdd.out (original)
+++ trunk/users/testsuite/tests/YaPIGroupAdd.out Thu Apr 1 13:18:44 2010
@@ -35,7 +35,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_output "diff -U 1 /etc/group.YaST2save /etc/group"
$["stdout":"gg2"]
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
@@ -55,12 +55,27 @@
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_output "diff -U 1 /etc/group.YaST2save /etc/group"
$["stdout":"gg3"]
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: trunk/users/testsuite/tests/YaPIGroupAdd.ycp
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/users/testsuite/tests/YaPIGroupAdd.ycp?rev=61560&r1=61559&r2=61560&view=diff
==============================================================================
--- trunk/users/testsuite/tests/YaPIGroupAdd.ycp (original)
+++ trunk/users/testsuite/tests/YaPIGroupAdd.ycp Thu Apr 1 13:18:44 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