* src/useradd.c: Added missing declaration of Mflg.
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sun, 14 Sep 2008 13:42:10 +0000 (13:42 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Sun, 14 Sep 2008 13:42:10 +0000 (13:42 +0000)
* 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.

ChangeLog
libmisc/find_new_gid.c
libmisc/find_new_uid.c
src/pwck.c
src/useradd.c

index 802ce37db0b3b7cf3f1ebf303ad1f82828c71409..2c5b1751417b97edd70ef4ecc6fd56b478514a5c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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,
index 85e00d3e9f83adf5a066ab893588ba73a70657dc..0201ebdf0c02e5751cdcc392f732d695003ff46c 100644 (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;
                        }
                }
index f4efb9f8c3bcdaa480b46979a506c753ed78a19e..90918b40f3b1e0df7b6d33d5d914bb62346426a9 100644 (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;
                        }
                }
index 5b1704cf0927e7dd32d3a50d657d4f19f02353d8..cb695ae28a431f0c9c6960414e7e7faa81bac4ef 100644 (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;
                }
index 5f9a01b787770592729728b3b24a815b5beaa947..a8a7b32e8e58bf7793fa589f4e6191099253533b 100644 (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 */