summaryrefslogtreecommitdiffstats
path: root/debian/patches/542_useradd-O_option
blob: 3745826e76cb486246c9ecbde3d377145f07e73c (plain)
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
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

--- a/man/useradd.8.xml
+++ b/man/useradd.8.xml
@@ -326,6 +326,11 @@
 	    =<replaceable>100</replaceable>&nbsp;<option>-K</option>&nbsp;
 	    <replaceable>UID_MAX</replaceable>=<replaceable>499</replaceable>
 	  </para>
+          <para>
+            For the compatibility with previous Debian's
+            <command>useradd</command>, the <option>-O</option> option is
+            also supported.
+          </para>
 	  <!--para>
 	    Note: <option>-K</option>&nbsp;<replaceable>UID_MIN</replaceable>=<replaceable>10</replaceable>,<replaceable>UID_MAX</replaceable>=<replaceable>499</replaceable>
 	    doesn't work yet.
--- a/src/useradd.c
+++ b/src/useradd.c
@@ -1227,7 +1227,7 @@
 			{NULL, 0, NULL, '\0'}
 		};
 		while ((c = getopt_long (argc, argv,
-					 "b:c:d:De:f:g:G:hk:K:lmMNop:rR:P:s:u:U"
+					 "b:c:d:De:f:g:G:hk:O:K:lmMNop:rR:P:s:u:U"
 #ifdef WITH_SELINUX
 		                         "Z:"
 #endif				/* WITH_SELINUX */
@@ -1367,6 +1367,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