char *message;
char *logline;
#if (LOGGING & SLOG_SYSLOG)
- int pri = Syslog_priority_NO;
+ int pri = PRI_FAILURE;
#endif /* LOGGING & SLOG_SYSLOG */
/* Set error message, if any. */
case VALIDATE_OK:
case VALIDATE_OK_NOPASS:
#if (LOGGING & SLOG_SYSLOG)
- pri = Syslog_priority_OK;
+ pri = PRI_SUCCESS;
#endif /* LOGGING & SLOG_SYSLOG */
#ifdef SEND_MAIL_WHEN_OK
send_mail(logline);
* Log to syslog and/or a file.
*/
#if (LOGGING & SLOG_SYSLOG)
- do_syslog(Syslog_priority_NO, logline);
+ do_syslog(PRI_FAILURE, logline);
#endif
#if (LOGGING & SLOG_FILE)
do_logfile(logline);
#define SLOG_FILE 0x02
#define SLOG_BOTH 0x03
-/* XXX - priority should be configure flag */
-/* these should all get renamed */
+/* XXX - PRI_SUCCESS and PRI_FAILURE should be configure options */
#if (LOGGING & SLOG_SYSLOG)
# include <syslog.h>
-# ifndef Syslog_ident
-# define Syslog_ident "sudo"
-# endif
-# ifndef Syslog_options
-# define Syslog_options 0
-# endif
-# if !defined(Syslog_facility) && defined(LOG_NFACILITIES)
-# define Syslog_facility LOGFAC
-# endif
-# ifndef Syslog_priority_OK
-# define Syslog_priority_OK LOG_NOTICE
-# endif
-# ifndef Syslog_priority_NO
-# define Syslog_priority_NO LOG_ALERT
-# endif
+# define PRI_SUCCESS LOG_NOTICE
+# define PRI_FAILURE LOG_ALERT
#endif /* LOGGING & SLOG_SYSLOG */
void log_auth __P((int, int));
#include "sudo.h"
#include "interfaces.h"
-#include "version.h"
#ifndef STDC_HEADERS
extern char *getenv __P((char *));
/* Initialize syslog(3) if we are using it. */
#if (LOGGING & SLOG_SYSLOG)
-# ifdef Syslog_facility
- openlog(Syslog_ident, Syslog_options, Syslog_facility);
+# ifdef LOG_NFACILITIES
+ openlog("sudo", 0, LOGFAC);
# else
- openlog(Syslog_ident, Syslog_options);
-# endif /* Syslog_facility */
+ openlog("sudo", 0);
+# endif /* LOG_NFACILITIES */
#endif /* LOGGING & SLOG_SYSLOG */
/*
switch (sudo_mode) {
case MODE_VERSION:
+ print_version();
+ exit(0);
+ break;
case MODE_HELP:
- (void) printf("Sudo version %s\n", version);
- if (sudo_mode == MODE_VERSION)
- exit(0);
- else
- usage(0);
+ usage(0);
break;
case MODE_VALIDATE:
user_cmnd = "validate";
char *estrdup __P((const char *));
void easprintf __P((char **, const char *, ...));
void evasprintf __P((char **, const char *, va_list));
+void print_version __P((void));
YY_DECL;
/* Only provide extern declarations outside of sudo.c. */