]> granicus.if.org Git - shadow/commitdiff
* lib/fields.c: Fixed typo from 2010-02-15. field insteadof cp
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Fri, 8 Jul 2011 19:56:18 +0000 (19:56 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Fri, 8 Jul 2011 19:56:18 +0000 (19:56 +0000)
ought to be checked.
* src/vipw.c: Use Prog instead of progname. This is needed since
Prog is used in the library.

ChangeLog
lib/fields.c
src/vipw.c

index 734ef6bc7f69f01c5813e6115e56781c0a93f94d..bd7ee93b4d27d2d346eaa3a32f107ead5fdfc410 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2011-07-08  Nicolas François  <nicolas.francois@centraliens.net>
+
+       * src/groupadd.c: Fix typo in comment.
+       * src/userdel.c: Fix typo from 2011-06-04. Report failure on the
+       mailfile instead of user_home.
+       * lib/fields.c: Fixed typo from 2010-02-15. field insteadof cp
+       ought to be checked.
+       * src/vipw.c: Use Prog instead of progname. This is needed since
+       Prog is used in the library.
+
 2011-07-08  Nicolas François  <nicolas.francois@centraliens.net>
 
        * man/*.xml, man/config.xml.in: Add source and version
index 12377dc41ac4abec83a1a967189271c8d5769209..649fae170bcafb1ae99322aaa9ef3036d4989c29 100644 (file)
@@ -54,7 +54,7 @@ int valid_field (const char *field, const char *illegal)
        const char *cp;
        int err = 0;
 
-       if (NULL == cp) {
+       if (NULL == field) {
                return -1;
        }
 
index 9f4118315d38e2597b079804d7ef355dfcbd0cc2..75e59c887fe13aadad05c8a472edae4380725949 100644 (file)
@@ -61,7 +61,9 @@
 /*
  * Global variables
  */
-static const char *progname, *filename, *fileeditname;
+const char *Prog;
+
+static const char *filename, *fileeditname;
 static bool filelocked = false;
 static bool createedit = false;
 static int (*unlock) (void);
@@ -158,26 +160,26 @@ static void vipwexit (const char *msg, int syserr, int ret)
 
        if (createedit) {
                if (unlink (fileeditname) != 0) {
-                       fprintf (stderr, _("%s: failed to remove %s\n"), progname, fileeditname);
+                       fprintf (stderr, _("%s: failed to remove %s\n"), Prog, fileeditname);
                        /* continue */
                }
        }
        if (filelocked) {
                if ((*unlock) () == 0) {
-                       fprintf (stderr, _("%s: failed to unlock %s\n"), progname, fileeditname);
+                       fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, fileeditname);
                        SYSLOG ((LOG_ERR, "failed to unlock %s", fileeditname));
                        /* continue */
                }
        }
        if (NULL != msg) {
-               fprintf (stderr, "%s: %s", progname, msg);
+               fprintf (stderr, "%s: %s", Prog, msg);
        }
        if (0 != syserr) {
                fprintf (stderr, ": %s", strerror (err));
        }
        (void) fputs ("\n", stderr);
        if (!quiet) {
-               fprintf (stdout, _("%s: %s is unchanged\n"), progname,
+               fprintf (stdout, _("%s: %s is unchanged\n"), Prog,
                         filename);
        }
        exit (ret);
@@ -297,7 +299,7 @@ vipwedit (const char *file, int (*file_lock) (void), int (*file_unlock) (void))
                snprintf (buf, strlen (editor) + strlen (fileedit) + 2,
                          "%s %s", editor, fileedit);
                if (system (buf) != 0) {
-                       fprintf (stderr, "%s: %s: %s\n", progname, editor,
+                       fprintf (stderr, "%s: %s: %s\n", Prog, editor,
                                 strerror (errno));
                        exit (1);
                } else {
@@ -381,7 +383,7 @@ vipwedit (const char *file, int (*file_lock) (void), int (*file_unlock) (void))
        if (rename (to_rename, file) == -1) {
                fprintf (stderr,
                         _("%s: can't restore %s: %s (your changes are in %s)\n"),
-                        progname, file, strerror (errno), to_rename);
+                        Prog, file, strerror (errno), to_rename);
 #ifdef WITH_TCB
                if (tcb_mode) {
                        free (to_rename);
@@ -400,7 +402,7 @@ vipwedit (const char *file, int (*file_lock) (void), int (*file_unlock) (void))
 #endif                         /* WITH_TCB */
 
        if ((*file_unlock) () == 0) {
-               fprintf (stderr, _("%s: failed to unlock %s\n"), progname, fileeditname);
+               fprintf (stderr, _("%s: failed to unlock %s\n"), Prog, fileeditname);
                SYSLOG ((LOG_ERR, "failed to unlock %s", fileeditname));
                /* continue */
        }
@@ -417,8 +419,8 @@ int main (int argc, char **argv)
        (void) bindtextdomain (PACKAGE, LOCALEDIR);
        (void) textdomain (PACKAGE);
 
-       progname = ((a = strrchr (*argv, '/')) ? a + 1 : *argv);
-       do_vipw = (strcmp (progname, "vigr") != 0);
+       Prog = ((a = strrchr (*argv, '/')) ? a + 1 : *argv);
+       do_vipw = (strcmp (Prog, "vigr") != 0);
 
        OPENLOG (do_vipw ? "vipw" : "vigr");
 
@@ -479,7 +481,7 @@ int main (int argc, char **argv)
                                if (shadowtcb_set_user (user) == SHADOWTCB_FAILURE) {
                                        fprintf (stderr,
                                                 _("%s: failed to find tcb directory for %s\n"),
-                                                progname, user);
+                                                Prog, user);
                                        return E_SHADOW_NOTFOUND;
                                }
                                tcb_mode = true;