]> granicus.if.org Git - cronie/commitdiff
crond: never define unused cron_start_pam()
authorSami Kerola <kerolasa@iki.fi>
Sat, 10 Jun 2017 20:54:26 +0000 (21:54 +0100)
committerTomáš Mráz <t8m@users.noreply.github.com>
Mon, 10 Jul 2017 16:13:14 +0000 (18:13 +0200)
Move function completely within #ifdef just like all the code where this
function is used.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
src/security.c

index 79805c56286be4033b3d4370d68a52ac550a8c88..2c668c4e84eb1b867acdf257163579530a896976 100644 (file)
@@ -187,10 +187,10 @@ int cron_set_job_security_context(entry *e, user *u ATTRIBUTE_UNUSED,
        return 0;
 }
 
+#if defined(WITH_PAM)
 int cron_start_pam(struct passwd *pw) {
        int retcode = 0;
 
-#if defined(WITH_PAM)
        retcode = pam_start("crond", pw->pw_name, &conv, &pamh);
        PAM_FAIL_CHECK;
        retcode = pam_set_item(pamh, PAM_TTY, "cron");
@@ -199,10 +199,10 @@ int cron_start_pam(struct passwd *pw) {
        PAM_FAIL_CHECK;
        retcode = pam_setcred(pamh, PAM_ESTABLISH_CRED | PAM_SILENT);
        PAM_FAIL_CHECK;
-#endif
 
        return retcode;
 }
+#endif
 
 #if defined(WITH_PAM)
 static int cron_open_pam_session(struct passwd *pw) {