* `LICENSE' that comes with the fcron source distribution.
*/
- /* $Id: log.c,v 1.9 2001-09-12 13:37:13 thib Exp $ */
+ /* $Id: log.c,v 1.10 2001-10-29 13:21:02 thib Exp $ */
/* This code is inspired by Anacron's sources of
Itai Tzur <itzur@actcom.co.il> */
strftime(date, sizeof(date), "%H:%M:%S", ft);
fprintf(stderr, "%s %s: %s\n", date, msg, pam_strerror(pamh, pamerrno));
}
+ xcloselog();
}
#endif
}
+#ifdef HAVE_LIBPAM
+/* Log a "complain" level message, with a PAM error description */
+void
+error_pame(pam_handle_t *pamh, int pamerrno, char *fmt, ...)
+{
+ va_list args;
+
+ xcloselog(); /* PAM is likely to have used openlog() */
+
+ va_start(args, fmt);
+ log_pame(COMPLAIN_LEVEL, pamh, pamerrno, fmt, args);
+ va_end(args);
+}
+#endif
+
/* Log a "complain" level message, and exit */
void
die(char *fmt, ...)
* `LICENSE' that comes with the fcron source distribution.
*/
- /* $Id: log.h,v 1.3 2001-09-12 13:37:31 thib Exp $ */
+ /* $Id: log.h,v 1.4 2001-10-29 13:21:16 thib Exp $ */
#ifndef __LOG_H__
#define __LOG_H__
/* functions prototypes */
extern void xcloselog(void);
-extern char *make_msg(char *fmt, va_list args);
extern void explain(char *fmt, ...);
extern void explain_e(char *fmt, ...);
extern void warn(char *fmt, ...);
extern void die(char *fmt, ...);
extern void die_e(char *fmt, ...);
#ifdef HAVE_LIBPAM
+extern void error_pame(pam_handle_t *pamh, int pamerrno, char *fmt, ...);
extern void die_pame(pam_handle_t *pamh, int pamerrno, char *fmt, ...);
#endif
extern void Debug(char *fmt, ...);