]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
Avoid unused variable warnings when building with PAM
authorChristian Göttsche <cgzones@googlemail.com>
Mon, 3 Jan 2022 11:23:17 +0000 (12:23 +0100)
committerChristian Göttsche <cgzones@googlemail.com>
Mon, 3 Jan 2022 14:09:17 +0000 (15:09 +0100)
newusers.c:467:15: warning: unused variable ‘cp’ [-Wunused-variable]
  467 |         char *cp;
      |               ^~

newusers.c:611:13: warning: unused variable ‘bad_s’ [-Wunused-variable]
  611 |         int bad_s;
      |             ^~~~~

src/newusers.c

index c1d29f83a2baa6ea05277c8dff4757c395d42074..8e7c620dcbd889d798c7ddcbf8d369fdcb4cd1d3 100644 (file)
@@ -464,7 +464,9 @@ static int add_passwd (struct passwd *pwd, const char *password)
 {
        const struct spwd *sp;
        struct spwd spent;
+#ifndef USE_PAM
        char *cp;
+#endif                         /* !USE_PAM */
 
 #ifndef USE_PAM
        void *crypt_arg = NULL;
@@ -607,9 +609,11 @@ static int add_passwd (struct passwd *pwd, const char *password)
 static void process_flags (int argc, char **argv)
 {
        int c;
+#ifndef USE_PAM
 #if defined(USE_SHA_CRYPT) || defined(USE_BCRYPT) || defined(USE_YESCRYPT)
         int bad_s;
 #endif                         /* USE_SHA_CRYPT || USE_BCRYPT || USE_YESCRYPT */
+#endif                                 /* !USE_PAM */
        static struct option long_options[] = {
                {"badnames",     no_argument,       NULL, 'b'},
 #ifndef USE_PAM