From: Thibault Godouet Date: Wed, 12 Sep 2001 13:42:58 +0000 (+0000) Subject: added PAM support X-Git-Tag: ver2_9_4~254 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf10f9c07c75e471192a773667e415a4f65bf6ec;p=thirdparty%2Ffcron.git added PAM support --- diff --git a/configure.in b/configure.in index 62d3e67..3c8857a 100644 --- a/configure.in +++ b/configure.in @@ -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 aac04db..c2c93c0 100644 --- a/fcron.c +++ b/fcron.c @@ -21,11 +21,15 @@ * `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':