]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
sulogin: add missing ifdefs
authorKarel Zak <kzak@redhat.com>
Wed, 16 Jun 2021 13:44:02 +0000 (15:44 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 20 Jul 2021 09:22:23 +0000 (11:22 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
login-utils/sulogin.c

index d7350b071f2adb663338953bba85a21076f73cec..3016ef4836a5a54944af53ba000fd48b9b48e1e9 100644 (file)
@@ -713,8 +713,10 @@ quit:
        tcfinal(con);
        printf("\r\n");
 out:
+#ifdef HAVE_EXPLICIT_BZERO
        if (ret == NULL)
                explicit_bzero(pass, sizeof(pass));
+#endif
        return ret;
 }
 
@@ -990,7 +992,9 @@ int main(int argc, char **argv)
                                if ((answer = getpasswd(con)) == NULL)
                                        break;
                                if (deny) {
+#ifdef HAVE_EXPLICIT_BZERO
                                        explicit_bzero(answer, SULOGIN_PASSWORD_BUFSIZ);
+#endif
                                        exit(EXIT_FAILURE);
                                }
 
@@ -1005,9 +1009,9 @@ int main(int argc, char **argv)
                                        else if (strcmp(cryptbuf, pwd->pw_passwd) == 0)
                                                doshell++;
                                }
-
+#ifdef HAVE_EXPLICIT_BZERO
                                explicit_bzero(answer, SULOGIN_PASSWORD_BUFSIZ);
-
+#endif
                                if (doshell) {
                                        /* sushell() unmask signals */
                                        sushell(pwd);