Line
Link Here
|
0 |
-- src/useradd.c |
0 |
++ src/useradd.c |
Lines 114-120
static int do_grp_update = 0; /* group f
Link Here
|
114 |
static char *Prog; |
114 |
static char *Prog; |
115 |
|
115 |
|
116 |
static int |
116 |
static int |
117 |
bflg = 0, /* new default root of home directory */ |
117 |
bflg = 0, /* new default root of home directory */ |
118 |
cflg = 0, /* comment (GECOS) field for new account */ |
118 |
cflg = 0, /* comment (GECOS) field for new account */ |
119 |
dflg = 0, /* home directory for new account */ |
119 |
dflg = 0, /* home directory for new account */ |
120 |
Dflg = 0, /* set/show new user default values */ |
120 |
Dflg = 0, /* set/show new user default values */ |
Lines 253-258
static void get_defaults (void)
Link Here
|
253 |
const struct group *grp; |
253 |
const struct group *grp; |
254 |
|
254 |
|
255 |
/* |
255 |
/* |
|
|
256 |
* Pull relevant settings from login.defs first. |
257 |
*/ |
258 |
nflg = getdef_bool ("USERGROUPS_ENAB"); |
259 |
|
260 |
/* |
256 |
* Open the defaults file for reading. |
261 |
* Open the defaults file for reading. |
257 |
*/ |
262 |
*/ |
258 |
|
263 |
|
Lines 628-633
static void usage (void)
Link Here
|
628 |
" -K, --key KEY=VALUE overrides /etc/login.defs defaults\n" |
633 |
" -K, --key KEY=VALUE overrides /etc/login.defs defaults\n" |
629 |
" -m, --create-home create home directory for the new user\n" |
634 |
" -m, --create-home create home directory for the new user\n" |
630 |
" account\n" |
635 |
" account\n" |
|
|
636 |
" -n, --user-group create a new group with the same name as the\n" |
637 |
" new user\n" |
631 |
" -o, --non-unique allow create user with duplicate\n" |
638 |
" -o, --non-unique allow create user with duplicate\n" |
632 |
" (non-unique) UID\n" |
639 |
" (non-unique) UID\n" |
633 |
" -p, --password PASSWORD use encrypted password for the new user\n" |
640 |
" -p, --password PASSWORD use encrypted password for the new user\n" |
Lines 1009-1014
static void process_flags (int argc, cha
Link Here
|
1009 |
{"skel", required_argument, NULL, 'k'}, |
1016 |
{"skel", required_argument, NULL, 'k'}, |
1010 |
{"key", required_argument, NULL, 'K'}, |
1017 |
{"key", required_argument, NULL, 'K'}, |
1011 |
{"create-home", no_argument, NULL, 'm'}, |
1018 |
{"create-home", no_argument, NULL, 'm'}, |
|
|
1019 |
{"user-group", no_argument, NULL, 'n'}, |
1012 |
{"non-unique", no_argument, NULL, 'o'}, |
1020 |
{"non-unique", no_argument, NULL, 'o'}, |
1013 |
{"password", required_argument, NULL, 'p'}, |
1021 |
{"password", required_argument, NULL, 'p'}, |
1014 |
{"shell", required_argument, NULL, 's'}, |
1022 |
{"shell", required_argument, NULL, 's'}, |
Lines 1016-1022
static void process_flags (int argc, cha
Link Here
|
1016 |
{NULL, 0, NULL, '\0'} |
1024 |
{NULL, 0, NULL, '\0'} |
1017 |
}; |
1025 |
}; |
1018 |
while ((c = |
1026 |
while ((c = |
1019 |
getopt_long (argc, argv, "b:c:d:De:f:g:G:k:K:mMop:s:u:", |
1027 |
getopt_long (argc, argv, "b:c:d:De:f:g:G:k:K:mMnop:s:u:", |
1020 |
long_options, NULL)) != -1) { |
1028 |
long_options, NULL)) != -1) { |
1021 |
switch (c) { |
1029 |
switch (c) { |
1022 |
case 'b': |
1030 |
case 'b': |
Lines 1156-1161
static void process_flags (int argc, cha
Link Here
|
1156 |
case 'm': |
1164 |
case 'm': |
1157 |
mflg++; |
1165 |
mflg++; |
1158 |
break; |
1166 |
break; |
|
|
1167 |
case 'n': |
1168 |
nflg++; |
1169 |
break; |
1159 |
case 'o': |
1170 |
case 'o': |
1160 |
oflg++; |
1171 |
oflg++; |
1161 |
break; |
1172 |
break; |
Lines 1767-1773
int main (int argc, char **argv)
Link Here
|
1767 |
|
1778 |
|
1768 |
/* do we have to add a group for that user? This is why we need to |
1779 |
/* do we have to add a group for that user? This is why we need to |
1769 |
* open the group files in the open_files() function --gafton */ |
1780 |
* open the group files in the open_files() function --gafton */ |
1770 |
if (!(nflg || gflg)) { |
1781 |
if (nflg && !gflg) { |
1771 |
find_new_gid (); |
1782 |
find_new_gid (); |
1772 |
grp_add (); |
1783 |
grp_add (); |
1773 |
} |
1784 |
} |