Merge lp:~sergiusens/ubuntu/wily/adduser/extrausers into lp:ubuntu/wily/adduser

Proposed by Sergio Schvezov
Status: Approved
Approved by: Michael Vogt
Approved revision: 33
Proposed branch: lp:~sergiusens/ubuntu/wily/adduser/extrausers
Merge into: lp:ubuntu/wily/adduser
Diff against target: 214 lines (+75/-18)
5 files modified
AdduserCommon.pm (+1/-0)
adduser (+64/-17)
adduser.conf (+3/-0)
debian/changelog (+6/-0)
debian/control (+1/-1)
To merge this branch: bzr merge lp:~sergiusens/ubuntu/wily/adduser/extrausers
Reviewer Review Type Date Requested Status
Ubuntu branches Pending
Review via email: mp+263169@code.launchpad.net

Description of the change

This change depends on http://paste.ubuntu.com/11780424/

To post a comment you must log in.
33. By Sergio Schvezov

more chfn

Revision history for this message
Michael Vogt (mvo) wrote :

adduser (3.113+nmu3ubuntu4) wily; urgency=medium

  * extrausers support for adduser (LP: #1323732)

 -- Sergio Schvezov <email address hidden> Fri, 26 Jun 2015 17:34:29 -0300

Unmerged revisions

33. By Sergio Schvezov

more chfn

32. By Sergio Schvezov

extrausers support for adduser (LP: #1323732)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'AdduserCommon.pm'
--- AdduserCommon.pm 2010-01-27 09:47:08 +0000
+++ AdduserCommon.pm 2015-06-26 21:27:23 +0000
@@ -213,6 +213,7 @@
213 $configref->{"skel_ignore_regex"} = "dpkg-(old|new|dist)\$";213 $configref->{"skel_ignore_regex"} = "dpkg-(old|new|dist)\$";
214 $configref->{"extra_groups"} = "dialout cdrom floppy audio video plugdev users";214 $configref->{"extra_groups"} = "dialout cdrom floppy audio video plugdev users";
215 $configref->{"add_extra_groups"} = 0;215 $configref->{"add_extra_groups"} = 0;
216 $configref->{"use_extrausers"} = 0;
216217
217 foreach( @$conflistref ) {218 foreach( @$conflistref ) {
218 read_config($_,$configref);219 read_config($_,$configref);
219220
=== modified file 'adduser'
--- adduser 2011-10-19 21:52:30 +0000
+++ adduser 2015-06-26 21:27:23 +0000
@@ -103,6 +103,7 @@
103our $special_home = undef;103our $special_home = undef;
104our $special_shell = undef;104our $special_shell = undef;
105our $add_extra_groups = 0;105our $add_extra_groups = 0;
106our $use_extrausers = 0;
106our $encrypt_home = undef;107our $encrypt_home = undef;
107108
108# Global variables we need later109# Global variables we need later
@@ -143,6 +144,7 @@
143 "no-create-home" => \$no_create_home,144 "no-create-home" => \$no_create_home,
144 "encrypt-home" => \$encrypt_home,145 "encrypt-home" => \$encrypt_home,
145 "add_extra_groups" => \$add_extra_groups,146 "add_extra_groups" => \$add_extra_groups,
147 "extrausers" => \$use_extrausers,
146 "debug" => sub { $verbose = 2 } ) ) {148 "debug" => sub { $verbose = 2 } ) ) {
147 &usage();149 &usage();
148 exit RET_INVALID_CALL;150 exit RET_INVALID_CALL;
@@ -307,7 +309,11 @@
307 printf (gtx("Adding group `%s' (GID %d) ...\n"),$new_name,$new_gid) if $verbose;309 printf (gtx("Adding group `%s' (GID %d) ...\n"),$new_name,$new_gid) if $verbose;
308 &invalidate_nscd("group");310 &invalidate_nscd("group");
309 my $groupadd = &which('groupadd');311 my $groupadd = &which('groupadd');
310 &systemcall($groupadd, '-g', $new_gid, $new_name);312 if ( ($use_extrausers) || ($config{"use_extrausers"}) ) {
313 &systemcall($groupadd, '--extrausers', '-g', $new_gid, $new_name);
314 } else {
315 &systemcall($groupadd, '-g', $new_gid, $new_name);
316 }
311 &invalidate_nscd("group");317 &invalidate_nscd("group");
312 print (gtx("Done.\n")) if $verbose;318 print (gtx("Done.\n")) if $verbose;
313 exit RET_OK;319 exit RET_OK;
@@ -336,7 +342,11 @@
336 printf (gtx("Adding group `%s' (GID %d) ...\n"),$new_name,$new_gid) if $verbose;342 printf (gtx("Adding group `%s' (GID %d) ...\n"),$new_name,$new_gid) if $verbose;
337 &invalidate_nscd("group");343 &invalidate_nscd("group");
338 my $groupadd = &which('groupadd');344 my $groupadd = &which('groupadd');
339 &systemcall($groupadd, '-g', $new_gid, $new_name);345 if ( ($use_extrausers) || ($config{"use_extrausers"}) ) {
346 &systemcall($groupadd, '--extrausers', '-g', $new_gid, $new_name);
347 } else {
348 &systemcall($groupadd, '-g', $new_gid, $new_name);
349 }
340 &invalidate_nscd("group");350 &invalidate_nscd("group");
341 print (gtx("Done.\n")) if $verbose;351 print (gtx("Done.\n")) if $verbose;
342 exit RET_OK;352 exit RET_OK;
@@ -431,7 +441,11 @@
431 printf (gtx("Adding new group `%s' (GID %d) ...\n"),$new_name,$new_gid) if $verbose;441 printf (gtx("Adding new group `%s' (GID %d) ...\n"),$new_name,$new_gid) if $verbose;
432 $undogroup = $new_name;442 $undogroup = $new_name;
433 my $groupadd = &which('groupadd');443 my $groupadd = &which('groupadd');
434 &systemcall($groupadd, '-g', $new_gid, $new_name);444 if ( ($use_extrausers) || ($config{"use_extrausers"}) ) {
445 &systemcall($groupadd, '--extrausers', '-g', $new_gid, $new_name);
446 } else {
447 &systemcall($groupadd, '-g', $new_gid, $new_name);
448 }
435 &invalidate_nscd("group");449 &invalidate_nscd("group");
436 }450 }
437451
@@ -441,8 +455,13 @@
441 $shell = $special_shell || '/bin/false';455 $shell = $special_shell || '/bin/false';
442 $undouser = $new_name;456 $undouser = $new_name;
443 my $useradd = &which('useradd');457 my $useradd = &which('useradd');
444 &systemcall($useradd, '-d', $home_dir, '-g', $ingroup_name, '-s',458 if ( ($use_extrausers) || ($config{"use_extrausers"}) ) {
445 $shell, '-u', $new_uid, $new_name);459 &systemcall($useradd, '--extrausers', '-d', $home_dir, '-g', $ingroup_name, '-s',
460 $shell, '-u', $new_uid, $new_name);
461 } else {
462 &systemcall($useradd, '-d', $home_dir, '-g', $ingroup_name, '-s',
463 $shell, '-u', $new_uid, $new_name);
464 }
446 if(!$disabled_login) {465 if(!$disabled_login) {
447 my $usermod = &which('usermod');466 my $usermod = &which('usermod');
448 &systemcall($usermod, '-p', '*', $new_name);467 &systemcall($usermod, '-p', '*', $new_name);
@@ -521,7 +540,11 @@
521 printf (gtx("Adding new group `%s' (%d) ...\n"),$new_name,$new_gid) if $verbose;540 printf (gtx("Adding new group `%s' (%d) ...\n"),$new_name,$new_gid) if $verbose;
522 $undogroup = $new_name;541 $undogroup = $new_name;
523 my $groupadd = &which('groupadd');542 my $groupadd = &which('groupadd');
524 &systemcall($groupadd, '-g', $new_gid, $new_name);543 if ( ($use_extrausers) || ($config{"use_extrausers"}) ) {
544 &systemcall($groupadd, '--extrausers', '-g', $new_gid, $new_name);
545 } else {
546 &systemcall($groupadd, '-g', $new_gid, $new_name);
547 }
525 &invalidate_nscd();548 &invalidate_nscd();
526 }549 }
527550
@@ -531,8 +554,13 @@
531 $shell = $special_shell || $config{"dshell"};554 $shell = $special_shell || $config{"dshell"};
532 $undouser = $new_name;555 $undouser = $new_name;
533 my $useradd = &which('useradd');556 my $useradd = &which('useradd');
534 &systemcall($useradd, '-d', $home_dir, '-g', $ingroup_name, '-s',557 if ( ($use_extrausers) || ($config{"use_extrausers"}) ) {
535 $shell, '-u', $new_uid, $new_name);558 &systemcall($useradd, '--extrausers', '-d', $home_dir, '-g', $ingroup_name, '-s',
559 $shell, '-u', $new_uid, $new_name);
560 } else {
561 &systemcall($useradd, '-d', $home_dir, '-g', $ingroup_name, '-s',
562 $shell, '-u', $new_uid, $new_name);
563 }
536 &invalidate_nscd();564 &invalidate_nscd();
537565
538 create_homedir (1); # copy skeleton data566 create_homedir (1); # copy skeleton data
@@ -581,7 +609,11 @@
581 my $noexpr = langinfo(NOEXPR());609 my $noexpr = langinfo(NOEXPR());
582 for (;;) {610 for (;;) {
583 my $chfn = &which('chfn');611 my $chfn = &which('chfn');
584 &systemcall($chfn, $new_name);612 if ( ($use_extrausers) || ($config{"use_extrausers"}) ) {
613 &systemcall($chfn, '--extrausers', $new_name);
614 } else {
615 &systemcall($chfn, $new_name);
616 }
585 # Translators: [y/N] has to be replaced by values defined in your617 # Translators: [y/N] has to be replaced by values defined in your
586 # locale. You can see by running "locale yesexpr" which regular618 # locale. You can see by running "locale yesexpr" which regular
587 # expression will be checked to find positive answer.619 # expression will be checked to find positive answer.
@@ -948,17 +980,31 @@
948 my($gecos_name,$gecos_room,$gecos_work,$gecos_home,$gecos_other)980 my($gecos_name,$gecos_room,$gecos_work,$gecos_home,$gecos_other)
949 = split(/,/,$gecos);981 = split(/,/,$gecos);
950982
951 &systemcall($chfn, '-f', $gecos_name, '-r', $gecos_room, $new_name);983 if ( ($use_extrausers) || ($config{"use_extrausers"}) ) {
952 &systemcall($chfn,'-w',$gecos_work,$new_name)984 &systemcall($chfn, '--extrausers', '-f', $gecos_name, '-r', $gecos_room, $new_name);
953 if(defined($gecos_work));985 &systemcall($chfn,'--extrausers','-w',$gecos_work,$new_name)
954 &systemcall($chfn,'-h',$gecos_home,$new_name)986 if(defined($gecos_work));
955 if(defined($gecos_home));987 &systemcall($chfn,'--extrausers','-h',$gecos_home,$new_name)
956 &systemcall($chfn,'-o',$gecos_other,$new_name)988 if(defined($gecos_home));
957 if(defined($gecos_other));989 &systemcall($chfn,'--extrausers','-o',$gecos_other,$new_name)
990 if(defined($gecos_other));
991 } else {
992 &systemcall($chfn, '-f', $gecos_name, '-r', $gecos_room, $new_name);
993 &systemcall($chfn,'-w',$gecos_work,$new_name)
994 if(defined($gecos_work));
995 &systemcall($chfn,'-h',$gecos_home,$new_name)
996 if(defined($gecos_home));
997 &systemcall($chfn,'-o',$gecos_other,$new_name)
998 if(defined($gecos_other));
999 }
958 }1000 }
959 else1001 else
960 {1002 {
961 &systemcall($chfn, '-f', $gecos, $new_name);1003 if ( ($use_extrausers) || ($config{"use_extrausers"}) ) {
1004 &systemcall($chfn, '--extrausers', '-f', $gecos, $new_name);
1005 } else {
1006 &systemcall($chfn, '-f', $gecos, $new_name);
1007 }
962 }1008 }
963}1009}
9641010
@@ -1046,6 +1092,7 @@
1046 --quiet | -q don't give process information to stdout1092 --quiet | -q don't give process information to stdout
1047 --force-badname allow usernames which do not match the1093 --force-badname allow usernames which do not match the
1048 NAME_REGEX[_SYSTEM] configuration variable1094 NAME_REGEX[_SYSTEM] configuration variable
1095 --extrausers uses extra users as the database
1049 --help | -h usage message1096 --help | -h usage message
1050 --version | -v version number and copyright1097 --version | -v version number and copyright
1051 --conf | -c FILE use FILE as configuration file\n\n");1098 --conf | -c FILE use FILE as configuration file\n\n");
10521099
=== modified file 'adduser.conf'
--- adduser.conf 2010-01-27 09:47:08 +0000
+++ adduser.conf 2015-06-26 21:27:23 +0000
@@ -83,3 +83,6 @@
8383
84# check user and group names also against this regular expression.84# check user and group names also against this regular expression.
85#NAME_REGEX="^[a-z][-a-z0-9_]*\$"85#NAME_REGEX="^[a-z][-a-z0-9_]*\$"
86
87# use extrausers by default
88#USE_EXTRAUSERS=1
8689
=== modified file 'debian/changelog'
--- debian/changelog 2013-10-30 14:51:16 +0000
+++ debian/changelog 2015-06-26 21:27:23 +0000
@@ -1,3 +1,9 @@
1adduser (3.113+nmu3ubuntu4) UNRELEASED; urgency=medium
2
3 * extrausers support for adduser (LP: #1323732)
4
5 -- Sergio Schvezov <sergio.schvezov@canonical.com> Fri, 26 Jun 2015 17:34:29 -0300
6
1adduser (3.113+nmu3ubuntu3) trusty; urgency=low7adduser (3.113+nmu3ubuntu3) trusty; urgency=low
28
3 * Add autopkgtest. (LP: #1246331)9 * Add autopkgtest. (LP: #1246331)
410
=== modified file 'debian/control'
--- debian/control 2013-10-30 14:51:16 +0000
+++ debian/control 2015-06-26 21:27:23 +0000
@@ -15,7 +15,7 @@
15Package: adduser15Package: adduser
16Architecture: all16Architecture: all
17Multi-Arch: foreign17Multi-Arch: foreign
18Depends: perl-base (>=5.6.0), passwd (>= 1:4.0.12), debconf | debconf-2.018Depends: perl-base (>=5.6.0), passwd (>= 1:4.1.5.1-1.1ubuntu6), debconf | debconf-2.0
19Suggests: liblocale-gettext-perl, perl-modules, ecryptfs-utils (>= 67-1)19Suggests: liblocale-gettext-perl, perl-modules, ecryptfs-utils (>= 67-1)
20Replaces: manpages-pl (<= 20051117-1), manpages-it (<< 0.3.4-2)20Replaces: manpages-pl (<= 20051117-1), manpages-it (<< 0.3.4-2)
21Description: add and remove users and groups21Description: add and remove users and groups

Subscribers

People subscribed via source and target branches