Package: shadow / 1:4.2-3+deb8u4

542_useradd-O_option Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Goal: accepts the -O flag for backward compatibility. (was used by adduser?)

Note: useradd.8 needs to be regenerated.

Status wrt upstream: not included as this is just specific 
                     backward compatibility for Debian

Index: git/man/useradd.8.xml
===================================================================
--- git.orig/man/useradd.8.xml
+++ git/man/useradd.8.xml
@@ -329,6 +329,11 @@
 	    databases are resetted to avoid reusing the entry from a previously
 	    deleted user.
 	  </para>
+          <para>
+            For the compatibility with previous Debian's
+            <command>useradd</command>, the <option>-O</option> option is
+            also supported.
+          </para>
 	</listitem>
       </varlistentry>
       <varlistentry>
Index: git/src/useradd.c
===================================================================
--- git.orig/src/useradd.c
+++ git/src/useradd.c
@@ -1056,9 +1056,9 @@
 		};
 		while ((c = getopt_long (argc, argv,
 #ifdef WITH_SELINUX
-		                         "b:c:d:De:f:g:G:hk:K:lmMNop:rR:s:u:UZ:",
+		                         "b:c:d:De:f:g:G:hk:O:K:lmMNop:rR:s:u:UZ:",
 #else				/* !WITH_SELINUX */
-		                         "b:c:d:De:f:g:G:hk:K:lmMNop:rR:s:u:U",
+		                         "b:c:d:De:f:g:G:hk:O:K:lmMNop:rR:s:u:U",
 #endif				/* !WITH_SELINUX */
 		                         long_options, NULL)) != -1) {
 			switch (c) {
@@ -1181,6 +1181,7 @@
 				kflg = true;
 				break;
 			case 'K':
+			case 'O': /* compatibility with previous Debian useradd */
 				/*
 				 * override login.defs defaults (-K name=value)
 				 * example: -K UID_MIN=100 -K UID_MAX=499