Kick PAM into shape, so that the radius entries are sent to the
radius configuration, when using syslog. PAM likes to re-do
openlog() with a different facility, which is not a nice thing
to do to people.
*/
extern const char *progname;
extern int debug_flag;
+extern int syslog_facility;
extern const char *radacct_dir;
extern const char *radlog_dir;
extern const char *radlib_dir;
const char *radacct_dir = NULL;
const char *radlog_dir = NULL;
const char *radlib_dir = NULL;
+int syslog_facility;
int log_stripped_names;
int debug_flag;
int use_dbm = FALSE;
int fd = 0;
int devnull;
int status;
- int syslog_facility = LOG_DAEMON;
int radius_port = 0;
struct servent *svp;
struct timeval *tv = NULL;
+ syslog_facility = LOG_DAEMON;
#ifdef OSFC2
set_auth_parameters(argc,argv);
#endif
r = pam_pass((char *)request->username->strvalue,
(char *)request->password->strvalue,
pam_auth_string);
+
+#if HAVE_SYSLOG_H
+ if (!strcmp(radlog_dir, "syslog")) {
+ openlog(progname, LOG_PID, syslog_facility);
+ }
+#endif
+
if (r == 0) {
return RLM_MODULE_OK;
}