* src/useradd.c: Added missing declaration of Mflg.
* src/pwck.c: Only unlock files if they were locked before (e.g. not in read-only mode). * src/pwck.c: Quote the username in error messages (harmonization with other messages). * libmisc/find_new_gid.c: Fixed typo (s/grp->gr_gid/group_id/). * libmisc/find_new_gid.c: Likewise.
This commit is contained in:
14
src/pwck.c
14
src/pwck.c
@ -267,7 +267,7 @@ static void close_files (bool changed)
|
||||
/*
|
||||
* Don't be anti-social - unlock the files when you're done.
|
||||
*/
|
||||
if (is_shadow) {
|
||||
if (spw_locked) {
|
||||
if (spw_unlock () == 0) {
|
||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, spw_dbname ());
|
||||
SYSLOG ((LOG_ERR, "failed to unlock %s", spw_dbname ()));
|
||||
@ -275,10 +275,12 @@ static void close_files (bool changed)
|
||||
}
|
||||
}
|
||||
spw_locked = false;
|
||||
if (pw_unlock () == 0) {
|
||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
|
||||
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
|
||||
/* continue */
|
||||
if (pw_locked) {
|
||||
if (pw_unlock () == 0) {
|
||||
fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, pw_dbname ());
|
||||
SYSLOG ((LOG_ERR, "failed to unlock %s", pw_dbname ()));
|
||||
/* continue */
|
||||
}
|
||||
}
|
||||
pw_locked = false;
|
||||
}
|
||||
@ -403,7 +405,7 @@ static void check_pw_file (int *errors, bool *changed)
|
||||
* No primary group, just give a warning
|
||||
*/
|
||||
|
||||
printf (_("user %s: no group %lu\n"),
|
||||
printf (_("user '%s': no group %lu\n"),
|
||||
pwd->pw_name, (unsigned long) pwd->pw_gid);
|
||||
*errors += 1;
|
||||
}
|
||||
|
@ -135,6 +135,7 @@ static bool
|
||||
kflg = false, /* specify a directory to fill new user directory */
|
||||
lflg = false, /* do not add user to lastlog/faillog databases */
|
||||
mflg = false, /* create user's home directory if it doesn't exist */
|
||||
Mflg = false, /* do not create user's home directory even if CREATE_HOME is set */
|
||||
Nflg = false, /* do not create a group having the same name as the user, but add the user to def_group (or the group specified with -g) */
|
||||
oflg = false, /* permit non-unique user ID to be specified with -u */
|
||||
rflg = false, /* create a system account */
|
||||
|
Reference in New Issue
Block a user