* 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:
nekral-guest 2008-09-14 13:42:10 +00:00
parent 5df1f2f683
commit f3df48ab4f
5 changed files with 21 additions and 8 deletions

View File

@ -1,3 +1,13 @@
2008-09-14 Nicolas François <nicolas.francois@centraliens.net>
* 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.
2008-09-13 Nicolas François <nicolas.francois@centraliens.net>
* libmisc/setugid.c, src/login_nopam.c, src/suauth.c,

View File

@ -109,7 +109,7 @@ int find_new_gid (bool sys_group, gid_t *gid, gid_t const *preferred_gid)
*/
if (group_id == gid_max + 1) {
for (group_id = gid_min; group_id < gid_max; group_id++) {
if (0 == used_gids[grp->gr_gid]) {
if (0 == used_gids[group_id]) {
break;
}
}

View File

@ -110,7 +110,7 @@ int find_new_uid (bool sys_user, uid_t *uid, uid_t const *preferred_uid)
*/
if (user_id == uid_max + 1) {
for (user_id = uid_min; user_id < uid_max; user_id++) {
if (0 == used_uids[pwd->pw_uid]) {
if (0 == used_uids[user_id]) {
break;
}
}

View File

@ -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;
}

View File

@ -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 */