source:
patches/shadow-4.0.18.1-fixes-1.patch@
96b8484
Last change on this file since 96b8484 was 406ed09, checked in by , 17 years ago | |
---|---|
|
|
File size: 28.6 KB |
-
contrib/adduser.c
Submitted By: Jim Gifford (patches at jg555 dot com) Date: 2007-09-04 Initial Package Version: 4.0.18.1 Origin: Mailing List Upstream Status: Submitted Description: Fixes Various Issues From Upstream Adds compability for Samba Machine Names Corrects Grammer in Man Files Corrects Useradd issue Fixes useradd -G and -g Fix chpasswd and chgpasswd stack overflow diff -Naur shadow-4.0.18.1.orig/contrib/adduser.c shadow-4.0.18.1/contrib/adduser.c
old new 169 169 if (geteuid () != 0) 170 170 { 171 171 printf ("It seems you don't have access to add a new user. Try\n"); 172 printf ("logging in as root or su root to gain super -user access.\n");172 printf ("logging in as root or su root to gain superuser access.\n"); 173 173 exit (1); 174 174 } 175 175 -
contrib/groupmems.shar
diff -Naur shadow-4.0.18.1.orig/contrib/groupmems.shar shadow-4.0.18.1/contrib/groupmems.shar
old new 211 211 #define EXIT_SUCCESS 0 /* success */ 212 212 #define EXIT_USAGE 1 /* invalid command syntax */ 213 213 #define EXIT_GROUP_FILE 2 /* group file access problems */ 214 #define EXIT_NOT_ROOT 3 /* not super 215 #define EXIT_NOT_EROOT 4 /* not effective super 214 #define EXIT_NOT_ROOT 3 /* not superuser */ 215 #define EXIT_NOT_EROOT 4 /* not effective superuser */ 216 216 #define EXIT_NOT_PRIMARY 5 /* not primary owner of group */ 217 217 #define EXIT_NOT_MEMBER 6 /* member of group does not exist */ 218 218 #define EXIT_MEMBER_EXISTS 7 /* member of group already exists */ … … 481 481 [\fB-g\fI group_name \fR] 482 482 X.SH DESCRIPTION 483 483 The \fBgroupmems\fR utility allows a user to administer his/her own 484 group membership list without the requirement of super 484 group membership list without the requirement of superuser privileges. 485 485 The \fBgroupmems\fR utility is for systems that configure its users to 486 486 be in their own name sake primary group (i.e., guest / guest). 487 487 X.P 488 Only the super 488 Only the superuser, as administrator, can use \fBgroupmems\fR to alter 489 489 the memberships of other groups. 490 490 X.IP "\fB-a \fIuser_name\fR" 491 491 Add a new user to the group membership list. … … 496 496 X.IP "\fB-D\fR" 497 497 Delete all users from the group membership list. 498 498 X.IP "\fB-g \fIgroup_name\fR" 499 The super 499 The superuser can specify which group membership list to modify. 500 500 X.SH SETUP 501 501 The \fBgroupmems\fR executable should be in mode \fB2770\fR as user \fBroot\fR 502 502 and in group \fBgroups\fR. The system administrator can add users to -
libmisc/chkname.c
diff -Naur shadow-4.0.18.1.orig/libmisc/chkname.c shadow-4.0.18.1/libmisc/chkname.c
old new 18 18 static int good_name (const char *name) 19 19 { 20 20 /* 21 * User/group names must match [a-z_][a-z0-9_-]*[$] 22 */ 23 if (!*name || !((*name >= 'a' && *name <= 'z') || *name == '_')) 21 * User/group names must match gnu e-regex: 22 * [a-zA-Z0-9_.][a-zA-Z0-9_.-]{0,30}[a-zA-Z0-9_.$-]? 23 * 24 * as a non-POSIX, extension, allow "$" as the last char for 25 * sake of Samba 3.x "add machine script" 26 */ 27 if (!*name || !((*name >= 'a' && *name <= 'z') 28 || (*name >= 'A' && *name <= 'Z') 29 || (*name >= '0' && *name <= '9') 30 || *name == '_' || *name == '.')) 24 31 return 0; 25 32 26 33 while (*++name) { 27 if (!((*name >= 'a' && *name <= 'z') || 28 (*name >= '0' && *name <= '9') || 29 *name == '_' || *name == '-' || 30 (*name == '$' && *(name + 1) == '\0'))) 34 if (!( (*name >= 'a' && *name <= 'z') 35 || (*name >= 'A' && *name <= 'Z') 36 || (*name >= '0' && *name <= '9') 37 || *name == '_' || *name == '.' || *name == '-' 38 || (*name == '$' && *(name + 1) == '\0'))) 31 39 return 0; 32 40 } 33 41 … … 43 51 #endif 44 52 45 53 /* 46 * User names are limited by whatever utmp can 47 * handle (usually max 8 characters). 54 * User names are limited by whatever utmp can handle. 48 55 */ 49 if (strlen (name) > sizeof(ut.ut_user))56 if (strlen(name) + 1 > sizeof(ut.ut_user)) 50 57 return 0; 51 58 52 59 return good_name (name); … … 54 61 55 62 int check_group_name (const char *name) 56 63 { 57 /* 58 * Arbitrary limit for group names - max 16 59 * characters (same as on HP-UX 10). 60 */ 61 if (strlen (name) > 16) 64 #if HAVE_UTMPX_H 65 struct utmpx ut; 66 #else 67 struct utmp ut; 68 #endif 69 70 if (strlen(name) + 1 > sizeof(ut.ut_user)) 62 71 return 0; 63 72 64 73 return good_name (name); -
man/chfn.1.xml
diff -Naur shadow-4.0.18.1.orig/man/chfn.1.xml shadow-4.0.18.1/man/chfn.1.xml
old new 32 32 </citerefentry> and similar programs. A normal user may only change 33 33 the fields for her own account, subject to the restrictions in 34 34 <filename>/etc/login.defs</filename>. (The default configuration is to 35 prevent users from changing their fullname.) The super 36 any field for any account. Additionally, only the super 35 prevent users from changing their fullname.) The superuser may change 36 any field for any account. Additionally, only the superuser may use 37 37 the <option>-o</option> option to change the undefined portions of the 38 38 GECOS field. 39 39 </para> -
man/chsh.1.xml
diff -Naur shadow-4.0.18.1.orig/man/chsh.1.xml shadow-4.0.18.1/man/chsh.1.xml
old new 28 28 <para> 29 29 <command>chsh</command> changes the user login shell. This determines 30 30 the name of the user's initial login command. A normal user may only 31 change the login shell for her own account, the super 31 change the login shell for her own account, the superuser may change 32 32 the login shell for any account. 33 33 </para> 34 34 … … 72 72 <para> 73 73 The only restriction placed on the login shell is that the command 74 74 name must be listed in <filename>/etc/shells</filename>, unless the 75 invoker is the super -user, and then any value may be added. An75 invoker is the superuser, and then any value may be added. An 76 76 account with a restricted login shell may not change her login shell. 77 77 For this reason, placing <filename>/bin/rsh</filename> in 78 78 <filename>/etc/shells</filename> is discouraged since accidentally -
man/groupadd.8
diff -Naur shadow-4.0.18.1.orig/man/groupadd.8 shadow-4.0.18.1/man/groupadd.8
old new 70 70 Shadow password suite configuration. 71 71 .SH "CAVEATS" 72 72 .PP 73 Groupnames must begin with a lower case letter or an underscore, and only lower case letters, underscores, dashes, and dollar signs may follow. In regular expression terms: [a\-z_][a\-z0\-9_\-]*[$] 74 .PP 75 Groupnames may only be up to 16 characters long. 73 Groupnames may only be up to 32 characters long. 76 74 .PP 77 75 If the groupname already exists in an external group database such as NIS, 78 76 \fBgroupadd\fR 79 77 will deny the group creation request. 80 .PP81 Groupnames may only be up to 16 characters long.82 78 .SH "EXIT VALUES" 83 79 .PP 84 80 The -
man/groupadd.8.xml
diff -Naur shadow-4.0.18.1.orig/man/groupadd.8.xml shadow-4.0.18.1/man/groupadd.8.xml
old new 29 29 <refsect1 id='description'> 30 30 <title>DESCRIPTION</title> 31 31 <para>The <command>groupadd</command> command creates a new group 32 account using the values specified on the command line andthe default32 account using the values specified on the command line plus the default 33 33 values from the system. The new group will be entered into the system 34 34 files as needed. 35 35 </para> … … 47 47 <option>-f</option> 48 48 </term> 49 49 <listitem> 50 <para>This option causes to just exit with success status if the 51 specified group already exists. With <option>-g</option>, if 52 specified GID already exists, other (unique) GID is chosen (i.e. 50 <para>This option causes the command to simply exit with success 51 status if the 52 specified group already exists. When used with 53 <option>-g</option>, and the 54 specified GID already exists, another (unique) GID is chosen (i.e. 53 55 <option>-g</option> is turned off). 54 56 </para> 55 57 </listitem> … … 101 103 </term> 102 104 <listitem> 103 105 <para> 104 This option permits to add group withnon-unique GID.106 This option permits to add a group with a non-unique GID. 105 107 </para> 106 108 </listitem> 107 109 </varlistentry> … … 138 140 only lower case letters, underscores, dashes, and dollar signs may 139 141 follow. In regular expression terms: [a-z_][a-z0-9_-]*[$] 140 142 </para> 141 <para>Groupnames may only be up to 16 characters long.</para>142 143 143 <para> 144 144 If the groupname already exists in an external group database 145 145 such as NIS, <command>groupadd</command> will deny the group 146 146 creation request. 147 147 </para> 148 149 148 <para>Groupnames may only be up to 16 characters long.</para> 150 151 149 </refsect1> 152 150 153 151 <refsect1 id='exit_values'> -
man/groupmems.8.xml
diff -Naur shadow-4.0.18.1.orig/man/groupmems.8.xml shadow-4.0.18.1/man/groupmems.8.xml
old new 27 27 <title>DESCRIPTION</title> 28 28 <para> 29 29 The <command>groupmems</command> utility allows a user to administer 30 his/her own group membership list without the requirement of super31 user privileges. The <command>groupmems</command> utility is for30 his/her own group membership list without the requirement of 31 superuser privileges. The <command>groupmems</command> utility is for 32 32 systems that configure its users to be in their own name sake primary 33 33 group (i.e., guest / guest). 34 34 </para> 35 35 36 <para>Only the super 36 <para>Only the superuser, as administrator, can use 37 37 <command>groupmems</command> to alter the memberships of other groups. 38 38 </para> 39 39 </refsect1> … … 66 66 <varlistentry> 67 67 <term><option>-g</option> <replaceable>group_name</replaceable></term> 68 68 <listitem> 69 <para>The super 69 <para>The superuser can specify which group membership 70 70 list to modify. 71 71 </para> 72 72 </listitem> -
man/groupmod.8.xml
diff -Naur shadow-4.0.18.1.orig/man/groupmod.8.xml shadow-4.0.18.1/man/groupmod.8.xml
old new 43 43 </term> 44 44 <listitem> 45 45 <para> 46 Specify the new group ID for the <replaceable>GROUP</replaceable>. 47 The numerical value of the <replaceable>GID</replaceable> must be 46 The group ID of the given <replaceable>GROUP</replaceable> will be 47 changed to <replaceable>GID</replaceable>. 48 The value of <replaceable>GID</replaceable> must be 48 49 a non-negative decimal integer. This value must be unique, unless 49 50 the <option>-o</option> option is used. Values between 0 and 999 50 are typically reserved for system groups. Any files which the old 51 group ID is the file group ID must have the file group ID changed 51 are typically reserved for system groups. Any files that have 52 the old group ID and must continue to belong to 53 <replaceable>GROUP</replaceable>, must have their group ID changed 52 54 manually. 53 55 </para> 54 56 </listitem> … … 77 79 </term> 78 80 <listitem> 79 81 <para> 80 When used with the <option>-g</option> option allow to change the81 group <replaceable>GID</replaceable> to non-unique value.82 When used with the <option>-g</option> option, allow to change the 83 group <replaceable>GID</replaceable> to a non-unique value. 82 84 </para> 83 85 </listitem> 84 86 </varlistentry> -
man/login.1.xml
diff -Naur shadow-4.0.18.1.orig/man/login.1.xml shadow-4.0.18.1/man/login.1.xml
old new 184 184 </para> 185 185 186 186 <para> 187 As any program, <command>login</command> appearance couldbe faked.188 If non-trusted users have a physical access to themachine, an187 As with any program, <command>login</command>'s appearance can be faked. 188 If non-trusted users have physical access to a machine, an 189 189 attacker could use this to obtain the password of the next person 190 sitting in front of the machine. Under Linux, the SAK mecanism can be191 used by users to initiate ofa trusted path and prevent this kind of190 coming to sit in front of the machine. Under Linux, the SAK mechanism can be 191 used by users to initiate a trusted path and prevent this kind of 192 192 attack. 193 193 </para> 194 194 -
man/newusers.8.xml
diff -Naur shadow-4.0.18.1.orig/man/newusers.8.xml shadow-4.0.18.1/man/newusers.8.xml
old new 60 60 </term> 61 61 <listitem> 62 62 <para> 63 This field may be the name of an existing group, in which case 64 the named user will be added as a member. If a non-existent 65 numerical group is given, a new group will be created having 66 this number. 63 This field must contain the name (or number) of a group. The user 64 will be added as a member to this group. When a non-existent 65 group name or number is specified, a new group will be created. 66 In the case of a non-existent group number, both the name and the 67 number of the new group will be this number. 67 68 </para> 68 69 </listitem> 69 70 </varlistentry> … … 73 74 </term> 74 75 <listitem> 75 76 <para> 76 This field will be checked for existence as a directory and a77 new directory with th e samename will be created if it does not77 This field will be checked for existence as a directory, and a 78 new directory with this name will be created if it does not 78 79 already exist. The ownership of the directory will be set to be 79 80 that of the user being created or updated. 80 81 </para> -
man/passwd.1.xml
diff -Naur shadow-4.0.18.1.orig/man/passwd.1.xml shadow-4.0.18.1/man/passwd.1.xml
old new 28 28 <para> 29 29 <command>passwd</command> changes passwords for user accounts. A 30 30 normal user may only change the password for his/her own account, while 31 the super 31 the superuser may change the password for any account. 32 32 <command>passwd</command> also changes account information, such as 33 33 the full name of the user, the user's login shell, or his/her password 34 34 expiry date and interval. … … 40 40 The user is first prompted for his/her old password, if one is 41 41 present. This password is then encrypted and compared against the 42 42 stored password. The user has only one chance to enter the correct 43 password. The super 43 password. The superuser is permitted to bypass this step so that 44 44 forgotten passwords may be changed. 45 45 </para> 46 46 -
man/shadow.3.xml
diff -Naur shadow-4.0.18.1.orig/man/shadow.3.xml shadow-4.0.18.1/man/shadow.3.xml
old new 163 163 <refsect1 id='caveats'> 164 164 <title>CAVEATS</title> 165 165 <para> 166 These routines may only be used by the super 166 These routines may only be used by the superuser as access to the 167 167 shadow password file is restricted. 168 168 </para> 169 169 </refsect1> -
shadow-4.0.18.1
diff -Naur shadow-4.0.18.1.orig/man/su.1.xml shadow-4.0.18.1/man/su.1.xml
old new 8 8 </refmeta> 9 9 <refnamediv id='name'> 10 10 <refname>su</refname> 11 <refpurpose>change user ID or become super -user</refpurpose>11 <refpurpose>change user ID or become superuser</refpurpose> 12 12 </refnamediv> 13 13 <refsynopsisdiv id='synopsis'> 14 14 <cmdsynopsis> … … 30 30 <command>su</command> is used to become another user during a login 31 31 session. Invoked without a <option>username</option>, 32 32 <command>su</command> defaults to 33 becoming the super 33 becoming the superuser. The optional argument <option>-</option> may 34 34 be used to provide an environment similar to what the user would 35 35 expect had the user logged in directly. 36 36 </para> … … 58 58 The current environment is passed to the new shell. The value of 59 59 <envar>$PATH</envar> is reset to <filename>/bin:/usr/bin</filename> 60 60 for normal users, or <filename>/sbin:/bin:/usr/sbin:/usr/bin</filename> 61 for the super 61 for the superuser. This may be changed with the 62 62 <emphasis>ENV_PATH</emphasis> and <emphasis>ENV_SUPATH</emphasis> 63 63 definitions in <filename>/etc/login.defs</filename>. 64 64 </para> … … 78 78 <varlistentry> 79 79 <term> 80 80 <option>-c</option>, <option>--command</option> 81 <replaceable> SHELL</replaceable>81 <replaceable>COMMAND</replaceable> 82 82 </term> 83 83 <listitem> 84 84 <para> … … 112 112 <listitem> 113 113 <para>The shell that will be invoked.</para> 114 114 <para> 115 The invoked shell is cho osen among (higest priority first):115 The invoked shell is chosen from (highest priority first): 116 116 <itemizedlist> 117 117 <listitem> 118 <para>The shell specified with --shell </para>118 <para>The shell specified with --shell.</para> 119 119 </listitem> 120 120 <listitem> 121 121 <para> … … 141 141 <para> 142 142 If the target user has a restricted shell (i.e. the shell field of 143 143 this user's entry in <filename>/etc/passwd</filename> is not 144 specified in <filename>/etc/shell</filename>), then the144 listed in <filename>/etc/shell</filename>), then the 145 145 <option>--shell</option> option or the <envar>$SHELL</envar> 146 environment variable won't be taken into account unless147 <command>su</command> is called by theroot.146 environment variable won't be taken into account, unless 147 <command>su</command> is called by root. 148 148 </para> 149 149 </listitem> 150 150 </varlistentry> -
shadow-4.0.18.1
diff -Naur shadow-4.0.18.1.orig/man/useradd.8 shadow-4.0.18.1/man/useradd.8
old new 168 168 Similarly, if the username already exists in an external user database such as NIS, 169 169 \fBuseradd\fR 170 170 will deny the user account creation request. 171 .PP172 Usernames must begin with a lower case letter or an underscore, and only lower case letters, underscores, dashes, and dollar signs may follow. In regular expression terms: [a\-z_][a\-z0\-9_\-]*[$]173 171 .SH "FILES" 174 172 .TP 3n 175 173 \fI/etc/passwd\fR -
man/useradd.8.xml
diff -Naur shadow-4.0.18.1.orig/man/useradd.8.xml shadow-4.0.18.1/man/useradd.8.xml
old new 36 36 <para> 37 37 When invoked without the <option>-D</option> option, the 38 38 <command>useradd</command> command creates a new user account using 39 the values specified on the command line and the default values from 40 the system. Depending on command line options, the useradd command 39 the values specified on the command line plus the default values from 40 the system. Depending on command line options, the 41 <command>useradd</command> command 41 42 will update system files and may also create the new user's home 42 43 directory and copy initial files. 43 44 </para> … … 78 79 </varlistentry> 79 80 <varlistentry> 80 81 <term> 82 <option>-D</option> 83 </term> 84 <listitem> 85 <para> 86 See below, the subsection "Changing the default values". 87 </para> 88 </listitem> 89 </varlistentry> 90 <varlistentry> 91 <term> 81 92 <option>-d</option>, <option>--home</option> 82 93 <replaceable>HOME_DIR</replaceable> 83 94 </term> … … 256 267 <refsect2 id='changing_the_default_values'> 257 268 <title>Changing the default values</title> 258 269 <para> 259 When invoked with the <option>-D</option> option, 260 <command>useradd</command> will either display the current default 261 values, or update the default values from the command line. The 262 valid options are 270 When invoked with only the <option>-D</option> option, 271 <command>useradd</command> will display the current default values. 272 When invoked with <option>-D</option> plus other options, 273 <command>useradd</command> will update the default values for the 274 specified options. Valid default-changing options are: 263 275 </para> 264 276 <variablelist remap='IP'> 265 277 <varlistentry> … … 269 281 </term> 270 282 <listitem> 271 283 <para> 272 The initialpath prefix for a new user's home directory. The284 The path prefix for a new user's home directory. The 273 285 user's name will be affixed to the end of 274 <replaceable> HOME_DIR</replaceable> to create the new275 directory nameif the <option>-d</option> option is not used286 <replaceable>BASE_DIR</replaceable> to form the new user's 287 home directory name, if the <option>-d</option> option is not used 276 288 when creating a new account. 277 289 </para> 278 290 </listitem> … … 318 330 </term> 319 331 <listitem> 320 332 <para> 321 The name of the new user's login shell. The named program will 322 be used for all future new user accounts. 333 The name of a new user's login shell. 323 334 </para> 324 335 </listitem> 325 336 </varlistentry> 326 337 </variablelist> 327 338 328 <para>329 If no options are specified, <command>useradd</command> displays the330 current default values.331 </para>332 339 </refsect2> 333 340 </refsect1> 334 341 -
man/userdel.8.xml
diff -Naur shadow-4.0.18.1.orig/man/userdel.8.xml shadow-4.0.18.1/man/userdel.8.xml
old new 24 24 <title>DESCRIPTION</title> 25 25 <para> 26 26 The <command>userdel</command> command modifies the system account 27 files, deleting all entries that refer to <emphasis28 remap='I'> login_name</emphasis>. The named user must exist.27 files, deleting all entries that refer to the user name <emphasis 28 remap='I'>LOGIN</emphasis>. The named user must exist. 29 29 </para> 30 30 </refsect1> 31 31 … … 41 41 </term> 42 42 <listitem> 43 43 <para> 44 This option forces the removal of the user, even if she is still 44 This option forces the removal of the user account, even if the 45 user is still 45 46 logged in. It also forces <command>userdel</command> to remove 46 the user's home directory or hermail spool, even if another47 the user's home directory and mail spool, even if another 47 48 user uses the same home directory or if the mail spool is not 48 49 owned by the specified user. If 49 50 <emphasis>USERGROUPS_ENAB</emphasis> is defined to <emphasis -
man/usermod.8.xml
diff -Naur shadow-4.0.18.1.orig/man/usermod.8.xml shadow-4.0.18.1/man/usermod.8.xml
old new 127 127 restrictions as the group given with the <option>-g</option> 128 128 option. If the user is currently a member of a group which is 129 129 not listed, the user will be removed from the group. This 130 behaviour can be changed via <option>-a</option> option, which131 appends user to the current supplementary group list.130 behaviour can be changed via the <option>-a</option> option, which 131 appends the user to the current supplementary group list. 132 132 </para> 133 133 </listitem> 134 134 </varlistentry> … … 143 143 remap='I'>LOGIN</emphasis> to <emphasis 144 144 remap='I'>NEW_LOGIN</emphasis>. Nothing else is changed. In 145 145 particular, the user's home directory name should probably be 146 changed to reflect the new login name.146 changed manually to reflect the new login name. 147 147 </para> 148 148 </listitem> 149 149 </varlistentry> -
src/chgpasswd.c
diff -Naur shadow-4.0.18.1.orig/src/chgpasswd.c shadow-4.0.18.1/src/chgpasswd.c
old new 243 243 newpwd = cp; 244 244 if (!eflg) { 245 245 if (md5flg) { 246 char salt[12] = "$1$"; 246 char tmp[12]; 247 char salt[15] = "\0"; 247 248 248 strcat (salt, crypt_make_salt ()); 249 strcpy( tmp, crypt_make_salt ()); 250 if( !strncmp( tmp, "$1$", 3) ) 251 strcat( salt, "$1$"); 252 strcat( salt, tmp); 249 253 cp = pw_encrypt (newpwd, salt); 250 254 } else 251 255 cp = pw_encrypt (newpwd, crypt_make_salt ()); -
src/chpasswd.c
diff -Naur shadow-4.0.18.1.orig/src/chpasswd.c shadow-4.0.18.1/src/chpasswd.c
old new 239 239 newpwd = cp; 240 240 if (!eflg) { 241 241 if (md5flg) { 242 char salt[12] = "$1$"; 242 char tmp[12]; 243 char salt[15] = "\0"; 243 244 244 strcat (salt, crypt_make_salt ()); 245 strcpy( tmp, crypt_make_salt ()); 246 if( !strncmp( tmp, "$1$", 3) ) 247 strcat( salt, "$1$"); 248 strcat( salt, tmp); 245 249 cp = pw_encrypt (newpwd, salt); 246 250 } else 247 251 cp = pw_encrypt (newpwd, crypt_make_salt ()); -
src/groupmems.c
diff -Naur shadow-4.0.18.1.orig/src/groupmems.c shadow-4.0.18.1/src/groupmems.c
old new 47 47 #define EXIT_SUCCESS 0 /* success */ 48 48 #define EXIT_USAGE 1 /* invalid command syntax */ 49 49 #define EXIT_GROUP_FILE 2 /* group file access problems */ 50 #define EXIT_NOT_ROOT 3 /* not super 51 #define EXIT_NOT_EROOT 4 /* not effective super 50 #define EXIT_NOT_ROOT 3 /* not superuser */ 51 #define EXIT_NOT_EROOT 4 /* not effective superuser */ 52 52 #define EXIT_NOT_PRIMARY 5 /* not primary owner of group */ 53 53 #define EXIT_NOT_MEMBER 6 /* member of group does not exist */ 54 54 #define EXIT_MEMBER_EXISTS 7 /* member of group already exists */ -
shadow-4.0.18.1
diff -Naur shadow-4.0.18.1.orig/src/useradd.c shadow-4.0.18.1/src/useradd.c
old new 203 203 long gid; 204 204 char *errptr; 205 205 206 struct group* grp = getgrnam (grname); 207 if (grp) 208 return grp; 209 206 210 gid = strtol (grname, &errptr, 10); 207 if (*errptr || errno == ERANGE || gid < 0) { 208 fprintf (stderr, 209 _("%s: invalid numeric argument '%s'\n"), Prog, grname); 210 exit (E_BAD_ARG); 211 } 212 return getgrnam (grname); 211 if (*grname != '\0' && *errptr == '\0' && errno != ERANGE && gid >= 0) 212 return getgrgid (gid); 213 return getgrgid (gid); 213 214 } 214 215 215 216 static long get_number (const char *numstr) -
shadow-4.0.18.1
diff -Naur shadow-4.0.18.1.orig/src/usermod.c shadow-4.0.18.1/src/usermod.c
old new 165 165 long val; 166 166 char *errptr; 167 167 168 struct group* grp = getgrnam (grname); 169 if (grp) 170 return grp; 171 168 172 val = strtol (grname, &errptr, 10); 169 if (*errptr || errno == ERANGE || val < 0) { 170 fprintf (stderr, _("%s: invalid numeric argument '%s'\n"), Prog, 171 grname); 172 exit (E_BAD_ARG); 173 } 174 return getgrnam (grname); 173 if (*grname != '\0' && *errptr == '\0' && errno != ERANGE && val >= 0) 174 return getgrgid (val); 175 return getgrgid (val); 175 176 } 176 177 177 178 /* … … 908 909 */ 909 910 int c; 910 911 static struct option long_options[] = { 911 {"append", required_argument, NULL, 'a'},912 {"append", no_argument, NULL, 'a'}, 912 913 {"comment", required_argument, NULL, 'c'}, 913 914 {"home", required_argument, NULL, 'd'}, 914 915 {"expiredate", required_argument, NULL, 'e'},
Note:
See TracBrowser
for help on using the repository browser.