mirror of
https://github.com/sudo-project/sudo.git
synced 2025-09-02 07:15:27 +00:00
Add support for tuples in def_data.in; these are implemented as an
enum type. Currently there is only a single tuple enum but in the future we may have one tuple enum per T_TUPLE entry in def_data.in. Currently listpw, verifypw and lecture are tuples. This avoids the need to have two entries (one ival, one str) for pwflags and syslog values. lecture is now a tuple with the following values: never, once, always We no longer use both an int and string entry for syslog facilities and priorities. Instead, there are logfac2str() and logpri2str() functions that get used when we need to print the string values.
This commit is contained in:
@@ -116,7 +116,7 @@ mysyslog(pri, fmt, va_alist)
|
||||
va_start(ap);
|
||||
#endif
|
||||
#ifdef LOG_NFACILITIES
|
||||
openlog("sudo", 0, def_syslog_ifac);
|
||||
openlog("sudo", 0, def_syslog);
|
||||
#else
|
||||
openlog("sudo", 0);
|
||||
#endif
|
||||
@@ -299,9 +299,9 @@ log_auth(status, inform_user)
|
||||
int pri;
|
||||
|
||||
if (status & VALIDATE_OK)
|
||||
pri = def_syslog_igoodpri;
|
||||
pri = def_syslog_goodpri;
|
||||
else
|
||||
pri = def_syslog_ibadpri;
|
||||
pri = def_syslog_badpri;
|
||||
|
||||
/* Set error message, if any. */
|
||||
if (status & VALIDATE_OK)
|
||||
@@ -424,7 +424,7 @@ log_error(va_alist)
|
||||
* Log to syslog and/or a file.
|
||||
*/
|
||||
if (def_syslog)
|
||||
do_syslog(def_syslog_ibadpri, logline);
|
||||
do_syslog(def_syslog_badpri, logline);
|
||||
if (def_logfile)
|
||||
do_logfile(logline);
|
||||
|
||||
|
Reference in New Issue
Block a user