|
Lines 114-120
static int do_grp_update = 0; /* group f
|
Link Here
|
|---|
|
static char *Prog; | static char *Prog; |
| |
static int | static int |
bflg = 0, /* new default root of home directory */ |
bflg = 0, /* new default root of home directory */ |
cflg = 0, /* comment (GECOS) field for new account */ | cflg = 0, /* comment (GECOS) field for new account */ |
dflg = 0, /* home directory for new account */ | dflg = 0, /* home directory for new account */ |
Dflg = 0, /* set/show new user default values */ | Dflg = 0, /* set/show new user default values */ |
|
Lines 253-258
static void get_defaults (void)
|
Link Here
|
|---|
|
const struct group *grp; | const struct group *grp; |
| |
/* | /* |
|
* Pull relevant settings from login.defs first. |
|
*/ |
|
nflg = getdef_bool ("USERGROUPS_ENAB"); |
|
|
|
/* |
* Open the defaults file for reading. | * Open the defaults file for reading. |
*/ | */ |
| |
|
Lines 628-633
static void usage (void)
|
Link Here
|
|---|
|
" -K, --key KEY=VALUE overrides /etc/login.defs defaults\n" | " -K, --key KEY=VALUE overrides /etc/login.defs defaults\n" |
" -m, --create-home create home directory for the new user\n" | " -m, --create-home create home directory for the new user\n" |
" account\n" | " account\n" |
|
" -n, --user-group create a new group with the same name as the\n" |
|
" new user\n" |
" -o, --non-unique allow create user with duplicate\n" | " -o, --non-unique allow create user with duplicate\n" |
" (non-unique) UID\n" | " (non-unique) UID\n" |
" -p, --password PASSWORD use encrypted password for the new user\n" | " -p, --password PASSWORD use encrypted password for the new user\n" |
|
Lines 1009-1014
static void process_flags (int argc, cha
|
Link Here
|
|---|
|
{"skel", required_argument, NULL, 'k'}, | {"skel", required_argument, NULL, 'k'}, |
{"key", required_argument, NULL, 'K'}, | {"key", required_argument, NULL, 'K'}, |
{"create-home", no_argument, NULL, 'm'}, | {"create-home", no_argument, NULL, 'm'}, |
|
{"user-group", no_argument, NULL, 'n'}, |
{"non-unique", no_argument, NULL, 'o'}, | {"non-unique", no_argument, NULL, 'o'}, |
{"password", required_argument, NULL, 'p'}, | {"password", required_argument, NULL, 'p'}, |
{"shell", required_argument, NULL, 's'}, | {"shell", required_argument, NULL, 's'}, |
|
Lines 1016-1022
static void process_flags (int argc, cha
|
Link Here
|
|---|
|
{NULL, 0, NULL, '\0'} | {NULL, 0, NULL, '\0'} |
}; | }; |
while ((c = | while ((c = |
getopt_long (argc, argv, "b:c:d:De:f:g:G:k:K:mMop:s:u:", |
getopt_long (argc, argv, "b:c:d:De:f:g:G:k:K:mMnop:s:u:", |
long_options, NULL)) != -1) { | long_options, NULL)) != -1) { |
switch (c) { | switch (c) { |
case 'b': | case 'b': |
|
Lines 1156-1161
static void process_flags (int argc, cha
|
Link Here
|
|---|
|
case 'm': | case 'm': |
mflg++; | mflg++; |
break; | break; |
|
case 'n': |
|
nflg++; |
|
break; |
case 'o': | case 'o': |
oflg++; | oflg++; |
break; | break; |
|
Lines 1767-1773
int main (int argc, char **argv)
|
Link Here
|
|---|
|
| |
/* do we have to add a group for that user? This is why we need to | /* do we have to add a group for that user? This is why we need to |
* open the group files in the open_files() function --gafton */ | * open the group files in the open_files() function --gafton */ |
if (!(nflg || gflg)) { |
if (nflg && !gflg) { |
find_new_gid (); | find_new_gid (); |
grp_add (); | grp_add (); |
} | } |