]> git.ipfire.org Git - thirdparty/fcron.git/commitdiff
added PAM support
authorThibault Godouet <yo8192@users.noreply.github.com>
Wed, 12 Sep 2001 13:42:58 +0000 (13:42 +0000)
committerThibault Godouet <yo8192@users.noreply.github.com>
Wed, 12 Sep 2001 13:42:58 +0000 (13:42 +0000)
configure.in
fcron.c

index 62d3e67c26ec0f33a312c98a8e48a7223a186a09..3c8857a5de284aaeb9d705e8b95f0a60684cddc4 100644 (file)
@@ -8,7 +8,7 @@ AC_PREFIX_DEFAULT($prefix)
 AC_CONFIG_HEADER(config.h)
 AC_PREREQ(2.7)
 
-vers="2.0.0"
+vers="2.1.0"
 vers_quoted="\"$vers\""
 AC_DEFINE_UNQUOTED(VERSION, $vers)
 AC_DEFINE_UNQUOTED(VERSION_QUOTED, $vers_quoted)
@@ -31,6 +31,7 @@ AC_CHECK_HEADERS(errno.h sys/fcntl.h getopt.h limits.h)
 AC_CHECK_HEADERS(stdarg.h)
 AC_CHECK_HEADERS(sys/termios.h)
 AC_CHECK_HEADERS(strings.h)
+AC_CHECK_HEADERS(security/pam_appl.h)
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
@@ -636,6 +637,27 @@ if test \( $seteuid -eq 1 \) -a \( $setegid -eq 1 \) ; then
   AC_DEFINE(USE_SETE_ID)
 fi
 
+
+AC_MSG_CHECKING(if pam should be used if available)
+AC_ARG_WITH(pam,
+[ --with-pam=[yes|no]  Use (or not) PAM if available (default: yes).],
+[ case "$withval" in
+  no)
+    AC_MSG_RESULT(no)
+    ;;
+  yes)
+    AC_MSG_RESULT(yes)
+    AC_CHECK_LIB(pam, pam_start)
+    ;;
+  *)
+    AC_MSG_ERROR(Must be set to either "yes" or "no".)
+    ;;
+  esac ],
+  AC_MSG_RESULT(yes)
+  AC_CHECK_LIB(pam, pam_start)
+)
+
+
 dnl We set exec_prefix to $prefix (also done in Makefile)
 exec_prefix=$prefix
 BINDIREX=`eval echo $bindir`
diff --git a/fcron.c b/fcron.c
index aac04db44d5ec778aede382e4f138d0f7e988050..c2c93c09dc9bf36b3625aef379a4e4004336d226 100644 (file)
--- a/fcron.c
+++ b/fcron.c
  *  `LICENSE' that comes with the fcron source distribution.
  */
 
- /* $Id: fcron.c,v 1.55 2001-08-20 10:54:45 thib Exp $ */
+ /* $Id: fcron.c,v 1.56 2001-09-12 13:44:50 thib Exp $ */
 
 #include "fcron.h"
 
-char rcs_info[] = "$Id: fcron.c,v 1.55 2001-08-20 10:54:45 thib Exp $";
+#include "database.h"
+#include "conf.h"
+#include "job.h"
+
+char rcs_info[] = "$Id: fcron.c,v 1.56 2001-09-12 13:44:50 thib Exp $";
 
 void main_loop(void);
 void check_signal(void);
@@ -96,6 +100,10 @@ short int exe_num;            /* number of job being executed */
 time_t begin_sleep;           /* the time at which sleep began */
 time_t now;                   /* the current time */
 
+#ifdef HAVE_LIBPAM
+pam_handle_t *pamh = NULL;
+const struct pam_conv apamconv = { NULL };
+#endif
 
 void
 info(void)
@@ -241,7 +249,7 @@ parseopt(int argc, char *argv[])
   /* set options */
 {
 
-    char c;
+    int c;
     int i;
 
 #ifdef HAVE_GETOPT_LONG
@@ -271,7 +279,7 @@ parseopt(int argc, char *argv[])
 #else
        c = getopt(argc, argv, "dfbhVs:m:c:n:");
 #endif /* HAVE_GETOPT_LONG */
-       if (c == EOF) break;
+       if ( c == EOF ) break;
        switch (c) {
 
        case 'V':