]> granicus.if.org Git - cronie/commitdiff
Move macros and static declarations where they are needed.
authorTomas Mraz <t8m@centrum.cz>
Mon, 23 Jun 2008 19:01:33 +0000 (21:01 +0200)
committerTomas Mraz <t8m@centrum.cz>
Mon, 23 Jun 2008 19:01:33 +0000 (21:01 +0200)
src/cron.h
src/security.c

index 6ed3de16af411c8b7ca2d9725f391597a18bd4d1..dff8fc1a0587773c975985aa92152830a1b46bfa 100644 (file)
 #include "funcs.h"
 #include "globals.h"
 
-#ifdef WITH_PAM
-static pam_handle_t *pamh = NULL;
-static int pam_session_opened = 0;  //global for open session
-static const struct pam_conv conv = {
-    NULL
-};
-
-#define PAM_FAIL_CHECK if (retcode != PAM_SUCCESS) { \
-    fprintf(stderr,"\n%s\n",pam_strerror(pamh, retcode)); \
-    if (pamh != NULL) { \
-        if (pam_session_opened != 0) \
-            pam_close_session(pamh, PAM_SILENT); \
-        pam_end(pamh, retcode); \
-    } \
-        return(retcode);    }
-#endif
-
index 03336304cc70c15dd68ac73933771a5afd3e826d..eb4c9c137c3ff0fa82d7e56232c71750f3cf7af7 100644 (file)
 #include <libaudit.h>
 #endif
 
+#ifdef WITH_PAM
+static pam_handle_t *pamh = NULL;
+static int pam_session_opened = 0;  //global for open session
+static const struct pam_conv conv = {
+    NULL
+};
+
+static int cron_open_pam_session(struct passwd *pw);
+
+#define PAM_FAIL_CHECK if (retcode != PAM_SUCCESS) { \
+    fprintf(stderr,"\n%s\n",pam_strerror(pamh, retcode)); \
+    if (pamh != NULL) { \
+        if (pam_session_opened != 0) \
+            pam_close_session(pamh, PAM_SILENT); \
+        pam_end(pamh, retcode); \
+    } \
+        return(retcode);    }
+#endif
+
 static char ** build_env(char **cronenv);
 
 #ifdef WITH_SELINUX
@@ -140,7 +159,7 @@ int cron_start_pam(struct passwd *pw) {
     return retcode;
 }
 
-int cron_open_pam_session(struct passwd *pw) {
+static int cron_open_pam_session(struct passwd *pw) {
     int        retcode = 0;
 
 #if defined(WITH_PAM)