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

Proposed by Sergio Schvezov on 2015-06-26
Status: Approved
Approved by: Michael Vogt on 2015-07-07
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 2015-06-26 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 on 2015-06-26

more chfn

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 on 2015-06-26

more chfn

32. By Sergio Schvezov on 2015-06-26

extrausers support for adduser (LP: #1323732)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'AdduserCommon.pm'
2--- AdduserCommon.pm 2010-01-27 09:47:08 +0000
3+++ AdduserCommon.pm 2015-06-26 21:27:23 +0000
4@@ -213,6 +213,7 @@
5 $configref->{"skel_ignore_regex"} = "dpkg-(old|new|dist)\$";
6 $configref->{"extra_groups"} = "dialout cdrom floppy audio video plugdev users";
7 $configref->{"add_extra_groups"} = 0;
8+ $configref->{"use_extrausers"} = 0;
9
10 foreach( @$conflistref ) {
11 read_config($_,$configref);
12
13=== modified file 'adduser'
14--- adduser 2011-10-19 21:52:30 +0000
15+++ adduser 2015-06-26 21:27:23 +0000
16@@ -103,6 +103,7 @@
17 our $special_home = undef;
18 our $special_shell = undef;
19 our $add_extra_groups = 0;
20+our $use_extrausers = 0;
21 our $encrypt_home = undef;
22
23 # Global variables we need later
24@@ -143,6 +144,7 @@
25 "no-create-home" => \$no_create_home,
26 "encrypt-home" => \$encrypt_home,
27 "add_extra_groups" => \$add_extra_groups,
28+ "extrausers" => \$use_extrausers,
29 "debug" => sub { $verbose = 2 } ) ) {
30 &usage();
31 exit RET_INVALID_CALL;
32@@ -307,7 +309,11 @@
33 printf (gtx("Adding group `%s' (GID %d) ...\n"),$new_name,$new_gid) if $verbose;
34 &invalidate_nscd("group");
35 my $groupadd = &which('groupadd');
36- &systemcall($groupadd, '-g', $new_gid, $new_name);
37+ if ( ($use_extrausers) || ($config{"use_extrausers"}) ) {
38+ &systemcall($groupadd, '--extrausers', '-g', $new_gid, $new_name);
39+ } else {
40+ &systemcall($groupadd, '-g', $new_gid, $new_name);
41+ }
42 &invalidate_nscd("group");
43 print (gtx("Done.\n")) if $verbose;
44 exit RET_OK;
45@@ -336,7 +342,11 @@
46 printf (gtx("Adding group `%s' (GID %d) ...\n"),$new_name,$new_gid) if $verbose;
47 &invalidate_nscd("group");
48 my $groupadd = &which('groupadd');
49- &systemcall($groupadd, '-g', $new_gid, $new_name);
50+ if ( ($use_extrausers) || ($config{"use_extrausers"}) ) {
51+ &systemcall($groupadd, '--extrausers', '-g', $new_gid, $new_name);
52+ } else {
53+ &systemcall($groupadd, '-g', $new_gid, $new_name);
54+ }
55 &invalidate_nscd("group");
56 print (gtx("Done.\n")) if $verbose;
57 exit RET_OK;
58@@ -431,7 +441,11 @@
59 printf (gtx("Adding new group `%s' (GID %d) ...\n"),$new_name,$new_gid) if $verbose;
60 $undogroup = $new_name;
61 my $groupadd = &which('groupadd');
62- &systemcall($groupadd, '-g', $new_gid, $new_name);
63+ if ( ($use_extrausers) || ($config{"use_extrausers"}) ) {
64+ &systemcall($groupadd, '--extrausers', '-g', $new_gid, $new_name);
65+ } else {
66+ &systemcall($groupadd, '-g', $new_gid, $new_name);
67+ }
68 &invalidate_nscd("group");
69 }
70
71@@ -441,8 +455,13 @@
72 $shell = $special_shell || '/bin/false';
73 $undouser = $new_name;
74 my $useradd = &which('useradd');
75- &systemcall($useradd, '-d', $home_dir, '-g', $ingroup_name, '-s',
76- $shell, '-u', $new_uid, $new_name);
77+ if ( ($use_extrausers) || ($config{"use_extrausers"}) ) {
78+ &systemcall($useradd, '--extrausers', '-d', $home_dir, '-g', $ingroup_name, '-s',
79+ $shell, '-u', $new_uid, $new_name);
80+ } else {
81+ &systemcall($useradd, '-d', $home_dir, '-g', $ingroup_name, '-s',
82+ $shell, '-u', $new_uid, $new_name);
83+ }
84 if(!$disabled_login) {
85 my $usermod = &which('usermod');
86 &systemcall($usermod, '-p', '*', $new_name);
87@@ -521,7 +540,11 @@
88 printf (gtx("Adding new group `%s' (%d) ...\n"),$new_name,$new_gid) if $verbose;
89 $undogroup = $new_name;
90 my $groupadd = &which('groupadd');
91- &systemcall($groupadd, '-g', $new_gid, $new_name);
92+ if ( ($use_extrausers) || ($config{"use_extrausers"}) ) {
93+ &systemcall($groupadd, '--extrausers', '-g', $new_gid, $new_name);
94+ } else {
95+ &systemcall($groupadd, '-g', $new_gid, $new_name);
96+ }
97 &invalidate_nscd();
98 }
99
100@@ -531,8 +554,13 @@
101 $shell = $special_shell || $config{"dshell"};
102 $undouser = $new_name;
103 my $useradd = &which('useradd');
104- &systemcall($useradd, '-d', $home_dir, '-g', $ingroup_name, '-s',
105- $shell, '-u', $new_uid, $new_name);
106+ if ( ($use_extrausers) || ($config{"use_extrausers"}) ) {
107+ &systemcall($useradd, '--extrausers', '-d', $home_dir, '-g', $ingroup_name, '-s',
108+ $shell, '-u', $new_uid, $new_name);
109+ } else {
110+ &systemcall($useradd, '-d', $home_dir, '-g', $ingroup_name, '-s',
111+ $shell, '-u', $new_uid, $new_name);
112+ }
113 &invalidate_nscd();
114
115 create_homedir (1); # copy skeleton data
116@@ -581,7 +609,11 @@
117 my $noexpr = langinfo(NOEXPR());
118 for (;;) {
119 my $chfn = &which('chfn');
120- &systemcall($chfn, $new_name);
121+ if ( ($use_extrausers) || ($config{"use_extrausers"}) ) {
122+ &systemcall($chfn, '--extrausers', $new_name);
123+ } else {
124+ &systemcall($chfn, $new_name);
125+ }
126 # Translators: [y/N] has to be replaced by values defined in your
127 # locale. You can see by running "locale yesexpr" which regular
128 # expression will be checked to find positive answer.
129@@ -948,17 +980,31 @@
130 my($gecos_name,$gecos_room,$gecos_work,$gecos_home,$gecos_other)
131 = split(/,/,$gecos);
132
133- &systemcall($chfn, '-f', $gecos_name, '-r', $gecos_room, $new_name);
134- &systemcall($chfn,'-w',$gecos_work,$new_name)
135- if(defined($gecos_work));
136- &systemcall($chfn,'-h',$gecos_home,$new_name)
137- if(defined($gecos_home));
138- &systemcall($chfn,'-o',$gecos_other,$new_name)
139- if(defined($gecos_other));
140+ if ( ($use_extrausers) || ($config{"use_extrausers"}) ) {
141+ &systemcall($chfn, '--extrausers', '-f', $gecos_name, '-r', $gecos_room, $new_name);
142+ &systemcall($chfn,'--extrausers','-w',$gecos_work,$new_name)
143+ if(defined($gecos_work));
144+ &systemcall($chfn,'--extrausers','-h',$gecos_home,$new_name)
145+ if(defined($gecos_home));
146+ &systemcall($chfn,'--extrausers','-o',$gecos_other,$new_name)
147+ if(defined($gecos_other));
148+ } else {
149+ &systemcall($chfn, '-f', $gecos_name, '-r', $gecos_room, $new_name);
150+ &systemcall($chfn,'-w',$gecos_work,$new_name)
151+ if(defined($gecos_work));
152+ &systemcall($chfn,'-h',$gecos_home,$new_name)
153+ if(defined($gecos_home));
154+ &systemcall($chfn,'-o',$gecos_other,$new_name)
155+ if(defined($gecos_other));
156+ }
157 }
158 else
159 {
160- &systemcall($chfn, '-f', $gecos, $new_name);
161+ if ( ($use_extrausers) || ($config{"use_extrausers"}) ) {
162+ &systemcall($chfn, '--extrausers', '-f', $gecos, $new_name);
163+ } else {
164+ &systemcall($chfn, '-f', $gecos, $new_name);
165+ }
166 }
167 }
168
169@@ -1046,6 +1092,7 @@
170 --quiet | -q don't give process information to stdout
171 --force-badname allow usernames which do not match the
172 NAME_REGEX[_SYSTEM] configuration variable
173+ --extrausers uses extra users as the database
174 --help | -h usage message
175 --version | -v version number and copyright
176 --conf | -c FILE use FILE as configuration file\n\n");
177
178=== modified file 'adduser.conf'
179--- adduser.conf 2010-01-27 09:47:08 +0000
180+++ adduser.conf 2015-06-26 21:27:23 +0000
181@@ -83,3 +83,6 @@
182
183 # check user and group names also against this regular expression.
184 #NAME_REGEX="^[a-z][-a-z0-9_]*\$"
185+
186+# use extrausers by default
187+#USE_EXTRAUSERS=1
188
189=== modified file 'debian/changelog'
190--- debian/changelog 2013-10-30 14:51:16 +0000
191+++ debian/changelog 2015-06-26 21:27:23 +0000
192@@ -1,3 +1,9 @@
193+adduser (3.113+nmu3ubuntu4) UNRELEASED; urgency=medium
194+
195+ * extrausers support for adduser (LP: #1323732)
196+
197+ -- Sergio Schvezov <sergio.schvezov@canonical.com> Fri, 26 Jun 2015 17:34:29 -0300
198+
199 adduser (3.113+nmu3ubuntu3) trusty; urgency=low
200
201 * Add autopkgtest. (LP: #1246331)
202
203=== modified file 'debian/control'
204--- debian/control 2013-10-30 14:51:16 +0000
205+++ debian/control 2015-06-26 21:27:23 +0000
206@@ -15,7 +15,7 @@
207 Package: adduser
208 Architecture: all
209 Multi-Arch: foreign
210-Depends: perl-base (>=5.6.0), passwd (>= 1:4.0.12), debconf | debconf-2.0
211+Depends: perl-base (>=5.6.0), passwd (>= 1:4.1.5.1-1.1ubuntu6), debconf | debconf-2.0
212 Suggests: liblocale-gettext-perl, perl-modules, ecryptfs-utils (>= 67-1)
213 Replaces: manpages-pl (<= 20051117-1), manpages-it (<< 0.3.4-2)
214 Description: add and remove users and groups

Subscribers

People subscribed via source and target branches