2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-22 01:49:11 +00:00

debug_decl and debug_decl_vars now require a semicolon at the end.

This commit is contained in:
Todd C. Miller 2019-12-22 08:48:16 -07:00
parent 5dcc28180e
commit 486ee2b71f
140 changed files with 1038 additions and 1038 deletions

View File

@ -105,17 +105,17 @@ struct sudo_conf_debug_file_list;
#ifdef HAVE___FUNC__
# define debug_decl_func(funcname)
# define debug_decl_vars(funcname, subsys) \
const int sudo_debug_subsys = (subsys);
const int sudo_debug_subsys = (subsys)
#else
# define debug_decl_func(funcname) \
const char __func__[] = #funcname;
# define debug_decl_vars(funcname, subsys) \
const int sudo_debug_subsys = (subsys); \
debug_decl_func(funcname);
debug_decl_func(funcname) \
const int sudo_debug_subsys = (subsys)
#endif
#define debug_decl(funcname, subsys) \
debug_decl_vars((funcname), (subsys)) \
sudo_debug_enter(__func__, __FILE__, __LINE__, sudo_debug_subsys);
debug_decl_vars((funcname), (subsys)); \
sudo_debug_enter(__func__, __FILE__, __LINE__, sudo_debug_subsys)
/*
* Wrappers for sudo_debug_exit() and friends.

View File

@ -76,7 +76,7 @@ io_swapids(bool restore)
#ifdef HAVE_SETEUID
static uid_t user_euid = (uid_t)-1;
static gid_t user_egid = (gid_t)-1;
debug_decl(io_swapids, SUDO_DEBUG_UTIL)
debug_decl(io_swapids, SUDO_DEBUG_UTIL);
if (user_euid == (uid_t)-1)
user_euid = geteuid();
@ -129,7 +129,7 @@ iolog_mkdirs(char *path)
struct stat sb;
int dfd;
bool ok = false, uid_changed = false;
debug_decl(iolog_mkdirs, SUDO_DEBUG_UTIL)
debug_decl(iolog_mkdirs, SUDO_DEBUG_UTIL);
if ((dfd = open(path, O_RDONLY|O_NONBLOCK)) != -1)
ok = true;
@ -220,7 +220,7 @@ bool
iolog_mkdtemp(char *path)
{
bool ok, uid_changed = false;
debug_decl(iolog_mkdtemp, SUDO_DEBUG_UTIL)
debug_decl(iolog_mkdtemp, SUDO_DEBUG_UTIL);
ok = sudo_mkdir_parents(path, iolog_uid, iolog_gid, iolog_dirmode, true);
if (!ok && errno == EACCES) {
@ -261,7 +261,7 @@ bool
iolog_rename(const char *from, const char *to)
{
bool ok, uid_changed = false;
debug_decl(iolog_rename, SUDO_DEBUG_UTIL)
debug_decl(iolog_rename, SUDO_DEBUG_UTIL);
ok = rename(from, to) == 0;
if (!ok && errno == EACCES) {
@ -299,7 +299,7 @@ iolog_set_defaults(void)
void
iolog_set_maxseq(unsigned int newval)
{
debug_decl(iolog_set_maxseq, SUDO_DEBUG_UTIL)
debug_decl(iolog_set_maxseq, SUDO_DEBUG_UTIL);
/* Clamp to SESSID_MAX as documented. */
if (newval > SESSID_MAX)
@ -315,7 +315,7 @@ iolog_set_maxseq(unsigned int newval)
void
iolog_set_owner(uid_t uid, gid_t gid)
{
debug_decl(iolog_set_owner, SUDO_DEBUG_UTIL)
debug_decl(iolog_set_owner, SUDO_DEBUG_UTIL);
iolog_uid = uid;
if (!iolog_gid_set)
@ -330,7 +330,7 @@ iolog_set_owner(uid_t uid, gid_t gid)
void
iolog_set_gid(gid_t gid)
{
debug_decl(iolog_set_gid, SUDO_DEBUG_UTIL)
debug_decl(iolog_set_gid, SUDO_DEBUG_UTIL);
iolog_gid = gid;
iolog_gid_set = true;
@ -344,7 +344,7 @@ iolog_set_gid(gid_t gid)
void
iolog_set_mode(mode_t mode)
{
debug_decl(iolog_set_mode, SUDO_DEBUG_UTIL)
debug_decl(iolog_set_mode, SUDO_DEBUG_UTIL);
/* I/O log files must be readable and writable by owner. */
iolog_filemode = S_IRUSR|S_IWUSR;
@ -368,7 +368,7 @@ iolog_set_mode(mode_t mode)
void
iolog_set_compress(bool newval)
{
debug_decl(iolog_set_compress, SUDO_DEBUG_UTIL)
debug_decl(iolog_set_compress, SUDO_DEBUG_UTIL);
iolog_compress = newval;
debug_return;
}
@ -379,7 +379,7 @@ iolog_set_compress(bool newval)
void
iolog_set_flush(bool newval)
{
debug_decl(iolog_set_flush, SUDO_DEBUG_UTIL)
debug_decl(iolog_set_flush, SUDO_DEBUG_UTIL);
iolog_flush = newval;
debug_return;
}
@ -393,7 +393,7 @@ iolog_openat(int dfd, const char *path, int flags)
{
int fd;
mode_t omask = S_IRWXG|S_IRWXO;
debug_decl(iolog_openat, SUDO_DEBUG_UTIL)
debug_decl(iolog_openat, SUDO_DEBUG_UTIL);
if (ISSET(flags, O_CREAT)) {
/* umask must not be more restrictive than the file modes. */
@ -433,7 +433,7 @@ iolog_nextid(char *iolog_dir, char sessid[7])
bool ret = false;
char pathbuf[PATH_MAX];
static const char b36char[] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
debug_decl(iolog_nextid, SUDO_DEBUG_UTIL)
debug_decl(iolog_nextid, SUDO_DEBUG_UTIL);
/*
* Create I/O log directory if it doesn't already exist.
@ -525,7 +525,7 @@ iolog_mkpath(char *path)
{
size_t len;
bool ret;
debug_decl(iolog_mkpath, SUDO_DEBUG_UTIL)
debug_decl(iolog_mkpath, SUDO_DEBUG_UTIL);
/*
* Create path and intermediate subdirs as needed.
@ -553,7 +553,7 @@ iolog_open(struct iolog_file *iol, int dfd, int iofd, const char *mode)
int flags;
const char *file;
unsigned char magic[2];
debug_decl(iolog_open, SUDO_DEBUG_UTIL)
debug_decl(iolog_open, SUDO_DEBUG_UTIL);
if (mode[0] == 'r') {
flags = mode[1] == '+' ? O_RDWR : O_RDONLY;
@ -634,7 +634,7 @@ bool
iolog_close(struct iolog_file *iol, const char **errstr)
{
bool ret = true;
debug_decl(iolog_close, SUDO_DEBUG_UTIL)
debug_decl(iolog_close, SUDO_DEBUG_UTIL);
#ifdef HAVE_ZLIB_H
if (iol->compressed) {
@ -661,7 +661,7 @@ off_t
iolog_seek(struct iolog_file *iol, off_t offset, int whence)
{
off_t ret;
//debug_decl(iolog_seek, SUDO_DEBUG_UTIL)
//debug_decl(iolog_seek, SUDO_DEBUG_UTIL);
#ifdef HAVE_ZLIB_H
if (iol->compressed)
@ -684,7 +684,7 @@ iolog_seek(struct iolog_file *iol, off_t offset, int whence)
void
iolog_rewind(struct iolog_file *iol)
{
debug_decl(iolog_rewind, SUDO_DEBUG_UTIL)
debug_decl(iolog_rewind, SUDO_DEBUG_UTIL);
#ifdef HAVE_ZLIB_H
if (iol->compressed)
@ -704,7 +704,7 @@ iolog_read(struct iolog_file *iol, void *buf, size_t nbytes,
const char **errstr)
{
ssize_t nread;
debug_decl(iolog_read, SUDO_DEBUG_UTIL)
debug_decl(iolog_read, SUDO_DEBUG_UTIL);
if (nbytes > UINT_MAX) {
errno = EINVAL;
@ -740,7 +740,7 @@ iolog_write(struct iolog_file *iol, const void *buf, size_t len,
const char **errstr)
{
ssize_t ret;
debug_decl(iolog_write, SUDO_DEBUG_UTIL)
debug_decl(iolog_write, SUDO_DEBUG_UTIL);
if (len > UINT_MAX) {
errno = EINVAL;
@ -797,7 +797,7 @@ bool
iolog_eof(struct iolog_file *iol)
{
bool ret;
debug_decl(iolog_eof, SUDO_DEBUG_UTIL)
debug_decl(iolog_eof, SUDO_DEBUG_UTIL);
#ifdef HAVE_ZLIB_H
if (iol->compressed)
@ -816,7 +816,7 @@ iolog_gets(struct iolog_file *iol, char *buf, size_t nbytes,
const char **errstr)
{
char *str;
debug_decl(iolog_gets, SUDO_DEBUG_UTIL)
debug_decl(iolog_gets, SUDO_DEBUG_UTIL);
if (nbytes > UINT_MAX) {
errno = EINVAL;
@ -853,7 +853,7 @@ iolog_write_info_file(int dfd, const char *parent, struct iolog_info *log_info,
char * const *av;
FILE *fp;
int error, fd;
debug_decl(iolog_info_write_log, SUDO_DEBUG_UTIL)
debug_decl(iolog_info_write_log, SUDO_DEBUG_UTIL);
fd = iolog_openat(dfd, "log", O_CREAT|O_TRUNC|O_WRONLY);
if (fd == -1 || (fp = fdopen(fd, "w")) == NULL) {
@ -900,7 +900,7 @@ const char *
iolog_fd_to_name(int iofd)
{
const char *ret;
debug_decl(iolog_fd_to_name, SUDO_DEBUG_UTIL)
debug_decl(iolog_fd_to_name, SUDO_DEBUG_UTIL);
switch (iofd) {
case IOFD_STDIN:

View File

@ -62,7 +62,7 @@ expand_iolog_path(const char *inpath, char *path, size_t pathlen,
const char *endbrace, *src;
bool strfit = false;
size_t len;
debug_decl(expand_iolog_path, SUDO_DEBUG_UTIL)
debug_decl(expand_iolog_path, SUDO_DEBUG_UTIL);
/* Collapse multiple leading slashes. */
while (inpath[0] == '/' && inpath[1] == '/')

View File

@ -67,7 +67,7 @@ iolog_parse_loginfo(FILE *fp, const char *logfile)
const char *errstr;
size_t bufsize = 0, cwdsize = 0, cmdsize = 0;
struct iolog_info *li = NULL;
debug_decl(iolog_parse_loginfo, SUDO_DEBUG_UTIL)
debug_decl(iolog_parse_loginfo, SUDO_DEBUG_UTIL);
/*
* Info file has three lines:
@ -181,7 +181,7 @@ iolog_adjust_delay(struct timespec *delay, struct timespec *max_delay,
double scale_factor)
{
double seconds;
debug_decl(iolog_adjust_delay, SUDO_DEBUG_UTIL)
debug_decl(iolog_adjust_delay, SUDO_DEBUG_UTIL);
if (scale_factor != 1.0) {
/* Order is important: we don't want to double the remainder. */
@ -219,7 +219,7 @@ iolog_parse_delay(const char *cp, struct timespec *delay,
const char *errstr, *ep;
long long llval;
size_t len;
debug_decl(iolog_parse_delay, SUDO_DEBUG_UTIL)
debug_decl(iolog_parse_delay, SUDO_DEBUG_UTIL);
/* Parse seconds (whole number portion). */
for (ep = cp; isdigit((unsigned char)*ep); ep++)
@ -300,7 +300,7 @@ iolog_parse_timing(const char *line, struct timing_closure *timing)
{
unsigned long ulval;
char *cp, *ep;
debug_decl(iolog_parse_timing, SUDO_DEBUG_UTIL)
debug_decl(iolog_parse_timing, SUDO_DEBUG_UTIL);
/* Clear iolog descriptor. */
timing->iol = NULL;
@ -372,7 +372,7 @@ iolog_read_timing_record(struct iolog_file *iol, struct timing_closure *timing)
{
char line[LINE_MAX];
const char *errstr;
debug_decl(iolog_read_timing_record, SUDO_DEBUG_UTIL)
debug_decl(iolog_read_timing_record, SUDO_DEBUG_UTIL);
/* Read next record from timing file. */
if (iolog_gets(iol, line, sizeof(line), &errstr) == NULL) {

View File

@ -73,7 +73,7 @@ static struct aix_limit aix_limits[] = {
static int
aix_getlimit(char *user, char *lim, int *valp)
{
debug_decl(aix_getlimit, SUDO_DEBUG_UTIL)
debug_decl(aix_getlimit, SUDO_DEBUG_UTIL);
if (getuserattr(user, lim, valp, SEC_INT) != 0)
debug_return_int(-1);
@ -86,7 +86,7 @@ aix_setlimits(char *user)
struct rlimit64 rlim;
int val;
size_t n;
debug_decl(aix_setlimits, SUDO_DEBUG_UTIL)
debug_decl(aix_setlimits, SUDO_DEBUG_UTIL);
if (setuserdb(S_READ) != 0) {
sudo_warn(U_("unable to open userdb"));
@ -162,7 +162,7 @@ aix_getauthregistry_v1(char *user, char *saved_registry)
{
int serrno = errno;
int ret = -1;
debug_decl(aix_getauthregistry, SUDO_DEBUG_UTIL)
debug_decl(aix_getauthregistry, SUDO_DEBUG_UTIL);
saved_registry[0] = '\0';
if (user != NULL) {
@ -213,7 +213,7 @@ aix_setauthdb_v2(char *user, char *registry)
authdb_t regbuf;
int serrno = errno;
int ret = -1;
debug_decl(aix_setauthdb, SUDO_DEBUG_UTIL)
debug_decl(aix_setauthdb, SUDO_DEBUG_UTIL);
if (user != NULL) {
/* Look up authentication registry if one is not provided. */
@ -246,7 +246,7 @@ aix_restoreauthdb_v1(void)
{
int serrno = errno;
int ret = 0;
debug_decl(aix_setauthdb, SUDO_DEBUG_UTIL)
debug_decl(aix_setauthdb, SUDO_DEBUG_UTIL);
if (setauthdb(old_registry, NULL) != 0) {
sudo_warn(U_("unable to restore registry"));
@ -266,7 +266,7 @@ aix_prep_user_v1(char *user, const char *tty)
{
char *info;
int len;
debug_decl(aix_setauthdb, SUDO_DEBUG_UTIL)
debug_decl(aix_setauthdb, SUDO_DEBUG_UTIL);
/* set usrinfo, like login(1) does */
len = asprintf(&info, "NAME=%s%cLOGIN=%s%cLOGNAME=%s%cTTY=%s%c",

View File

@ -96,7 +96,7 @@ struct sudo_digest {
struct sudo_digest *
sudo_digest_alloc_v1(int digest_type)
{
debug_decl(sudo_digest_alloc, SUDO_DEBUG_UTIL)
debug_decl(sudo_digest_alloc, SUDO_DEBUG_UTIL);
struct digest_function *func = NULL;
struct sudo_digest *dig;
int i;
@ -123,7 +123,7 @@ sudo_digest_alloc_v1(int digest_type)
void
sudo_digest_free_v1(struct sudo_digest *dig)
{
debug_decl(sudo_digest_free, SUDO_DEBUG_UTIL)
debug_decl(sudo_digest_free, SUDO_DEBUG_UTIL);
free(dig);
@ -133,7 +133,7 @@ sudo_digest_free_v1(struct sudo_digest *dig)
void
sudo_digest_reset_v1(struct sudo_digest *dig)
{
debug_decl(sudo_digest_reset, SUDO_DEBUG_UTIL)
debug_decl(sudo_digest_reset, SUDO_DEBUG_UTIL);
dig->func->init(&dig->ctx);
@ -143,7 +143,7 @@ sudo_digest_reset_v1(struct sudo_digest *dig)
int
sudo_digest_getlen_v1(int digest_type)
{
debug_decl(sudo_digest_getlen, SUDO_DEBUG_UTIL)
debug_decl(sudo_digest_getlen, SUDO_DEBUG_UTIL);
int i;
for (i = 0; digest_functions[i].digest_len != 0; i++) {
@ -157,7 +157,7 @@ sudo_digest_getlen_v1(int digest_type)
void
sudo_digest_update_v1(struct sudo_digest *dig, const void *data, size_t len)
{
debug_decl(sudo_digest_update, SUDO_DEBUG_UTIL)
debug_decl(sudo_digest_update, SUDO_DEBUG_UTIL);
dig->func->update(&dig->ctx, data, len);
@ -167,7 +167,7 @@ sudo_digest_update_v1(struct sudo_digest *dig, const void *data, size_t len)
void
sudo_digest_final_v1(struct sudo_digest *dig, unsigned char *md)
{
debug_decl(sudo_digest_final, SUDO_DEBUG_UTIL)
debug_decl(sudo_digest_final, SUDO_DEBUG_UTIL);
dig->func->final(md, &dig->ctx);

View File

@ -70,7 +70,7 @@ sudo_digest_type_to_gcry(int digest_type)
struct sudo_digest *
sudo_digest_alloc_v1(int digest_type)
{
debug_decl(sudo_digest_alloc, SUDO_DEBUG_UTIL)
debug_decl(sudo_digest_alloc, SUDO_DEBUG_UTIL);
struct sudo_digest *dig;
int gcry_digest_type;
@ -96,7 +96,7 @@ sudo_digest_alloc_v1(int digest_type)
void
sudo_digest_free_v1(struct sudo_digest *dig)
{
debug_decl(sudo_digest_free, SUDO_DEBUG_UTIL)
debug_decl(sudo_digest_free, SUDO_DEBUG_UTIL);
if (dig != NULL) {
gcry_md_close(dig->ctx);
@ -109,7 +109,7 @@ sudo_digest_free_v1(struct sudo_digest *dig)
void
sudo_digest_reset_v1(struct sudo_digest *dig)
{
debug_decl(sudo_digest_reset, SUDO_DEBUG_UTIL)
debug_decl(sudo_digest_reset, SUDO_DEBUG_UTIL);
gcry_md_reset(dig->ctx);
@ -119,7 +119,7 @@ sudo_digest_reset_v1(struct sudo_digest *dig)
int
sudo_digest_getlen_v1(int digest_type)
{
debug_decl(sudo_digest_getlen, SUDO_DEBUG_UTIL)
debug_decl(sudo_digest_getlen, SUDO_DEBUG_UTIL);
int gcry_digest_type;
gcry_digest_type = sudo_digest_type_to_gcry(digest_type);
@ -132,7 +132,7 @@ sudo_digest_getlen_v1(int digest_type)
void
sudo_digest_update_v1(struct sudo_digest *dig, const void *data, size_t len)
{
debug_decl(sudo_digest_update, SUDO_DEBUG_UTIL)
debug_decl(sudo_digest_update, SUDO_DEBUG_UTIL);
gcry_md_write(dig->ctx, data, len);
@ -142,7 +142,7 @@ sudo_digest_update_v1(struct sudo_digest *dig, const void *data, size_t len)
void
sudo_digest_final_v1(struct sudo_digest *dig, unsigned char *md)
{
debug_decl(sudo_digest_final, SUDO_DEBUG_UTIL)
debug_decl(sudo_digest_final, SUDO_DEBUG_UTIL);
gcry_md_final(dig->ctx);
memcpy(md, gcry_md_read(dig->ctx, 0), dig->digest_len);

View File

@ -87,7 +87,7 @@ struct sudo_digest {
struct sudo_digest *
sudo_digest_alloc_v1(int digest_type)
{
debug_decl(sudo_digest_alloc, SUDO_DEBUG_UTIL)
debug_decl(sudo_digest_alloc, SUDO_DEBUG_UTIL);
struct digest_function *func = NULL;
struct sudo_digest *dig;
int i;
@ -114,7 +114,7 @@ sudo_digest_alloc_v1(int digest_type)
void
sudo_digest_free_v1(struct sudo_digest *dig)
{
debug_decl(sudo_digest_free, SUDO_DEBUG_UTIL)
debug_decl(sudo_digest_free, SUDO_DEBUG_UTIL);
free(dig);
@ -124,7 +124,7 @@ sudo_digest_free_v1(struct sudo_digest *dig)
void
sudo_digest_reset_v1(struct sudo_digest *dig)
{
debug_decl(sudo_digest_reset, SUDO_DEBUG_UTIL)
debug_decl(sudo_digest_reset, SUDO_DEBUG_UTIL);
dig->func->init(&dig->ctx);
@ -133,7 +133,7 @@ sudo_digest_reset_v1(struct sudo_digest *dig)
int
sudo_digest_getlen_v1(int digest_type)
{
debug_decl(sudo_digest_getlen, SUDO_DEBUG_UTIL)
debug_decl(sudo_digest_getlen, SUDO_DEBUG_UTIL);
int i;
for (i = 0; digest_functions[i].digest_len != 0; i++) {
@ -147,7 +147,7 @@ sudo_digest_getlen_v1(int digest_type)
void
sudo_digest_update_v1(struct sudo_digest *dig, const void *data, size_t len)
{
debug_decl(sudo_digest_update, SUDO_DEBUG_UTIL)
debug_decl(sudo_digest_update, SUDO_DEBUG_UTIL);
dig->func->update(&dig->ctx, data, len);
@ -157,7 +157,7 @@ sudo_digest_update_v1(struct sudo_digest *dig, const void *data, size_t len)
void
sudo_digest_final_v1(struct sudo_digest *dig, unsigned char *md)
{
debug_decl(sudo_digest_final, SUDO_DEBUG_UTIL)
debug_decl(sudo_digest_final, SUDO_DEBUG_UTIL);
dig->func->final(md, &dig->ctx);

View File

@ -86,7 +86,7 @@ static void
sudo_ev_deactivate_all(struct sudo_event_base *base)
{
struct sudo_event *ev;
debug_decl(sudo_ev_deactivate_all, SUDO_DEBUG_EVENT)
debug_decl(sudo_ev_deactivate_all, SUDO_DEBUG_EVENT);
while ((ev = TAILQ_FIRST(&base->active)) != NULL)
sudo_ev_deactivate(base, ev);
@ -104,7 +104,7 @@ sudo_ev_activate_sigevents(struct sudo_event_base *base)
struct sudo_event *ev;
sigset_t set, oset;
int i;
debug_decl(sudo_ev_activate_sigevents, SUDO_DEBUG_EVENT)
debug_decl(sudo_ev_activate_sigevents, SUDO_DEBUG_EVENT);
/*
* We treat this as a critical section since the signal handler
@ -148,7 +148,7 @@ signal_pipe_cb(int fd, int what, void *v)
struct sudo_event_base *base = v;
unsigned char ch;
ssize_t nread;
debug_decl(signal_pipe_cb, SUDO_DEBUG_EVENT)
debug_decl(signal_pipe_cb, SUDO_DEBUG_EVENT);
/*
* Drain signal_pipe, the signal handler updated base->signals_pending.
@ -174,7 +174,7 @@ static int
sudo_ev_base_init(struct sudo_event_base *base)
{
int i;
debug_decl(sudo_ev_base_init, SUDO_DEBUG_EVENT)
debug_decl(sudo_ev_base_init, SUDO_DEBUG_EVENT);
TAILQ_INIT(&base->events);
TAILQ_INIT(&base->timeouts);
@ -204,7 +204,7 @@ struct sudo_event_base *
sudo_ev_base_alloc_v1(void)
{
struct sudo_event_base *base;
debug_decl(sudo_ev_base_alloc, SUDO_DEBUG_EVENT)
debug_decl(sudo_ev_base_alloc, SUDO_DEBUG_EVENT);
base = calloc(1, sizeof(*base));
if (base == NULL) {
@ -224,7 +224,7 @@ sudo_ev_base_free_v1(struct sudo_event_base *base)
{
struct sudo_event *ev, *next;
int i;
debug_decl(sudo_ev_base_free, SUDO_DEBUG_EVENT)
debug_decl(sudo_ev_base_free, SUDO_DEBUG_EVENT);
if (base == NULL)
debug_return;
@ -257,7 +257,7 @@ sudo_ev_base_free_v1(struct sudo_event_base *base)
void
sudo_ev_base_setdef_v1(struct sudo_event_base *base)
{
debug_decl(sudo_ev_base_setdef, SUDO_DEBUG_EVENT)
debug_decl(sudo_ev_base_setdef, SUDO_DEBUG_EVENT);
default_base = base;
@ -271,7 +271,7 @@ static void
sudo_ev_init(struct sudo_event *ev, int fd, short events,
sudo_ev_callback_t callback, void *closure)
{
debug_decl(sudo_ev_init, SUDO_DEBUG_EVENT)
debug_decl(sudo_ev_init, SUDO_DEBUG_EVENT);
/* XXX - sanity check events value */
memset(ev, 0, sizeof(*ev));
@ -292,7 +292,7 @@ int
sudo_ev_set_v1(struct sudo_event *ev, int fd, short events,
sudo_ev_callback_t callback, void *closure)
{
debug_decl(sudo_ev_set, SUDO_DEBUG_EVENT)
debug_decl(sudo_ev_set, SUDO_DEBUG_EVENT);
/* For SUDO_EV_SIGINFO we use a container to store closure + siginfo_t */
if (ISSET(events, SUDO_EV_SIGINFO)) {
@ -315,7 +315,7 @@ struct sudo_event *
sudo_ev_alloc_v1(int fd, short events, sudo_ev_callback_t callback, void *closure)
{
struct sudo_event *ev;
debug_decl(sudo_ev_alloc, SUDO_DEBUG_EVENT)
debug_decl(sudo_ev_alloc, SUDO_DEBUG_EVENT);
ev = malloc(sizeof(*ev));
if (ev == NULL) {
@ -333,7 +333,7 @@ sudo_ev_alloc_v1(int fd, short events, sudo_ev_callback_t callback, void *closur
void
sudo_ev_free_v1(struct sudo_event *ev)
{
debug_decl(sudo_ev_free, SUDO_DEBUG_EVENT)
debug_decl(sudo_ev_free, SUDO_DEBUG_EVENT);
if (ev == NULL)
debug_return;
@ -376,7 +376,7 @@ sudo_ev_add_signal(struct sudo_event_base *base, struct sudo_event *ev,
bool tohead)
{
const int signo = ev->fd;
debug_decl(sudo_ev_add_signal, SUDO_DEBUG_EVENT)
debug_decl(sudo_ev_add_signal, SUDO_DEBUG_EVENT);
sudo_debug_printf(SUDO_DEBUG_INFO,
"%s: adding event %p to base %p, signal %d, events %d",
@ -471,7 +471,7 @@ int
sudo_ev_add_v2(struct sudo_event_base *base, struct sudo_event *ev,
struct timespec *timo, bool tohead)
{
debug_decl(sudo_ev_add, SUDO_DEBUG_EVENT)
debug_decl(sudo_ev_add, SUDO_DEBUG_EVENT);
/* If no base specified, use existing or default base. */
if (base == NULL) {
@ -547,7 +547,7 @@ sudo_ev_add_v2(struct sudo_event_base *base, struct sudo_event *ev,
int
sudo_ev_del_v1(struct sudo_event_base *base, struct sudo_event *ev)
{
debug_decl(sudo_ev_del, SUDO_DEBUG_EVENT)
debug_decl(sudo_ev_del, SUDO_DEBUG_EVENT);
/* Make sure event is really in the queue. */
if (!ISSET(ev->flags, SUDO_EVQ_INSERTED)) {
@ -638,7 +638,7 @@ sudo_ev_loop_v1(struct sudo_event_base *base, int flags)
struct timespec now;
struct sudo_event *ev;
int nready, rc = 0;
debug_decl(sudo_ev_loop, SUDO_DEBUG_EVENT)
debug_decl(sudo_ev_loop, SUDO_DEBUG_EVENT);
/*
* If sudo_ev_loopexit() was called when events were not running
@ -742,7 +742,7 @@ done:
void
sudo_ev_loopexit_v1(struct sudo_event_base *base)
{
debug_decl(sudo_ev_loopexit, SUDO_DEBUG_EVENT)
debug_decl(sudo_ev_loopexit, SUDO_DEBUG_EVENT);
if (base == NULL) {
if ((base = default_base) == NULL)
@ -761,7 +761,7 @@ sudo_ev_loopexit_v1(struct sudo_event_base *base)
void
sudo_ev_loopbreak_v1(struct sudo_event_base *base)
{
debug_decl(sudo_ev_loopbreak, SUDO_DEBUG_EVENT)
debug_decl(sudo_ev_loopbreak, SUDO_DEBUG_EVENT);
if (base == NULL) {
if ((base = default_base) == NULL)
@ -777,7 +777,7 @@ sudo_ev_loopbreak_v1(struct sudo_event_base *base)
void
sudo_ev_loopcontinue_v1(struct sudo_event_base *base)
{
debug_decl(sudo_ev_loopcontinue, SUDO_DEBUG_EVENT)
debug_decl(sudo_ev_loopcontinue, SUDO_DEBUG_EVENT);
if (base == NULL) {
if ((base = default_base) == NULL)
@ -794,7 +794,7 @@ sudo_ev_loopcontinue_v1(struct sudo_event_base *base)
bool
sudo_ev_got_exit_v1(struct sudo_event_base *base)
{
debug_decl(sudo_ev_got_exit, SUDO_DEBUG_EVENT)
debug_decl(sudo_ev_got_exit, SUDO_DEBUG_EVENT);
if (base == NULL) {
if ((base = default_base) == NULL)
@ -806,7 +806,7 @@ sudo_ev_got_exit_v1(struct sudo_event_base *base)
bool
sudo_ev_got_break_v1(struct sudo_event_base *base)
{
debug_decl(sudo_ev_got_break, SUDO_DEBUG_EVENT)
debug_decl(sudo_ev_got_break, SUDO_DEBUG_EVENT);
if (base == NULL) {
if ((base = default_base) == NULL)
@ -830,7 +830,7 @@ sudo_ev_get_timeleft_v1(struct sudo_event *ev, struct timeval *tv)
int
sudo_ev_get_timeleft_v2(struct sudo_event *ev, struct timespec *ts)
{
debug_decl(sudo_ev_get_timeleft, SUDO_DEBUG_EVENT)
debug_decl(sudo_ev_get_timeleft, SUDO_DEBUG_EVENT);
if (sudo_ev_pending_v1(ev, SUDO_EV_TIMEOUT, ts) != SUDO_EV_TIMEOUT) {
sudo_timespecclear(ts);
@ -843,7 +843,7 @@ int
sudo_ev_pending_v1(struct sudo_event *ev, short events, struct timespec *ts)
{
int ret = 0;
debug_decl(sudo_ev_pending, SUDO_DEBUG_EVENT)
debug_decl(sudo_ev_pending, SUDO_DEBUG_EVENT);
if (!ISSET(ev->flags, SUDO_EVQ_INSERTED))
debug_return_int(0);

View File

@ -52,7 +52,7 @@ int
sudo_ev_base_alloc_impl(struct sudo_event_base *base)
{
int i;
debug_decl(sudo_ev_base_alloc_impl, SUDO_DEBUG_EVENT)
debug_decl(sudo_ev_base_alloc_impl, SUDO_DEBUG_EVENT);
base->pfd_high = -1;
base->pfd_max = 32;
@ -73,7 +73,7 @@ sudo_ev_base_alloc_impl(struct sudo_event_base *base)
void
sudo_ev_base_free_impl(struct sudo_event_base *base)
{
debug_decl(sudo_ev_base_free_impl, SUDO_DEBUG_EVENT)
debug_decl(sudo_ev_base_free_impl, SUDO_DEBUG_EVENT);
free(base->pfds);
debug_return;
}
@ -82,7 +82,7 @@ int
sudo_ev_add_impl(struct sudo_event_base *base, struct sudo_event *ev)
{
struct pollfd *pfd;
debug_decl(sudo_ev_add_impl, SUDO_DEBUG_EVENT)
debug_decl(sudo_ev_add_impl, SUDO_DEBUG_EVENT);
/* If out of space in pfds array, realloc. */
if (base->pfd_free == base->pfd_max) {
@ -129,7 +129,7 @@ sudo_ev_add_impl(struct sudo_event_base *base, struct sudo_event *ev)
int
sudo_ev_del_impl(struct sudo_event_base *base, struct sudo_event *ev)
{
debug_decl(sudo_ev_del_impl, SUDO_DEBUG_EVENT)
debug_decl(sudo_ev_del_impl, SUDO_DEBUG_EVENT);
/* Mark pfd entry unused, add to free list and adjust high slot. */
base->pfds[ev->pfd_idx].fd = -1;
@ -164,7 +164,7 @@ sudo_ev_scan_impl(struct sudo_event_base *base, int flags)
struct timespec now, ts, *timeout;
struct sudo_event *ev;
int nready;
debug_decl(sudo_ev_scan_impl, SUDO_DEBUG_EVENT)
debug_decl(sudo_ev_scan_impl, SUDO_DEBUG_EVENT);
if ((ev = TAILQ_FIRST(&base->timeouts)) != NULL) {
sudo_gettime_mono(&now);

View File

@ -57,7 +57,7 @@
int
sudo_ev_base_alloc_impl(struct sudo_event_base *base)
{
debug_decl(sudo_ev_base_alloc_impl, SUDO_DEBUG_EVENT)
debug_decl(sudo_ev_base_alloc_impl, SUDO_DEBUG_EVENT);
base->maxfd = NFDBITS - 1;
base->readfds_in = calloc(1, sizeof(fd_mask));
@ -78,7 +78,7 @@ sudo_ev_base_alloc_impl(struct sudo_event_base *base)
void
sudo_ev_base_free_impl(struct sudo_event_base *base)
{
debug_decl(sudo_ev_base_free_impl, SUDO_DEBUG_EVENT)
debug_decl(sudo_ev_base_free_impl, SUDO_DEBUG_EVENT);
free(base->readfds_in);
free(base->writefds_in);
free(base->readfds_out);
@ -89,7 +89,7 @@ sudo_ev_base_free_impl(struct sudo_event_base *base)
int
sudo_ev_add_impl(struct sudo_event_base *base, struct sudo_event *ev)
{
debug_decl(sudo_ev_add_impl, SUDO_DEBUG_EVENT)
debug_decl(sudo_ev_add_impl, SUDO_DEBUG_EVENT);
/* If out of space in fd sets, realloc. */
if (ev->fd > base->maxfd) {
@ -149,7 +149,7 @@ sudo_ev_add_impl(struct sudo_event_base *base, struct sudo_event *ev)
int
sudo_ev_del_impl(struct sudo_event_base *base, struct sudo_event *ev)
{
debug_decl(sudo_ev_del_impl, SUDO_DEBUG_EVENT)
debug_decl(sudo_ev_del_impl, SUDO_DEBUG_EVENT);
/* Remove from readfds and writefds and adjust high fd. */
if (ISSET(ev->events, SUDO_EV_READ)) {
@ -204,7 +204,7 @@ sudo_ev_scan_impl(struct sudo_event_base *base, int flags)
struct sudo_event *ev;
size_t setsize;
int nready;
debug_decl(sudo_ev_loop, SUDO_DEBUG_EVENT)
debug_decl(sudo_ev_loop, SUDO_DEBUG_EVENT);
if ((ev = TAILQ_FIRST(&base->timeouts)) != NULL) {
sudo_gettime_mono(&now);

View File

@ -68,7 +68,7 @@
int
sudo_gettime_real_v1(struct timespec *ts)
{
debug_decl(sudo_gettime_real, SUDO_DEBUG_UTIL)
debug_decl(sudo_gettime_real, SUDO_DEBUG_UTIL);
if (clock_gettime(CLOCK_REALTIME, ts) == -1) {
struct timeval tv;
@ -86,7 +86,7 @@ int
sudo_gettime_real_v1(struct timespec *ts)
{
struct timeval tv;
debug_decl(sudo_gettime_real, SUDO_DEBUG_UTIL)
debug_decl(sudo_gettime_real, SUDO_DEBUG_UTIL);
if (gettimeofday(&tv, NULL) == -1)
debug_return_int(-1);
@ -104,7 +104,7 @@ int
sudo_gettime_mono_v1(struct timespec *ts)
{
static int has_monoclock = -1;
debug_decl(sudo_gettime_mono, SUDO_DEBUG_UTIL)
debug_decl(sudo_gettime_mono, SUDO_DEBUG_UTIL);
/* Check whether the kernel/libc actually supports a monotonic clock. */
# ifdef _SC_MONOTONIC_CLOCK
@ -127,7 +127,7 @@ int
sudo_gettime_mono_v1(struct timespec *ts)
{
hrtime_t nsec;
debug_decl(sudo_gettime_mono, SUDO_DEBUG_UTIL)
debug_decl(sudo_gettime_mono, SUDO_DEBUG_UTIL);
nsec = gethrtime();
ts->tv_sec = nsec / 1000000000;
@ -140,7 +140,7 @@ sudo_gettime_mono_v1(struct timespec *ts)
{
uint64_t abstime, nsec;
static mach_timebase_info_data_t timebase_info;
debug_decl(sudo_gettime_mono, SUDO_DEBUG_UTIL)
debug_decl(sudo_gettime_mono, SUDO_DEBUG_UTIL);
if (timebase_info.denom == 0)
(void) mach_timebase_info(&timebase_info);
@ -172,7 +172,7 @@ int
sudo_gettime_awake_v1(struct timespec *ts)
{
static int has_monoclock = -1;
debug_decl(sudo_gettime_awake, SUDO_DEBUG_UTIL)
debug_decl(sudo_gettime_awake, SUDO_DEBUG_UTIL);
/* Check whether the kernel/libc actually supports a monotonic clock. */
# ifdef _SC_MONOTONIC_CLOCK
@ -195,7 +195,7 @@ int
sudo_gettime_awake_v1(struct timespec *ts)
{
hrtime_t nsec;
debug_decl(sudo_gettime_awake, SUDO_DEBUG_UTIL)
debug_decl(sudo_gettime_awake, SUDO_DEBUG_UTIL);
/* Currently the same as sudo_gettime_mono() */
nsec = gethrtime();
@ -209,7 +209,7 @@ sudo_gettime_awake_v1(struct timespec *ts)
{
uint64_t abstime, nsec;
static mach_timebase_info_data_t timebase_info;
debug_decl(sudo_gettime_awake, SUDO_DEBUG_UTIL)
debug_decl(sudo_gettime_awake, SUDO_DEBUG_UTIL);
if (timebase_info.denom == 0)
(void) mach_timebase_info(&timebase_info);

View File

@ -58,7 +58,7 @@ read_shells(void)
size_t linesize = 0;
char *line = NULL;
FILE *fp;
debug_decl(read_shells, SUDO_DEBUG_UTIL)
debug_decl(read_shells, SUDO_DEBUG_UTIL);
if ((fp = fopen("/etc/shells", "r")) == NULL)
goto bad;
@ -101,7 +101,7 @@ bad:
void
sudo_setusershell(void)
{
debug_decl(setusershell, SUDO_DEBUG_UTIL)
debug_decl(setusershell, SUDO_DEBUG_UTIL);
current_shell = read_shells();
@ -111,7 +111,7 @@ sudo_setusershell(void)
void
sudo_endusershell(void)
{
debug_decl(endusershell, SUDO_DEBUG_UTIL)
debug_decl(endusershell, SUDO_DEBUG_UTIL);
if (allowed_shells != NULL) {
char **shell;
@ -129,7 +129,7 @@ sudo_endusershell(void)
char *
sudo_getusershell(void)
{
debug_decl(getusershell, SUDO_DEBUG_UTIL)
debug_decl(getusershell, SUDO_DEBUG_UTIL);
if (current_shell == NULL)
current_shell = read_shells();

View File

@ -51,7 +51,7 @@ sudo_parse_gids_v1(const char *gidstr, const gid_t *basegid, GETGROUPS_T **gidsp
const char *cp = gidstr;
const char *errstr;
char *ep;
debug_decl(sudo_parse_gids, SUDO_DEBUG_UTIL)
debug_decl(sudo_parse_gids, SUDO_DEBUG_UTIL);
/* Count groups. */
if (*cp != '\0') {

View File

@ -42,7 +42,7 @@ sudo_parse_host_port_v1(char *str, char **hostp, char **portp, char *defport)
{
char *port, *host = str;
bool ret = false;
debug_decl(sudo_parse_host_port, SUDO_DEBUG_UTIL)
debug_decl(sudo_parse_host_port, SUDO_DEBUG_UTIL);
/* Check for IPv6 address like [::0] followed by optional port */
if (*host == '[') {

View File

@ -48,7 +48,7 @@ sudo_new_key_val_v1(const char *key, const char *val)
size_t key_len = strlen(key);
size_t val_len = strlen(val);
char *cp, *str;
debug_decl(sudo_new_key_val, SUDO_DEBUG_UTIL)
debug_decl(sudo_new_key_val, SUDO_DEBUG_UTIL);
cp = str = malloc(key_len + 1 + val_len + 1);
if (cp != NULL) {

View File

@ -43,7 +43,7 @@ void
sudo_lbuf_init_v1(struct sudo_lbuf *lbuf, sudo_lbuf_output_t output,
int indent, const char *continuation, int cols)
{
debug_decl(sudo_lbuf_init, SUDO_DEBUG_UTIL)
debug_decl(sudo_lbuf_init, SUDO_DEBUG_UTIL);
lbuf->output = output;
lbuf->continuation = continuation;
@ -60,7 +60,7 @@ sudo_lbuf_init_v1(struct sudo_lbuf *lbuf, sudo_lbuf_output_t output,
void
sudo_lbuf_destroy_v1(struct sudo_lbuf *lbuf)
{
debug_decl(sudo_lbuf_destroy, SUDO_DEBUG_UTIL)
debug_decl(sudo_lbuf_destroy, SUDO_DEBUG_UTIL);
free(lbuf->buf);
lbuf->buf = NULL;
@ -71,7 +71,7 @@ sudo_lbuf_destroy_v1(struct sudo_lbuf *lbuf)
static bool
sudo_lbuf_expand(struct sudo_lbuf *lbuf, int extra)
{
debug_decl(sudo_lbuf_expand, SUDO_DEBUG_UTIL)
debug_decl(sudo_lbuf_expand, SUDO_DEBUG_UTIL);
if (lbuf->len + extra + 1 >= lbuf->size) {
char *new_buf;
@ -103,7 +103,7 @@ sudo_lbuf_append_quoted_v1(struct sudo_lbuf *lbuf, const char *set, const char *
bool ret = false;
char *cp, *s;
va_list ap;
debug_decl(sudo_lbuf_append_quoted, SUDO_DEBUG_UTIL)
debug_decl(sudo_lbuf_append_quoted, SUDO_DEBUG_UTIL);
if (sudo_lbuf_error(lbuf))
debug_return_bool(false);
@ -161,7 +161,7 @@ sudo_lbuf_append_v1(struct sudo_lbuf *lbuf, const char *fmt, ...)
bool ret = false;
va_list ap;
char *s;
debug_decl(sudo_lbuf_append, SUDO_DEBUG_UTIL)
debug_decl(sudo_lbuf_append, SUDO_DEBUG_UTIL);
if (sudo_lbuf_error(lbuf))
debug_return_bool(false);
@ -203,7 +203,7 @@ sudo_lbuf_println(struct sudo_lbuf *lbuf, char *line, int len)
int i, have, contlen = 0;
int indent = lbuf->indent;
bool is_comment = false;
debug_decl(sudo_lbuf_println, SUDO_DEBUG_UTIL)
debug_decl(sudo_lbuf_println, SUDO_DEBUG_UTIL);
/* Comment lines don't use continuation and only indent is for "# " */
if (line[0] == '#' && isblank((unsigned char)line[1])) {
@ -276,7 +276,7 @@ sudo_lbuf_print_v1(struct sudo_lbuf *lbuf)
{
char *cp, *ep;
int len;
debug_decl(sudo_lbuf_print, SUDO_DEBUG_UTIL)
debug_decl(sudo_lbuf_print, SUDO_DEBUG_UTIL);
if (lbuf->buf == NULL || lbuf->len == 0)
goto done;

View File

@ -64,7 +64,7 @@ bool
sudo_lock_region_v1(int fd, int type, off_t len)
{
int op;
debug_decl(sudo_lock_region, SUDO_DEBUG_UTIL)
debug_decl(sudo_lock_region, SUDO_DEBUG_UTIL);
switch (type) {
case SUDO_LOCK:
@ -94,7 +94,7 @@ sudo_lock_region_v1(int fd, int type, off_t len)
{
struct flock lock;
int func;
debug_decl(sudo_lock_file, SUDO_DEBUG_UTIL)
debug_decl(sudo_lock_file, SUDO_DEBUG_UTIL);
switch (type) {
case SUDO_LOCK:

View File

@ -68,7 +68,7 @@ bool
sudo_str2logfac_v1(const char *str, int *logfac)
{
const struct strmap *fac;
debug_decl(sudo_str2logfac, SUDO_DEBUG_UTIL)
debug_decl(sudo_str2logfac, SUDO_DEBUG_UTIL);
for (fac = facilities; fac->name != NULL; fac++) {
if (strcmp(str, fac->name) == 0) {
@ -83,7 +83,7 @@ const char *
sudo_logfac2str_v1(int num)
{
const struct strmap *fac;
debug_decl(sudo_logfac2str, SUDO_DEBUG_UTIL)
debug_decl(sudo_logfac2str, SUDO_DEBUG_UTIL);
for (fac = facilities; fac->name != NULL; fac++) {
if (fac->num == num)

View File

@ -63,7 +63,7 @@ bool
sudo_str2logpri_v1(const char *str, int *logpri)
{
const struct strmap *pri;
debug_decl(sudo_str2logpri, SUDO_DEBUG_UTIL)
debug_decl(sudo_str2logpri, SUDO_DEBUG_UTIL);
for (pri = priorities; pri->name != NULL; pri++) {
if (strcmp(str, pri->name) == 0) {
@ -78,7 +78,7 @@ const char *
sudo_logpri2str_v1(int num)
{
const struct strmap *pri;
debug_decl(sudo_logpri2str, SUDO_DEBUG_UTIL)
debug_decl(sudo_logpri2str, SUDO_DEBUG_UTIL);
for (pri = priorities; pri->name != NULL; pri++) {
if (pri->num == num)

View File

@ -60,7 +60,7 @@ bool
sudo_mkdir_parents_v1(char *path, uid_t uid, gid_t gid, mode_t mode, bool quiet)
{
char *slash = path;
debug_decl(sudo_mkdir_parents, SUDO_DEBUG_UTIL)
debug_decl(sudo_mkdir_parents, SUDO_DEBUG_UTIL);
/* cppcheck-suppress nullPointerRedundantCheck */
while ((slash = strchr(slash + 1, '/')) != NULL) {

View File

@ -58,7 +58,7 @@ sudo_parseln_v2(char **bufp, size_t *bufsizep, unsigned int *lineno, FILE *fp, i
ssize_t len;
char *cp, *line = NULL;
bool continued, comment;
debug_decl(sudo_parseln, SUDO_DEBUG_UTIL)
debug_decl(sudo_parseln, SUDO_DEBUG_UTIL);
do {
comment = false;

View File

@ -47,7 +47,7 @@ sudo_secure_path(const char *path, unsigned int type, uid_t uid, gid_t gid, stru
{
struct stat sb;
int ret = SUDO_PATH_MISSING;
debug_decl(sudo_secure_path, SUDO_DEBUG_UTIL)
debug_decl(sudo_secure_path, SUDO_DEBUG_UTIL);
if (path != NULL && stat(path, &sb) == 0) {
if ((sb.st_mode & _S_IFMT) != type) {

View File

@ -39,7 +39,7 @@ int
sudo_setgroups_v1(int ngids, const GETGROUPS_T *gids)
{
int maxgids, ret;
debug_decl(sudo_setgroups, SUDO_DEBUG_UTIL)
debug_decl(sudo_setgroups, SUDO_DEBUG_UTIL);
ret = setgroups(ngids, (GETGROUPS_T *)gids);
if (ret == -1 && errno == EINVAL) {

View File

@ -42,7 +42,7 @@ const char *
sudo_strsplit_v1(const char *str, const char *endstr, const char *sep, const char **last)
{
const char *cp, *s;
debug_decl(sudo_strsplit, SUDO_DEBUG_UTIL)
debug_decl(sudo_strsplit, SUDO_DEBUG_UTIL);
/* If no str specified, use last ptr (if any). */
if (str == NULL)

View File

@ -41,7 +41,7 @@
int
sudo_strtobool_v1(const char *str)
{
debug_decl(sudo_strtobool, SUDO_DEBUG_UTIL)
debug_decl(sudo_strtobool, SUDO_DEBUG_UTIL);
switch (*str) {
case '0':

View File

@ -84,7 +84,7 @@ sudo_strtoidx_v1(const char *p, const char *sep, char **endp, const char **errst
const char *errstr;
char *ep;
id_t ret;
debug_decl(sudo_strtoid, SUDO_DEBUG_UTIL)
debug_decl(sudo_strtoid, SUDO_DEBUG_UTIL);
ret = sudo_strtonumx(p, INT_MIN, UINT_MAX, &ep, &errstr);
if (errstr == NULL) {

View File

@ -47,7 +47,7 @@ sudo_strtomode_v1(const char *cp, const char **errstr)
{
char *ep;
long lval;
debug_decl(sudo_strtomode, SUDO_DEBUG_UTIL)
debug_decl(sudo_strtomode, SUDO_DEBUG_UTIL);
errno = 0;
lval = strtol(cp, &ep, 8);

View File

@ -139,7 +139,7 @@ parse_variable(const char *entry, const char *conf_file, unsigned int lineno)
{
struct sudo_conf_table *var;
int ret;
debug_decl(parse_variable, SUDO_DEBUG_UTIL)
debug_decl(parse_variable, SUDO_DEBUG_UTIL);
for (var = sudo_conf_var_table; var->name != NULL; var++) {
if (strncmp(entry, var->name, var->namelen) == 0 &&
@ -170,7 +170,7 @@ parse_path(const char *entry, const char *conf_file, unsigned int lineno)
const char *ep, *name, *path;
struct sudo_conf_path_table *cur;
size_t namelen;
debug_decl(parse_path, SUDO_DEBUG_UTIL)
debug_decl(parse_path, SUDO_DEBUG_UTIL);
/* Parse name. */
name = sudo_strsplit(entry, entry_end, " \t", &ep);
@ -223,7 +223,7 @@ parse_debug(const char *entry, const char *conf_file, unsigned int lineno)
const char *ep, *path, *progname, *flags;
const char *entry_end = entry + strlen(entry);
size_t pathlen, prognamelen;
debug_decl(parse_debug, SUDO_DEBUG_UTIL)
debug_decl(parse_debug, SUDO_DEBUG_UTIL);
/* Parse progname. */
progname = sudo_strsplit(entry, entry_end, " \t", &ep);
@ -295,7 +295,7 @@ parse_plugin(const char *entry, const char *conf_file, unsigned int lineno)
char **options = NULL;
size_t pathlen, symlen;
unsigned int nopts = 0;
debug_decl(parse_plugin, SUDO_DEBUG_UTIL)
debug_decl(parse_plugin, SUDO_DEBUG_UTIL);
/* Parse symbol. */
symbol = sudo_strsplit(entry, entry_end, " \t", &ep);
@ -370,7 +370,7 @@ set_var_developer_mode(const char *strval, const char *conf_file,
unsigned int lineno)
{
int val = sudo_strtobool(strval);
debug_decl(set_var_developer_mode, SUDO_DEBUG_UTIL)
debug_decl(set_var_developer_mode, SUDO_DEBUG_UTIL);
if (val == -1) {
sudo_warnx(U_("invalid value for %s \"%s\" in %s, line %u"),
@ -386,7 +386,7 @@ set_var_disable_coredump(const char *strval, const char *conf_file,
unsigned int lineno)
{
int val = sudo_strtobool(strval);
debug_decl(set_var_disable_coredump, SUDO_DEBUG_UTIL)
debug_decl(set_var_disable_coredump, SUDO_DEBUG_UTIL);
if (val == -1) {
sudo_warnx(U_("invalid value for %s \"%s\" in %s, line %u"),
@ -401,7 +401,7 @@ static int
set_var_group_source(const char *strval, const char *conf_file,
unsigned int lineno)
{
debug_decl(set_var_group_source, SUDO_DEBUG_UTIL)
debug_decl(set_var_group_source, SUDO_DEBUG_UTIL);
if (strcasecmp(strval, "adaptive") == 0) {
sudo_conf_data.group_source = GROUP_SOURCE_ADAPTIVE;
@ -422,7 +422,7 @@ set_var_max_groups(const char *strval, const char *conf_file,
unsigned int lineno)
{
int max_groups;
debug_decl(set_var_max_groups, SUDO_DEBUG_UTIL)
debug_decl(set_var_max_groups, SUDO_DEBUG_UTIL);
max_groups = sudo_strtonum(strval, 1, INT_MAX, NULL);
if (max_groups <= 0) {
@ -439,7 +439,7 @@ set_var_probe_interfaces(const char *strval, const char *conf_file,
unsigned int lineno)
{
int val = sudo_strtobool(strval);
debug_decl(set_var_probe_interfaces, SUDO_DEBUG_UTIL)
debug_decl(set_var_probe_interfaces, SUDO_DEBUG_UTIL);
if (val == -1) {
sudo_warnx(U_("invalid value for %s \"%s\" in %s, line %u"),
@ -511,7 +511,7 @@ sudo_conf_debug_files_v1(const char *progname)
struct sudo_conf_debug *debug_spec;
size_t prognamelen, progbaselen;
const char *progbase = progname;
debug_decl(sudo_conf_debug_files, SUDO_DEBUG_UTIL)
debug_decl(sudo_conf_debug_files, SUDO_DEBUG_UTIL);
/* Determine basename if program is fully qualified (like for plugins). */
prognamelen = progbaselen = strlen(progname);
@ -570,7 +570,7 @@ sudo_conf_read_v1(const char *conf_file, int conf_types)
char *prev_locale, *line = NULL;
unsigned int conf_lineno = 0;
size_t linesize = 0;
debug_decl(sudo_conf_read, SUDO_DEBUG_UTIL)
debug_decl(sudo_conf_read, SUDO_DEBUG_UTIL);
if ((prev_locale = setlocale(LC_ALL, NULL)) == NULL) {
sudo_warn("setlocale(LC_ALL, NULL)");
@ -669,7 +669,7 @@ void
sudo_conf_clear_paths_v1(void)
{
struct sudo_conf_path_table *cur;
debug_decl(sudo_conf_clear_paths, SUDO_DEBUG_UTIL)
debug_decl(sudo_conf_clear_paths, SUDO_DEBUG_UTIL);
for (cur = sudo_conf_data.path_table; cur->pname != NULL; cur++) {
if (cur->dynamic)

View File

@ -147,7 +147,7 @@ tcsetattr_nobg(int fd, int flags, struct termios *tp)
bool
sudo_term_restore_v1(int fd, bool flush)
{
debug_decl(sudo_term_restore, SUDO_DEBUG_UTIL)
debug_decl(sudo_term_restore, SUDO_DEBUG_UTIL);
if (changed) {
const int flags = flush ? (TCSASOFT|TCSAFLUSH) : (TCSASOFT|TCSADRAIN);
@ -165,7 +165,7 @@ sudo_term_restore_v1(int fd, bool flush)
bool
sudo_term_noecho_v1(int fd)
{
debug_decl(sudo_term_noecho, SUDO_DEBUG_UTIL)
debug_decl(sudo_term_noecho, SUDO_DEBUG_UTIL);
if (!changed && tcgetattr(fd, &oterm) != 0)
debug_return_bool(false);
@ -189,7 +189,7 @@ bool
sudo_term_raw_v1(int fd, int isig)
{
struct termios term;
debug_decl(sudo_term_raw, SUDO_DEBUG_UTIL)
debug_decl(sudo_term_raw, SUDO_DEBUG_UTIL);
if (!changed && tcgetattr(fd, &oterm) != 0)
debug_return_bool(false);
@ -212,7 +212,7 @@ sudo_term_raw_v1(int fd, int isig)
bool
sudo_term_cbreak_v1(int fd)
{
debug_decl(sudo_term_cbreak, SUDO_DEBUG_UTIL)
debug_decl(sudo_term_cbreak, SUDO_DEBUG_UTIL);
if (!changed && tcgetattr(fd, &oterm) != 0)
debug_return_bool(false);
@ -256,7 +256,7 @@ sudo_term_copy_v1(int src, int dst)
struct winsize wsize;
speed_t speed;
int i;
debug_decl(sudo_term_copy, SUDO_DEBUG_UTIL)
debug_decl(sudo_term_copy, SUDO_DEBUG_UTIL);
if (tcgetattr(src, &tt_src) != 0 || tcgetattr(dst, &tt_dst) != 0)
debug_return_bool(false);

View File

@ -62,7 +62,7 @@ char *
sudo_ttyname_dev_v1(dev_t tdev, char *name, size_t namelen)
{
char *dev;
debug_decl(sudo_ttyname_dev, SUDO_DEBUG_UTIL)
debug_decl(sudo_ttyname_dev, SUDO_DEBUG_UTIL);
/* Some versions of devname() return NULL on failure, others do not. */
dev = devname(tdev, S_IFCHR);
@ -89,7 +89,7 @@ char *
sudo_ttyname_dev_v1(dev_t tdev, char *name, size_t namelen)
{
int serrno = errno;
debug_decl(sudo_ttyname_dev, SUDO_DEBUG_UTIL)
debug_decl(sudo_ttyname_dev, SUDO_DEBUG_UTIL);
/*
* _ttyname_dev() sets errno to ERANGE if namelen is too small
@ -128,7 +128,7 @@ sudo_ttyname_scan(const char *dir, dev_t rdev, char *name, size_t namelen)
struct stat sb;
unsigned int i;
DIR *d = NULL;
debug_decl(sudo_ttyname_scan, SUDO_DEBUG_UTIL)
debug_decl(sudo_ttyname_scan, SUDO_DEBUG_UTIL);
if (dir[0] == '\0') {
errno = ENOENT;
@ -233,7 +233,7 @@ static char *
sudo_dev_check(dev_t rdev, const char *devname, char *buf, size_t buflen)
{
struct stat sb;
debug_decl(sudo_dev_check, SUDO_DEBUG_UTIL)
debug_decl(sudo_dev_check, SUDO_DEBUG_UTIL);
if (stat(devname, &sb) == 0) {
if (S_ISCHR(sb.st_mode) && sb.st_rdev == rdev) {
@ -265,7 +265,7 @@ sudo_ttyname_dev_v1(dev_t rdev, char *buf, size_t buflen)
char path[PATH_MAX], *ret;
const char *cp, *ep;
size_t len;
debug_decl(sudo_ttyname_dev, SUDO_DEBUG_UTIL)
debug_decl(sudo_ttyname_dev, SUDO_DEBUG_UTIL);
/*
* First, check /dev/console.

View File

@ -39,7 +39,7 @@ static int
get_ttysize_ioctl(int *rowp, int *colp)
{
struct winsize wsize;
debug_decl(get_ttysize_ioctl, SUDO_DEBUG_UTIL)
debug_decl(get_ttysize_ioctl, SUDO_DEBUG_UTIL);
if (ioctl(STDERR_FILENO, TIOCGWINSZ, &wsize) == 0 &&
wsize.ws_row != 0 && wsize.ws_col != 0) {
@ -53,7 +53,7 @@ get_ttysize_ioctl(int *rowp, int *colp)
void
sudo_get_ttysize_v1(int *rowp, int *colp)
{
debug_decl(sudo_get_ttysize, SUDO_DEBUG_UTIL)
debug_decl(sudo_get_ttysize, SUDO_DEBUG_UTIL);
if (get_ttysize_ioctl(rowp, colp) == -1) {
char *p;

View File

@ -85,7 +85,7 @@ new_logline(const char *message, const char *errstr,
const char *tsid = NULL;
size_t len = 0;
int i;
debug_decl(new_logline, SUDO_DEBUG_UTIL)
debug_decl(new_logline, SUDO_DEBUG_UTIL);
/* A TSID may be a sudoers-style session ID or a free-form string. */
if (iolog_file != NULL) {
@ -238,7 +238,7 @@ static void
mysyslog(int pri, const char *fmt, ...)
{
va_list ap;
debug_decl(mysyslog, SUDO_DEBUG_UTIL)
debug_decl(mysyslog, SUDO_DEBUG_UTIL);
openlog("sudo", 0, logsrvd_conf_syslog_facility());
va_start(ap, fmt);
@ -258,7 +258,7 @@ do_syslog(int pri, const struct iolog_details *details, char *msg)
size_t len, maxlen;
char *p, *tmp, save;
const char *fmt;
debug_decl(do_syslog, SUDO_DEBUG_UTIL)
debug_decl(do_syslog, SUDO_DEBUG_UTIL);
/* A priority of -1 corresponds to "none". */
if (pri == -1)
@ -314,7 +314,7 @@ do_logfile(const char *logfile, const struct iolog_details *details,
bool ret = false;
mode_t oldmask;
FILE *fp;
debug_decl(do_logfile, SUDO_DEBUG_UTIL)
debug_decl(do_logfile, SUDO_DEBUG_UTIL);
oldmask = umask(S_IRWXG|S_IRWXO);
fp = fopen(logfile, "a");
@ -361,7 +361,7 @@ log_accept(const struct iolog_details *details)
char *logline;
bool ret = true;
int pri;
debug_decl(log_accept, SUDO_DEBUG_UTIL)
debug_decl(log_accept, SUDO_DEBUG_UTIL);
if (log_type == EVLOG_NONE)
debug_return_bool(true);
@ -395,7 +395,7 @@ log_reject(const struct iolog_details *details, const char *reason)
char *logline;
bool ret = true;
int pri;
debug_decl(log_reject, SUDO_DEBUG_UTIL)
debug_decl(log_reject, SUDO_DEBUG_UTIL);
if (log_type == EVLOG_NONE)
debug_return_bool(true);
@ -430,7 +430,7 @@ log_alert(const struct iolog_details *details, TimeSpec *alert_time,
char *logline;
bool ret = true;
int pri;
debug_decl(log_alert, SUDO_DEBUG_UTIL)
debug_decl(log_alert, SUDO_DEBUG_UTIL);
if (log_type == EVLOG_NONE)
debug_return_bool(true);

View File

@ -73,7 +73,7 @@ strlist_copy(InfoMessage__StringList *strlist)
{
char **dst, **src = strlist->strings;
size_t i, len = strlist->n_strings;
debug_decl(strlist_copy, SUDO_DEBUG_UTIL)
debug_decl(strlist_copy, SUDO_DEBUG_UTIL);
dst = reallocarray(NULL, len + 1, sizeof(char *));
if (dst == NULL) {
@ -107,7 +107,7 @@ void
iolog_details_free(struct iolog_details *details)
{
int i;
debug_decl(iolog_details_free, SUDO_DEBUG_UTIL)
debug_decl(iolog_details_free, SUDO_DEBUG_UTIL);
if (details != NULL) {
free(details->iolog_path);
@ -138,7 +138,7 @@ iolog_details_fill(struct iolog_details *details, TimeSpec *submit_time,
{
size_t idx;
bool ret = false;
debug_decl(iolog_details_fill, SUDO_DEBUG_UTIL)
debug_decl(iolog_details_fill, SUDO_DEBUG_UTIL);
memset(details, 0, sizeof(*details));
@ -383,7 +383,7 @@ fill_seq(char *str, size_t strsize, void *v)
struct iolog_path_closure *closure = v;
char *sessid = closure->details->sessid;
int len;
debug_decl(fill_seq, SUDO_DEBUG_UTIL)
debug_decl(fill_seq, SUDO_DEBUG_UTIL);
if (sessid[0] == '\0') {
if (!iolog_nextid(closure->iolog_dir, sessid))
@ -406,7 +406,7 @@ fill_user(char *str, size_t strsize, void *v)
{
struct iolog_path_closure *closure = v;
const struct iolog_details *details = closure->details;
debug_decl(fill_user, SUDO_DEBUG_UTIL)
debug_decl(fill_user, SUDO_DEBUG_UTIL);
if (details->submituser == NULL) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
@ -421,7 +421,7 @@ fill_group(char *str, size_t strsize, void *v)
{
struct iolog_path_closure *closure = v;
const struct iolog_details *details = closure->details;
debug_decl(fill_group, SUDO_DEBUG_UTIL)
debug_decl(fill_group, SUDO_DEBUG_UTIL);
if (details->submitgroup == NULL) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
@ -436,7 +436,7 @@ fill_runas_user(char *str, size_t strsize, void *v)
{
struct iolog_path_closure *closure = v;
const struct iolog_details *details = closure->details;
debug_decl(fill_runas_user, SUDO_DEBUG_UTIL)
debug_decl(fill_runas_user, SUDO_DEBUG_UTIL);
if (details->runuser == NULL) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
@ -451,7 +451,7 @@ fill_runas_group(char *str, size_t strsize, void *v)
{
struct iolog_path_closure *closure = v;
const struct iolog_details *details = closure->details;
debug_decl(fill_runas_group, SUDO_DEBUG_UTIL)
debug_decl(fill_runas_group, SUDO_DEBUG_UTIL);
/* FIXME: rungroup not guaranteed to be set */
if (details->rungroup == NULL) {
@ -467,7 +467,7 @@ fill_hostname(char *str, size_t strsize, void *v)
{
struct iolog_path_closure *closure = v;
const struct iolog_details *details = closure->details;
debug_decl(fill_hostname, SUDO_DEBUG_UTIL)
debug_decl(fill_hostname, SUDO_DEBUG_UTIL);
if (details->submithost == NULL) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
@ -482,7 +482,7 @@ fill_command(char *str, size_t strsize, void *v)
{
struct iolog_path_closure *closure = v;
const struct iolog_details *details = closure->details;
debug_decl(fill_command, SUDO_DEBUG_UTIL)
debug_decl(fill_command, SUDO_DEBUG_UTIL);
if (details->command == NULL) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
@ -515,7 +515,7 @@ create_iolog_path(struct connection_closure *closure)
struct iolog_path_closure path_closure;
char expanded_dir[PATH_MAX], expanded_file[PATH_MAX], pathbuf[PATH_MAX];
size_t len;
debug_decl(create_iolog_path, SUDO_DEBUG_UTIL)
debug_decl(create_iolog_path, SUDO_DEBUG_UTIL);
path_closure.details = details;
path_closure.iolog_dir = expanded_dir;
@ -583,7 +583,7 @@ iolog_details_write(struct iolog_details *details,
struct connection_closure *closure)
{
struct iolog_info log_info;
debug_decl(iolog_details_write, SUDO_DEBUG_UTIL)
debug_decl(iolog_details_write, SUDO_DEBUG_UTIL);
/* Convert to iolog_info */
memset(&log_info, 0, sizeof(log_info));
@ -603,7 +603,7 @@ iolog_details_write(struct iolog_details *details,
static bool
iolog_create(int iofd, struct connection_closure *closure)
{
debug_decl(iolog_create, SUDO_DEBUG_UTIL)
debug_decl(iolog_create, SUDO_DEBUG_UTIL);
if (iofd < 0 || iofd >= IOFD_MAX) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
@ -621,7 +621,7 @@ iolog_close_all(struct connection_closure *closure)
{
const char *errstr;
int i;
debug_decl(iolog_close, SUDO_DEBUG_UTIL)
debug_decl(iolog_close, SUDO_DEBUG_UTIL);
for (i = 0; i < IOFD_MAX; i++) {
if (!closure->iolog_files[i].enabled)
@ -640,7 +640,7 @@ iolog_close_all(struct connection_closure *closure)
bool
iolog_init(AcceptMessage *msg, struct connection_closure *closure)
{
debug_decl(iolog_init, SUDO_DEBUG_UTIL)
debug_decl(iolog_init, SUDO_DEBUG_UTIL);
/* Create I/O log path */
if (!create_iolog_path(closure))
@ -673,7 +673,7 @@ iolog_copy(struct iolog_file *src, struct iolog_file *dst, off_t remainder,
{
char buf[64 * 1024];
ssize_t nread;
debug_decl(iolog_copy, SUDO_DEBUG_UTIL)
debug_decl(iolog_copy, SUDO_DEBUG_UTIL);
sudo_debug_printf(SUDO_DEBUG_INFO|SUDO_DEBUG_LINENO,
"copying %lld bytes", (long long)remainder);
@ -706,7 +706,7 @@ iolog_rewrite(const struct timespec *target, struct connection_closure *closure)
const char *name, *errstr;
char tmpdir[PATH_MAX];
bool ret = false;
debug_decl(iolog_rewrite, SUDO_DEBUG_UTIL)
debug_decl(iolog_rewrite, SUDO_DEBUG_UTIL);
/* Parse timing file until we reach the target point. */
/* TODO: use iolog_seekto with a callback? */
@ -853,7 +853,7 @@ iolog_restart(RestartMessage *msg, struct connection_closure *closure)
struct timespec target;
struct stat sb;
int iofd;
debug_decl(iolog_restart, SUDO_DEBUG_UTIL)
debug_decl(iolog_restart, SUDO_DEBUG_UTIL);
target.tv_sec = msg->resume_point->tv_sec;
target.tv_nsec = msg->resume_point->tv_nsec;
@ -924,7 +924,7 @@ bad:
static void
update_elapsed_time(TimeSpec *delta, struct timespec *elapsed)
{
debug_decl(update_elapsed_time, SUDO_DEBUG_UTIL)
debug_decl(update_elapsed_time, SUDO_DEBUG_UTIL);
/* Cannot use timespecadd since msg doesn't use struct timespec. */
elapsed->tv_sec += delta->tv_sec;
@ -943,7 +943,7 @@ store_iobuf(int iofd, IoBuffer *msg, struct connection_closure *closure)
const char *errstr;
char tbuf[1024];
int len;
debug_decl(store_iobuf, SUDO_DEBUG_UTIL)
debug_decl(store_iobuf, SUDO_DEBUG_UTIL);
/* Open log file as needed. */
if (!closure->iolog_files[iofd].enabled) {
@ -991,7 +991,7 @@ store_suspend(CommandSuspend *msg, struct connection_closure *closure)
const char *errstr;
char tbuf[1024];
int len;
debug_decl(store_suspend, SUDO_DEBUG_UTIL)
debug_decl(store_suspend, SUDO_DEBUG_UTIL);
/* Format timing data including suspend signal. */
len = snprintf(tbuf, sizeof(tbuf), "%d %lld.%09d %s\n", IO_EVENT_SUSPEND,
@ -1024,7 +1024,7 @@ store_winsize(ChangeWindowSize *msg, struct connection_closure *closure)
const char *errstr;
char tbuf[1024];
int len;
debug_decl(store_winsize, SUDO_DEBUG_UTIL)
debug_decl(store_winsize, SUDO_DEBUG_UTIL);
/* Format timing data including new window size. */
len = snprintf(tbuf, sizeof(tbuf), "%d %lld.%09d %d %d\n", IO_EVENT_WINSIZE,

View File

@ -50,7 +50,7 @@ bool
expand_buf(struct connection_buffer *buf, unsigned int needed)
{
void *newdata;
debug_decl(expand_buf, SUDO_DEBUG_UTIL)
debug_decl(expand_buf, SUDO_DEBUG_UTIL);
if (buf->size < needed) {
/* Expand buffer. */
@ -87,7 +87,7 @@ iolog_open_all(int dfd, const char *iolog_dir, struct iolog_file *iolog_files,
const char *mode)
{
int iofd;
debug_decl(iolog_open_all, SUDO_DEBUG_UTIL)
debug_decl(iolog_open_all, SUDO_DEBUG_UTIL);
for (iofd = 0; iofd < IOFD_MAX; iofd++) {
iolog_files[iofd].enabled = true;
@ -117,7 +117,7 @@ iolog_seekto(int iolog_dir_fd, const char *iolog_path,
{
struct timing_closure timing;
off_t pos;
debug_decl(iolog_seekto, SUDO_DEBUG_UTIL)
debug_decl(iolog_seekto, SUDO_DEBUG_UTIL);
/* Parse timing file until we reach the target point. */
for (;;) {

View File

@ -86,7 +86,7 @@ static double random_drop;
static void
connection_closure_free(struct connection_closure *closure)
{
debug_decl(connection_closure_free, SUDO_DEBUG_UTIL)
debug_decl(connection_closure_free, SUDO_DEBUG_UTIL);
if (closure != NULL) {
bool shutting_down = closure->state == SHUTDOWN;
@ -121,7 +121,7 @@ fmt_server_message(struct connection_buffer *buf, ServerMessage *msg)
uint32_t msg_len;
bool ret = false;
size_t len;
debug_decl(fmt_server_message, SUDO_DEBUG_UTIL)
debug_decl(fmt_server_message, SUDO_DEBUG_UTIL);
if (buf->len != 0) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
@ -165,7 +165,7 @@ fmt_hello_message(struct connection_buffer *buf)
{
ServerMessage msg = SERVER_MESSAGE__INIT;
ServerHello hello = SERVER_HELLO__INIT;
debug_decl(fmt_hello_message, SUDO_DEBUG_UTIL)
debug_decl(fmt_hello_message, SUDO_DEBUG_UTIL);
/* TODO: implement redirect and servers array. */
hello.server_id = (char *)server_id;
@ -186,7 +186,7 @@ static bool
fmt_log_id_message(const char *id, struct connection_buffer *buf)
{
ServerMessage msg = SERVER_MESSAGE__INIT;
debug_decl(fmt_log_id_message, SUDO_DEBUG_UTIL)
debug_decl(fmt_log_id_message, SUDO_DEBUG_UTIL);
msg.log_id = (char *)id;
msg.type_case = SERVER_MESSAGE__TYPE_LOG_ID;
@ -198,7 +198,7 @@ static bool
fmt_error_message(const char *errstr, struct connection_buffer *buf)
{
ServerMessage msg = SERVER_MESSAGE__INIT;
debug_decl(fmt_error_message, SUDO_DEBUG_UTIL)
debug_decl(fmt_error_message, SUDO_DEBUG_UTIL);
msg.error = (char *)errstr;
msg.type_case = SERVER_MESSAGE__TYPE_ERROR;
@ -212,7 +212,7 @@ fmt_error_message(const char *errstr, struct connection_buffer *buf)
static bool
handle_accept(AcceptMessage *msg, struct connection_closure *closure)
{
debug_decl(handle_accept, SUDO_DEBUG_UTIL)
debug_decl(handle_accept, SUDO_DEBUG_UTIL);
if (closure->state != INITIAL) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
@ -279,7 +279,7 @@ handle_accept(AcceptMessage *msg, struct connection_closure *closure)
static bool
handle_reject(RejectMessage *msg, struct connection_closure *closure)
{
debug_decl(handle_reject, SUDO_DEBUG_UTIL)
debug_decl(handle_reject, SUDO_DEBUG_UTIL);
if (closure->state != INITIAL) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
@ -322,7 +322,7 @@ handle_exit(ExitMessage *msg, struct connection_closure *closure)
{
struct timespec tv = { 0, 0 };
mode_t mode;
debug_decl(handle_exit, SUDO_DEBUG_UTIL)
debug_decl(handle_exit, SUDO_DEBUG_UTIL);
if (closure->state != RUNNING) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
@ -371,7 +371,7 @@ handle_exit(ExitMessage *msg, struct connection_closure *closure)
static bool
handle_restart(RestartMessage *msg, struct connection_closure *closure)
{
debug_decl(handle_restart, SUDO_DEBUG_UTIL)
debug_decl(handle_restart, SUDO_DEBUG_UTIL);
if (closure->state != INITIAL) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
@ -405,7 +405,7 @@ handle_restart(RestartMessage *msg, struct connection_closure *closure)
static bool
handle_alert(AlertMessage *msg, struct connection_closure *closure)
{
debug_decl(handle_alert, SUDO_DEBUG_UTIL)
debug_decl(handle_alert, SUDO_DEBUG_UTIL);
if (!log_alert(&closure->details, msg->alert_time, msg->reason)) {
closure->errstr = _("error logging alert event");
@ -418,7 +418,7 @@ handle_alert(AlertMessage *msg, struct connection_closure *closure)
static bool
handle_iobuf(int iofd, IoBuffer *msg, struct connection_closure *closure)
{
debug_decl(handle_iobuf, SUDO_DEBUG_UTIL)
debug_decl(handle_iobuf, SUDO_DEBUG_UTIL);
if (closure->state != RUNNING) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
@ -463,7 +463,7 @@ handle_iobuf(int iofd, IoBuffer *msg, struct connection_closure *closure)
static bool
handle_winsize(ChangeWindowSize *msg, struct connection_closure *closure)
{
debug_decl(handle_winsize, SUDO_DEBUG_UTIL)
debug_decl(handle_winsize, SUDO_DEBUG_UTIL);
if (closure->state != RUNNING) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
@ -489,7 +489,7 @@ handle_winsize(ChangeWindowSize *msg, struct connection_closure *closure)
static bool
handle_suspend(CommandSuspend *msg, struct connection_closure *closure)
{
debug_decl(handle_suspend, SUDO_DEBUG_UTIL)
debug_decl(handle_suspend, SUDO_DEBUG_UTIL);
if (closure->state != RUNNING) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
@ -518,7 +518,7 @@ handle_client_message(uint8_t *buf, size_t len,
{
ClientMessage *msg;
bool ret = false;
debug_decl(handle_client_message, SUDO_DEBUG_UTIL)
debug_decl(handle_client_message, SUDO_DEBUG_UTIL);
msg = client_message__unpack(NULL, len, buf);
if (msg == NULL) {
@ -579,7 +579,7 @@ static void
shutdown_cb(int unused, int what, void *v)
{
struct sudo_event_base *base = v;
debug_decl(shutdown_cb, SUDO_DEBUG_UTIL)
debug_decl(shutdown_cb, SUDO_DEBUG_UTIL);
#if defined(HAVE_OPENSSL)
/* deallocate server's SSL context object */
@ -601,7 +601,7 @@ server_shutdown(struct sudo_event_base *base)
struct connection_closure *closure;
struct sudo_event *ev;
struct timespec tv = { 0, 0 };
debug_decl(server_shutdown, SUDO_DEBUG_UTIL)
debug_decl(server_shutdown, SUDO_DEBUG_UTIL);
if (TAILQ_EMPTY(&connections)) {
sudo_ev_loopbreak(base);
@ -640,7 +640,7 @@ server_msg_cb(int fd, int what, void *v)
struct connection_closure *closure = v;
struct connection_buffer *buf = &closure->write_buf;
ssize_t nwritten;
debug_decl(server_msg_cb, SUDO_DEBUG_UTIL)
debug_decl(server_msg_cb, SUDO_DEBUG_UTIL);
if (what == SUDO_EV_TIMEOUT) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
@ -727,7 +727,7 @@ client_msg_cb(int fd, int what, void *v)
uint32_t msg_len;
ssize_t nread;
debug_decl(client_msg_cb, SUDO_DEBUG_UTIL)
debug_decl(client_msg_cb, SUDO_DEBUG_UTIL);
if (what == SUDO_EV_TIMEOUT) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
@ -850,7 +850,7 @@ server_commit_cb(int unused, int what, void *v)
TimeSpec commit_point = TIME_SPEC__INIT;
struct connection_closure *closure = v;
debug_decl(server_commit_cb, SUDO_DEBUG_UTIL)
debug_decl(server_commit_cb, SUDO_DEBUG_UTIL);
/* Send the client an acknowledgement of what has been committed to disk. */
commit_point.tv_sec = closure->elapsed_time.tv_sec;
@ -887,7 +887,7 @@ static void
signal_cb(int signo, int what, void *v)
{
struct sudo_event_base *base = v;
debug_decl(signal_cb, SUDO_DEBUG_UTIL)
debug_decl(signal_cb, SUDO_DEBUG_UTIL);
switch (signo) {
case SIGHUP:
@ -917,7 +917,7 @@ verify_server_cert(SSL_CTX *ctx, const struct logsrvd_tls_config *tls_config)
X509_STORE *ca_store;
STACK_OF(X509) *chain_certs;
X509 *x509;
debug_decl(verify_server_cert, SUDO_DEBUG_UTIL)
debug_decl(verify_server_cert, SUDO_DEBUG_UTIL);
if ((x509 = SSL_CTX_get0_certificate(ctx)) == NULL) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
@ -967,7 +967,7 @@ exit:
static bool
init_tls_ciphersuites(SSL_CTX *ctx, const struct logsrvd_tls_config *tls_config)
{
debug_decl(init_tls_ciphersuites, SUDO_DEBUG_UTIL)
debug_decl(init_tls_ciphersuites, SUDO_DEBUG_UTIL);
if (tls_config->ciphers_v12) {
/* try to set TLS v1.2 ciphersuite list from config if given */
@ -1034,7 +1034,7 @@ init_tls_server_context(void)
const SSL_METHOD *method;
SSL_CTX *ctx = NULL;
const struct logsrvd_tls_config *tls_config = logsrvd_get_tls_config();
debug_decl(init_tls_server_context, SUDO_DEBUG_UTIL)
debug_decl(init_tls_server_context, SUDO_DEBUG_UTIL);
SSL_library_init();
OpenSSL_add_all_algorithms();
@ -1161,7 +1161,7 @@ tls_handshake_cb(int fd, int what, void *v)
struct connection_closure *closure = v;
struct sudo_event_base *base = closure->ssl_accept_ev->base;
debug_decl(tls_handshake_cb, SUDO_DEBUG_UTIL)
debug_decl(tls_handshake_cb, SUDO_DEBUG_UTIL);
if (what == SUDO_EV_TIMEOUT) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
@ -1216,7 +1216,7 @@ static struct connection_closure *
connection_closure_alloc(int sock)
{
struct connection_closure *closure;
debug_decl(connection_closure_alloc, SUDO_DEBUG_UTIL)
debug_decl(connection_closure_alloc, SUDO_DEBUG_UTIL);
if ((closure = calloc(1, sizeof(*closure))) == NULL)
debug_return_ptr(NULL);
@ -1268,7 +1268,7 @@ new_connection(int sock, struct sudo_event_base *base)
{
struct connection_closure *closure;
debug_decl(new_connection, SUDO_DEBUG_UTIL)
debug_decl(new_connection, SUDO_DEBUG_UTIL);
if ((closure = connection_closure_alloc(sock)) == NULL)
goto bad;
@ -1329,7 +1329,7 @@ static int
create_listener(struct listen_address *addr)
{
int flags, i, sock;
debug_decl(create_listener, SUDO_DEBUG_UTIL)
debug_decl(create_listener, SUDO_DEBUG_UTIL);
if ((sock = socket(addr->sa_un.sa.sa_family, SOCK_STREAM, 0)) == -1) {
sudo_warn("socket");
@ -1366,7 +1366,7 @@ listener_cb(int fd, int what, void *v)
union sockaddr_union s_un;
socklen_t salen = sizeof(s_un);
int sock;
debug_decl(listener_cb, SUDO_DEBUG_UTIL)
debug_decl(listener_cb, SUDO_DEBUG_UTIL);
sock = accept(fd, &s_un.sa, &salen);
if (sock != -1) {
@ -1390,7 +1390,7 @@ register_listener(struct listen_address *addr, struct sudo_event_base *base)
{
struct sudo_event *ev;
int sock;
debug_decl(register_listener, SUDO_DEBUG_UTIL)
debug_decl(register_listener, SUDO_DEBUG_UTIL);
sock = create_listener(addr);
@ -1409,7 +1409,7 @@ static void
register_signal(int signo, struct sudo_event_base *base)
{
struct sudo_event *ev;
debug_decl(register_signal, SUDO_DEBUG_UTIL)
debug_decl(register_signal, SUDO_DEBUG_UTIL);
ev = sudo_ev_alloc(signo, SUDO_EV_SIGNAL, signal_cb, base);
if (ev == NULL)
@ -1434,7 +1434,7 @@ static void
daemonize(bool nofork)
{
int fd;
debug_decl(daemonize, SUDO_DEBUG_UTIL)
debug_decl(daemonize, SUDO_DEBUG_UTIL);
if (!nofork) {
switch (fork()) {
@ -1508,7 +1508,7 @@ main(int argc, char *argv[])
bool nofork = false;
char *ep;
int ch;
debug_decl_vars(main, SUDO_DEBUG_MAIN)
debug_decl_vars(main, SUDO_DEBUG_MAIN);
#if defined(SUDO_DEVEL) && defined(__OpenBSD__)
{

View File

@ -225,7 +225,7 @@ logsrvd_conf_logfile_time_format(void)
static bool
cb_iolog_dir(struct logsrvd_config *config, const char *path)
{
debug_decl(cb_iolog_dir, SUDO_DEBUG_UTIL)
debug_decl(cb_iolog_dir, SUDO_DEBUG_UTIL);
free(config->iolog.iolog_dir);
if ((config->iolog.iolog_dir = strdup(path)) == NULL) {
@ -238,7 +238,7 @@ cb_iolog_dir(struct logsrvd_config *config, const char *path)
static bool
cb_iolog_file(struct logsrvd_config *config, const char *path)
{
debug_decl(cb_iolog_file, SUDO_DEBUG_UTIL)
debug_decl(cb_iolog_file, SUDO_DEBUG_UTIL);
free(config->iolog.iolog_file);
if ((config->iolog.iolog_file = strdup(path)) == NULL) {
@ -252,7 +252,7 @@ static bool
cb_iolog_compress(struct logsrvd_config *config, const char *str)
{
int val;
debug_decl(cb_iolog_compress, SUDO_DEBUG_UTIL)
debug_decl(cb_iolog_compress, SUDO_DEBUG_UTIL);
if ((val = sudo_strtobool(str)) == -1)
debug_return_bool(false);
@ -265,7 +265,7 @@ static bool
cb_iolog_flush(struct logsrvd_config *config, const char *str)
{
int val;
debug_decl(cb_iolog_flush, SUDO_DEBUG_UTIL)
debug_decl(cb_iolog_flush, SUDO_DEBUG_UTIL);
if ((val = sudo_strtobool(str)) == -1)
debug_return_bool(false);
@ -278,7 +278,7 @@ static bool
cb_iolog_user(struct logsrvd_config *config, const char *user)
{
struct passwd *pw;
debug_decl(cb_iolog_user, SUDO_DEBUG_UTIL)
debug_decl(cb_iolog_user, SUDO_DEBUG_UTIL);
if ((pw = getpwnam(user)) == NULL) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
@ -296,7 +296,7 @@ static bool
cb_iolog_group(struct logsrvd_config *config, const char *group)
{
struct group *gr;
debug_decl(cb_iolog_group, SUDO_DEBUG_UTIL)
debug_decl(cb_iolog_group, SUDO_DEBUG_UTIL);
if ((gr = getgrnam(group)) == NULL) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
@ -314,7 +314,7 @@ cb_iolog_mode(struct logsrvd_config *config, const char *str)
{
const char *errstr;
mode_t mode;
debug_decl(cb_iolog_mode, SUDO_DEBUG_UTIL)
debug_decl(cb_iolog_mode, SUDO_DEBUG_UTIL);
mode = sudo_strtomode(str, &errstr);
if (errstr != NULL) {
@ -331,7 +331,7 @@ cb_iolog_maxseq(struct logsrvd_config *config, const char *str)
{
const char *errstr;
unsigned int value;
debug_decl(cb_iolog_maxseq, SUDO_DEBUG_UTIL)
debug_decl(cb_iolog_maxseq, SUDO_DEBUG_UTIL);
value = sudo_strtonum(str, 0, SESSID_MAX, &errstr);
if (errstr != NULL) {
@ -356,7 +356,7 @@ cb_listen_address(struct logsrvd_config *config, const char *str)
char *copy, *host, *port;
bool ret = false;
int error;
debug_decl(cb_iolog_mode, SUDO_DEBUG_UTIL)
debug_decl(cb_iolog_mode, SUDO_DEBUG_UTIL);
if ((copy = strdup(str)) == NULL) {
sudo_warn(NULL);
@ -404,7 +404,7 @@ cb_timeout(struct logsrvd_config *config, const char *str)
{
int timeout;
const char* errstr;
debug_decl(cb_timeout, SUDO_DEBUG_UTIL)
debug_decl(cb_timeout, SUDO_DEBUG_UTIL);
timeout = sudo_strtonum(str, 0, UINT_MAX, &errstr);
if (errstr != NULL)
@ -420,7 +420,7 @@ static bool
cb_tls_opt(struct logsrvd_config *config, const char *str)
{
int val;
debug_decl(cb_tls_opt, SUDO_DEBUG_UTIL)
debug_decl(cb_tls_opt, SUDO_DEBUG_UTIL);
if ((val = sudo_strtobool(str)) == -1)
debug_return_bool(false);
@ -432,7 +432,7 @@ cb_tls_opt(struct logsrvd_config *config, const char *str)
static bool
cb_tls_key(struct logsrvd_config *config, const char *path)
{
debug_decl(cb_tls_key, SUDO_DEBUG_UTIL)
debug_decl(cb_tls_key, SUDO_DEBUG_UTIL);
free(config->server.tls_config.pkey_path);
if ((config->server.tls_config.pkey_path = strdup(path)) == NULL) {
@ -445,7 +445,7 @@ cb_tls_key(struct logsrvd_config *config, const char *path)
static bool
cb_tls_cacert(struct logsrvd_config *config, const char *path)
{
debug_decl(cb_tls_cacert, SUDO_DEBUG_UTIL)
debug_decl(cb_tls_cacert, SUDO_DEBUG_UTIL);
free(config->server.tls_config.cacert_path);
if ((config->server.tls_config.cacert_path = strdup(path)) == NULL) {
@ -458,7 +458,7 @@ cb_tls_cacert(struct logsrvd_config *config, const char *path)
static bool
cb_tls_cert(struct logsrvd_config *config, const char *path)
{
debug_decl(cb_tls_cert, SUDO_DEBUG_UTIL)
debug_decl(cb_tls_cert, SUDO_DEBUG_UTIL);
free(config->server.tls_config.cert_path);
if ((config->server.tls_config.cert_path = strdup(path)) == NULL) {
@ -471,7 +471,7 @@ cb_tls_cert(struct logsrvd_config *config, const char *path)
static bool
cb_tls_dhparam(struct logsrvd_config *config, const char *path)
{
debug_decl(cb_tls_dhparam, SUDO_DEBUG_UTIL)
debug_decl(cb_tls_dhparam, SUDO_DEBUG_UTIL);
free(config->server.tls_config.dhparams_path);
if ((config->server.tls_config.dhparams_path = strdup(path)) == NULL) {
@ -484,7 +484,7 @@ cb_tls_dhparam(struct logsrvd_config *config, const char *path)
static bool
cb_tls_ciphers12(struct logsrvd_config *config, const char *str)
{
debug_decl(cb_tls_ciphers12, SUDO_DEBUG_UTIL)
debug_decl(cb_tls_ciphers12, SUDO_DEBUG_UTIL);
free(config->server.tls_config.ciphers_v12);
if ((config->server.tls_config.ciphers_v12 = strdup(str)) == NULL) {
@ -497,7 +497,7 @@ cb_tls_ciphers12(struct logsrvd_config *config, const char *str)
static bool
cb_tls_ciphers13(struct logsrvd_config *config, const char *str)
{
debug_decl(cb_tls_ciphers13, SUDO_DEBUG_UTIL)
debug_decl(cb_tls_ciphers13, SUDO_DEBUG_UTIL);
free(config->server.tls_config.ciphers_v13);
if ((config->server.tls_config.ciphers_v13 = strdup(str)) == NULL) {
@ -511,7 +511,7 @@ static bool
cb_tls_checkpeer(struct logsrvd_config *config, const char *str)
{
int val;
debug_decl(cb_tls_checkpeer, SUDO_DEBUG_UTIL)
debug_decl(cb_tls_checkpeer, SUDO_DEBUG_UTIL);
if ((val = sudo_strtobool(str)) == -1)
debug_return_bool(false);
@ -525,7 +525,7 @@ cb_tls_checkpeer(struct logsrvd_config *config, const char *str)
static bool
cb_eventlog_type(struct logsrvd_config *config, const char *str)
{
debug_decl(cb_eventlog_type, SUDO_DEBUG_UTIL)
debug_decl(cb_eventlog_type, SUDO_DEBUG_UTIL);
if (strcmp(str, "none") == 0)
config->eventlog.log_type = EVLOG_NONE;
@ -542,7 +542,7 @@ cb_eventlog_type(struct logsrvd_config *config, const char *str)
static bool
cb_eventlog_format(struct logsrvd_config *config, const char *str)
{
debug_decl(cb_eventlog_format, SUDO_DEBUG_UTIL)
debug_decl(cb_eventlog_format, SUDO_DEBUG_UTIL);
if (strcmp(str, "sudo") == 0)
config->eventlog.log_format = EVLOG_SUDO;
@ -558,7 +558,7 @@ cb_syslog_maxlen(struct logsrvd_config *config, const char *str)
{
unsigned int maxlen;
const char *errstr;
debug_decl(cb_syslog_maxlen, SUDO_DEBUG_UTIL)
debug_decl(cb_syslog_maxlen, SUDO_DEBUG_UTIL);
maxlen = sudo_strtonum(str, 1, UINT_MAX, &errstr);
if (errstr != NULL)
@ -573,7 +573,7 @@ static bool
cb_syslog_facility(struct logsrvd_config *config, const char *str)
{
int logfac;
debug_decl(cb_syslog_facility, SUDO_DEBUG_UTIL)
debug_decl(cb_syslog_facility, SUDO_DEBUG_UTIL);
if (!sudo_str2logfac(str, &logfac)) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
@ -590,7 +590,7 @@ static bool
cb_syslog_acceptpri(struct logsrvd_config *config, const char *str)
{
int logpri;
debug_decl(cb_syslog_acceptpri, SUDO_DEBUG_UTIL)
debug_decl(cb_syslog_acceptpri, SUDO_DEBUG_UTIL);
if (!sudo_str2logpri(str, &logpri)) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
@ -607,7 +607,7 @@ static bool
cb_syslog_rejectpri(struct logsrvd_config *config, const char *str)
{
int logpri;
debug_decl(cb_syslog_rejectpri, SUDO_DEBUG_UTIL)
debug_decl(cb_syslog_rejectpri, SUDO_DEBUG_UTIL);
if (!sudo_str2logpri(str, &logpri))
debug_return_bool(false);
@ -621,7 +621,7 @@ static bool
cb_syslog_alertpri(struct logsrvd_config *config, const char *str)
{
int logpri;
debug_decl(cb_syslog_alertpri, SUDO_DEBUG_UTIL)
debug_decl(cb_syslog_alertpri, SUDO_DEBUG_UTIL);
if (!sudo_str2logpri(str, &logpri)) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
@ -639,7 +639,7 @@ static bool
cb_logfile_path(struct logsrvd_config *config, const char *str)
{
char *copy = NULL;
debug_decl(cb_logfile_path, SUDO_DEBUG_UTIL)
debug_decl(cb_logfile_path, SUDO_DEBUG_UTIL);
if (*str != '/') {
debug_return_bool(false);
@ -661,7 +661,7 @@ static bool
cb_logfile_time_format(struct logsrvd_config *config, const char *str)
{
char *copy = NULL;
debug_decl(cb_logfile_time_format, SUDO_DEBUG_UTIL)
debug_decl(cb_logfile_time_format, SUDO_DEBUG_UTIL);
if ((copy = strdup(str)) == NULL) {
sudo_warn(NULL);
@ -740,7 +740,7 @@ logsrvd_conf_parse(struct logsrvd_config *config, FILE *fp, const char *path)
size_t linesize = 0;
char *line = NULL;
bool ret = false;
debug_decl(logsrvd_conf_parse, SUDO_DEBUG_UTIL)
debug_decl(logsrvd_conf_parse, SUDO_DEBUG_UTIL);
while (sudo_parseln(&line, &linesize, &lineno, fp, 0) != -1) {
struct logsrvd_config_entry *entry;
@ -818,7 +818,7 @@ void
logsrvd_conf_free(struct logsrvd_config *config)
{
struct listen_address *addr;
debug_decl(logsrvd_conf_free, SUDO_DEBUG_UTIL)
debug_decl(logsrvd_conf_free, SUDO_DEBUG_UTIL);
if (config == NULL)
debug_return;
@ -847,7 +847,7 @@ struct logsrvd_config *
logsrvd_conf_alloc(void)
{
struct logsrvd_config *config;
debug_decl(logsrvd_conf_alloc, SUDO_DEBUG_UTIL)
debug_decl(logsrvd_conf_alloc, SUDO_DEBUG_UTIL);
if ((config = calloc(1, sizeof(*config))) == NULL) {
sudo_warn(NULL);
@ -914,7 +914,7 @@ bad:
bool
logsrvd_conf_apply(struct logsrvd_config *config)
{
debug_decl(logsrvd_conf_apply, SUDO_DEBUG_UTIL)
debug_decl(logsrvd_conf_apply, SUDO_DEBUG_UTIL);
/* There can be multiple addresses so we can't set a default earlier. */
if (TAILQ_EMPTY(&config->server.addresses)) {
@ -946,7 +946,7 @@ logsrvd_conf_read(const char *path)
struct logsrvd_config *config;
bool ret = false;
FILE *fp = NULL;
debug_decl(logsrvd_conf_read, SUDO_DEBUG_UTIL)
debug_decl(logsrvd_conf_read, SUDO_DEBUG_UTIL);
config = logsrvd_conf_alloc();

View File

@ -124,7 +124,7 @@ init_tls_client_context(const char *ca_bundle_file, const char *cert_file, const
{
const SSL_METHOD *method;
SSL_CTX *ctx = NULL;
debug_decl(init_tls_client_context, SUDO_DEBUG_UTIL)
debug_decl(init_tls_client_context, SUDO_DEBUG_UTIL);
SSL_library_init();
OpenSSL_add_all_algorithms();
@ -185,7 +185,7 @@ tls_connect_cb(int sock, int what, void *v)
struct timespec timeo = { TLS_HANDSHAKE_TIMEO_SEC, 0 };
int con_stat, err;
debug_decl(tls_connect_cb, SUDO_DEBUG_UTIL)
debug_decl(tls_connect_cb, SUDO_DEBUG_UTIL);
if (what == SUDO_EV_TIMEOUT) {
sudo_warnx(U_("TLS handshake timeout occured"));
@ -226,7 +226,7 @@ tls_connect_async(struct client_closure *closure)
{
struct sudo_event_base *evbase = NULL;
debug_decl(tls_connect_async, SUDO_DEBUG_UTIL)
debug_decl(tls_connect_async, SUDO_DEBUG_UTIL);
evbase = sudo_ev_base_alloc();
closure->tls_connect_ev = sudo_ev_alloc(closure->sock, SUDO_EV_WRITE,
@ -255,7 +255,7 @@ done:
static bool
do_tls_handshake(struct client_closure *closure)
{
debug_decl(do_tls_handshake, SUDO_DEBUG_UTIL)
debug_decl(do_tls_handshake, SUDO_DEBUG_UTIL);
if (ca_bundle == NULL) {
sudo_warnx("%s", U_("CA bundle file was not specified"));
@ -305,7 +305,7 @@ connect_server(const char *host, const char *port)
struct addrinfo hints, *res, *res0;
const char *cause = "getaddrinfo";
int error, sock, save_errno;
debug_decl(connect_server, SUDO_DEBUG_UTIL)
debug_decl(connect_server, SUDO_DEBUG_UTIL);
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_UNSPEC;
@ -358,7 +358,7 @@ connect_server(const char *host, const char *port)
static void
client_closure_free(struct client_closure *closure)
{
debug_decl(client_closure_free, SUDO_DEBUG_UTIL)
debug_decl(client_closure_free, SUDO_DEBUG_UTIL);
if (closure != NULL) {
sudo_ev_free(closure->read_ev);
@ -380,7 +380,7 @@ read_io_buf(struct client_closure *closure)
struct timing_closure *timing = &closure->timing;
const char *errstr = NULL;
size_t nread;
debug_decl(read_io_buf, SUDO_DEBUG_UTIL)
debug_decl(read_io_buf, SUDO_DEBUG_UTIL);
if (!iolog_files[timing->event].enabled) {
errno = ENOENT;
@ -419,7 +419,7 @@ fmt_client_message(struct connection_buffer *buf, ClientMessage *msg)
uint32_t msg_len;
bool ret = false;
size_t len;
debug_decl(fmt_client_message, SUDO_DEBUG_UTIL)
debug_decl(fmt_client_message, SUDO_DEBUG_UTIL);
len = client_message__get_packed_size(msg);
if (len > MESSAGE_SIZE_MAX) {
@ -462,7 +462,7 @@ split_command(char *command, size_t *lenp)
char *cp;
char **args;
size_t len;
debug_decl(split_command, SUDO_DEBUG_UTIL)
debug_decl(split_command, SUDO_DEBUG_UTIL);
for (cp = command, len = 0;;) {
len++;
@ -501,7 +501,7 @@ fmt_accept_message(struct client_closure *closure)
char *hostname;
bool ret = false;
size_t n;
debug_decl(fmt_accept_message, SUDO_DEBUG_UTIL)
debug_decl(fmt_accept_message, SUDO_DEBUG_UTIL);
/*
* Fill in AcceptMessage and add it to ClientMessage.
@ -631,7 +631,7 @@ fmt_restart_message(struct client_closure *closure)
RestartMessage restart_msg = RESTART_MESSAGE__INIT;
TimeSpec tv = TIME_SPEC__INIT;
bool ret = false;
debug_decl(fmt_restart_message, SUDO_DEBUG_UTIL)
debug_decl(fmt_restart_message, SUDO_DEBUG_UTIL);
sudo_debug_printf(SUDO_DEBUG_INFO,
"%s: sending RestartMessage, [%lld, %ld]", __func__,
@ -665,7 +665,7 @@ fmt_exit_message(struct client_closure *closure)
ClientMessage client_msg = CLIENT_MESSAGE__INIT;
ExitMessage exit_msg = EXIT_MESSAGE__INIT;
bool ret = false;
debug_decl(fmt_exit_message, SUDO_DEBUG_UTIL)
debug_decl(fmt_exit_message, SUDO_DEBUG_UTIL);
/*
* We don't have enough data in a sudo I/O log to create a real
@ -703,7 +703,7 @@ fmt_io_buf(int type, struct client_closure *closure,
IoBuffer iobuf_msg = IO_BUFFER__INIT;
TimeSpec delay = TIME_SPEC__INIT;
bool ret = false;
debug_decl(fmt_io_buf, SUDO_DEBUG_UTIL)
debug_decl(fmt_io_buf, SUDO_DEBUG_UTIL);
if (!read_io_buf(closure))
goto done;
@ -745,7 +745,7 @@ fmt_winsize(struct client_closure *closure, struct connection_buffer *buf)
TimeSpec delay = TIME_SPEC__INIT;
struct timing_closure *timing = &closure->timing;
bool ret = false;
debug_decl(fmt_winsize, SUDO_DEBUG_UTIL)
debug_decl(fmt_winsize, SUDO_DEBUG_UTIL);
/* Fill in ChangeWindowSize message. */
delay.tv_sec = timing->delay.tv_sec;
@ -782,7 +782,7 @@ fmt_suspend(struct client_closure *closure, struct connection_buffer *buf)
TimeSpec delay = TIME_SPEC__INIT;
struct timing_closure *timing = &closure->timing;
bool ret = false;
debug_decl(fmt_suspend, SUDO_DEBUG_UTIL)
debug_decl(fmt_suspend, SUDO_DEBUG_UTIL);
/* Fill in CommandSuspend message. */
delay.tv_sec = timing->delay.tv_sec;
@ -818,7 +818,7 @@ fmt_next_iolog(struct client_closure *closure)
struct timing_closure *timing = &closure->timing;
struct connection_buffer *buf = &closure->write_buf;
bool ret = false;
debug_decl(fmt_next_iolog, SUDO_DEBUG_UTIL)
debug_decl(fmt_next_iolog, SUDO_DEBUG_UTIL);
if (buf->len != 0) {
sudo_warnx(U_("%s: write buffer already in use"), __func__);
@ -887,7 +887,7 @@ again:
static bool
client_message_completion(struct client_closure *closure)
{
debug_decl(client_message_completion, SUDO_DEBUG_UTIL)
debug_decl(client_message_completion, SUDO_DEBUG_UTIL);
switch (closure->state) {
case SEND_ACCEPT:
@ -919,7 +919,7 @@ static bool
handle_server_hello(ServerHello *msg, struct client_closure *closure)
{
size_t n;
debug_decl(handle_server_hello, SUDO_DEBUG_UTIL)
debug_decl(handle_server_hello, SUDO_DEBUG_UTIL);
if (closure->state != RECV_HELLO) {
sudo_warnx(U_("%s: unexpected state %d"), __func__, closure->state);
@ -960,7 +960,7 @@ handle_server_hello(ServerHello *msg, struct client_closure *closure)
static bool
handle_commit_point(TimeSpec *commit_point, struct client_closure *closure)
{
debug_decl(handle_commit_point, SUDO_DEBUG_UTIL)
debug_decl(handle_commit_point, SUDO_DEBUG_UTIL);
/* Only valid after we have sent an IO buffer. */
if (closure->state < SEND_IO) {
@ -983,7 +983,7 @@ handle_commit_point(TimeSpec *commit_point, struct client_closure *closure)
static bool
handle_log_id(char *id, struct client_closure *closure)
{
debug_decl(handle_log_id, SUDO_DEBUG_UTIL)
debug_decl(handle_log_id, SUDO_DEBUG_UTIL);
printf("remote log ID: %s\n", id);
if ((closure->iolog_id = strdup(id)) == NULL)
@ -998,7 +998,7 @@ handle_log_id(char *id, struct client_closure *closure)
static bool
handle_server_error(char *errmsg, struct client_closure *closure)
{
debug_decl(handle_server_error, SUDO_DEBUG_UTIL)
debug_decl(handle_server_error, SUDO_DEBUG_UTIL);
sudo_warnx(U_("error message received from server: %s"), errmsg);
debug_return_bool(false);
@ -1011,7 +1011,7 @@ handle_server_error(char *errmsg, struct client_closure *closure)
static bool
handle_server_abort(char *errmsg, struct client_closure *closure)
{
debug_decl(handle_server_abort, SUDO_DEBUG_UTIL)
debug_decl(handle_server_abort, SUDO_DEBUG_UTIL);
sudo_warnx(U_("abort message received from server: %s"), errmsg);
debug_return_bool(false);
@ -1027,7 +1027,7 @@ handle_server_message(uint8_t *buf, size_t len,
{
ServerMessage *msg;
bool ret = false;
debug_decl(handle_server_message, SUDO_DEBUG_UTIL)
debug_decl(handle_server_message, SUDO_DEBUG_UTIL);
sudo_debug_printf(SUDO_DEBUG_INFO, "%s: unpacking ServerMessage", __func__);
msg = server_message__unpack(NULL, len, buf);
@ -1095,7 +1095,7 @@ server_msg_cb(int fd, int what, void *v)
struct connection_buffer *buf = &closure->read_buf;
ssize_t nread;
uint32_t msg_len;
debug_decl(server_msg_cb, SUDO_DEBUG_UTIL)
debug_decl(server_msg_cb, SUDO_DEBUG_UTIL);
sudo_debug_printf(SUDO_DEBUG_INFO, "%s: reading ServerMessage", __func__);
@ -1185,7 +1185,7 @@ client_msg_cb(int fd, int what, void *v)
struct client_closure *closure = v;
struct connection_buffer *buf = &closure->write_buf;
ssize_t nwritten;
debug_decl(client_msg_cb, SUDO_DEBUG_UTIL)
debug_decl(client_msg_cb, SUDO_DEBUG_UTIL);
sudo_debug_printf(SUDO_DEBUG_INFO,
"%s: sending %u bytes to server", __func__, buf->len - buf->off);
@ -1247,7 +1247,7 @@ client_closure_fill(struct client_closure *closure, int sock,
struct timespec *elapsed, struct timespec *restart, const char *iolog_id,
struct iolog_info *log_info)
{
debug_decl(client_closure_fill, SUDO_DEBUG_UTIL)
debug_decl(client_closure_fill, SUDO_DEBUG_UTIL);
memset(closure, 0, sizeof(*closure));
@ -1296,7 +1296,7 @@ parse_timespec(struct timespec *ts, const char *strval)
long long tv_sec;
long tv_nsec;
char *ep;
debug_decl(parse_timespec, SUDO_DEBUG_UTIL)
debug_decl(parse_timespec, SUDO_DEBUG_UTIL);
errno = 0;
tv_sec = strtoll(strval, &ep, 10);
@ -1360,7 +1360,7 @@ main(int argc, char *argv[])
const char *open_mode = "r";
int ch, sock, iolog_dir_fd, fd;
FILE *fp;
debug_decl_vars(main, SUDO_DEBUG_MAIN)
debug_decl_vars(main, SUDO_DEBUG_MAIN);
#if defined(SUDO_DEVEL) && defined(__OpenBSD__)
{

View File

@ -188,7 +188,7 @@ python_plugin_register_logging(sudo_conv_t conversation,
sudo_printf_t sudo_printf,
char * const settings[])
{
debug_decl(python_plugin_register_logging, PYTHON_DEBUG_INTERNAL)
debug_decl(python_plugin_register_logging, PYTHON_DEBUG_INTERNAL);
int rc = SUDO_RC_ERROR;
if (py_ctx.sudo_conv == NULL)

View File

@ -139,7 +139,7 @@ python_debug_register(const char *program,
void
python_debug_deregister(void)
{
debug_decl(python_debug_deregister, PYTHON_DEBUG_INTERNAL)
debug_decl(python_debug_deregister, PYTHON_DEBUG_INTERNAL);
if (python_debug_instance != SUDO_DEBUG_INSTANCE_INITIALIZER) {
sudo_debug_exit(__func__, __FILE__, __LINE__, sudo_debug_subsys);

View File

@ -55,7 +55,7 @@ alias_compare(const void *v1, const void *v2)
const struct alias *a1 = (const struct alias *)v1;
const struct alias *a2 = (const struct alias *)v2;
int res;
debug_decl(alias_compare, SUDOERS_DEBUG_ALIAS)
debug_decl(alias_compare, SUDOERS_DEBUG_ALIAS);
if (a1 == NULL)
res = -1;
@ -78,7 +78,7 @@ alias_get(struct sudoers_parse_tree *parse_tree, const char *name, int type)
struct alias key;
struct rbnode *node;
struct alias *a = NULL;
debug_decl(alias_get, SUDOERS_DEBUG_ALIAS)
debug_decl(alias_get, SUDOERS_DEBUG_ALIAS);
if (parse_tree->aliases == NULL)
debug_return_ptr(NULL);
@ -109,7 +109,7 @@ alias_get(struct sudoers_parse_tree *parse_tree, const char *name, int type)
void
alias_put(struct alias *a)
{
debug_decl(alias_put, SUDOERS_DEBUG_ALIAS)
debug_decl(alias_put, SUDOERS_DEBUG_ALIAS);
a->used = false;
debug_return;
}
@ -125,7 +125,7 @@ alias_add(struct sudoers_parse_tree *parse_tree, char *name, int type,
{
static char errbuf[512];
struct alias *a;
debug_decl(alias_add, SUDOERS_DEBUG_ALIAS)
debug_decl(alias_add, SUDOERS_DEBUG_ALIAS);
if (parse_tree->aliases == NULL) {
if ((parse_tree->aliases = alloc_aliases()) == NULL) {
@ -187,7 +187,7 @@ alias_apply(struct sudoers_parse_tree *parse_tree,
void *cookie)
{
struct alias_apply_closure closure;
debug_decl(alias_apply, SUDOERS_DEBUG_ALIAS)
debug_decl(alias_apply, SUDOERS_DEBUG_ALIAS);
if (parse_tree->aliases != NULL) {
closure.parse_tree = parse_tree;
@ -205,7 +205,7 @@ alias_apply(struct sudoers_parse_tree *parse_tree,
bool
no_aliases(struct sudoers_parse_tree *parse_tree)
{
debug_decl(no_aliases, SUDOERS_DEBUG_ALIAS)
debug_decl(no_aliases, SUDOERS_DEBUG_ALIAS);
debug_return_bool(parse_tree->aliases == NULL ||
rbisempty(parse_tree->aliases));
}
@ -217,7 +217,7 @@ void
alias_free(void *v)
{
struct alias *a = (struct alias *)v;
debug_decl(alias_free, SUDOERS_DEBUG_ALIAS)
debug_decl(alias_free, SUDOERS_DEBUG_ALIAS);
if (a != NULL) {
free(a->name);
@ -237,7 +237,7 @@ alias_remove(struct sudoers_parse_tree *parse_tree, char *name, int type)
{
struct rbnode *node;
struct alias key;
debug_decl(alias_remove, SUDOERS_DEBUG_ALIAS)
debug_decl(alias_remove, SUDOERS_DEBUG_ALIAS);
if (parse_tree->aliases != NULL) {
key.name = name;
@ -252,7 +252,7 @@ alias_remove(struct sudoers_parse_tree *parse_tree, char *name, int type)
struct rbtree *
alloc_aliases(void)
{
debug_decl(alloc_aliases, SUDOERS_DEBUG_ALIAS)
debug_decl(alloc_aliases, SUDOERS_DEBUG_ALIAS);
debug_return_ptr(rbcreate(alias_compare));
}
@ -260,7 +260,7 @@ alloc_aliases(void)
void
free_aliases(struct rbtree *aliases)
{
debug_decl(free_aliases, SUDOERS_DEBUG_ALIAS)
debug_decl(free_aliases, SUDOERS_DEBUG_ALIAS);
if (aliases != NULL)
rbdestroy(aliases, alias_free);
@ -287,7 +287,7 @@ alias_remove_recursive(struct sudoers_parse_tree *parse_tree, char *name,
struct member *m;
struct alias *a;
bool ret = true;
debug_decl(alias_remove_recursive, SUDOERS_DEBUG_ALIAS)
debug_decl(alias_remove_recursive, SUDOERS_DEBUG_ALIAS);
if ((a = alias_remove(parse_tree, name, type)) != NULL) {
TAILQ_FOREACH(m, &a->members, entries) {
@ -308,7 +308,7 @@ alias_find_used_members(struct sudoers_parse_tree *parse_tree,
{
struct member *m;
int errors = 0;
debug_decl(alias_find_used_members, SUDOERS_DEBUG_ALIAS)
debug_decl(alias_find_used_members, SUDOERS_DEBUG_ALIAS);
if (members != NULL) {
TAILQ_FOREACH(m, members, entries) {
@ -334,7 +334,7 @@ alias_find_used(struct sudoers_parse_tree *parse_tree, struct rbtree *used_alias
struct defaults *d;
struct member *m;
int errors = 0;
debug_decl(alias_find_used, SUDOERS_DEBUG_ALIAS)
debug_decl(alias_find_used, SUDOERS_DEBUG_ALIAS);
/* Move referenced aliases to used_aliases. */
TAILQ_FOREACH(us, &parse_tree->userspecs, entries) {

View File

@ -43,7 +43,7 @@ int
audit_success(int argc, char *argv[])
{
int rc = 0;
debug_decl(audit_success, SUDOERS_DEBUG_AUDIT)
debug_decl(audit_success, SUDOERS_DEBUG_AUDIT);
if (!def_log_allowed)
debug_return_int(0);
@ -70,7 +70,7 @@ int
audit_failure(int argc, char *argv[], char const *const fmt, ...)
{
int rc = 0;
debug_decl(audit_success, SUDOERS_DEBUG_AUDIT)
debug_decl(audit_success, SUDOERS_DEBUG_AUDIT);
if (!def_log_denied)
debug_return_int(0);

View File

@ -53,7 +53,7 @@ sudo_afs_verify(struct passwd *pw, char *pass, sudo_auth *auth, struct sudo_conv
{
struct ktc_encryptionKey afs_key;
struct ktc_token afs_token;
debug_decl(sudo_afs_verify, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_afs_verify, SUDOERS_DEBUG_AUTH);
/* Try to just check the password */
ka_StringToKey(pass, NULL, &afs_key);

View File

@ -68,7 +68,7 @@ sudo_aix_authtype(void)
bool in_stanza = false;
int authtype = AIX_AUTH_UNKNOWN;
FILE *fp;
debug_decl(sudo_aix_authtype, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_aix_authtype, SUDOERS_DEBUG_AUTH);
if ((fp = fopen("/etc/security/login.cfg", "r")) == NULL)
debug_return_int(AIX_AUTH_UNKNOWN);
@ -136,7 +136,7 @@ sudo_aix_authtype(void)
int
sudo_aix_init(struct passwd *pw, sudo_auth *auth)
{
debug_decl(sudo_aix_init, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_aix_init, SUDOERS_DEBUG_AUTH);
#ifdef HAVE_PAM
/* Check auth_type in /etc/security/login.cfg. */
@ -156,7 +156,7 @@ sudo_aix_valid_message(const char *message)
{
const char *cp;
const char badpass_msgid[] = "3004-300";
debug_decl(sudo_aix_valid_message, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_aix_valid_message, SUDOERS_DEBUG_AUTH);
if (message == NULL || message[0] == '\0')
debug_return_bool(false);
@ -188,7 +188,7 @@ sudo_aix_change_password(const char *user)
bool ret = false;
sigset_t mask;
int status;
debug_decl(sudo_aix_change_password, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_aix_change_password, SUDOERS_DEBUG_AUTH);
/* Set SIGCHLD handler to default since we call waitpid() below. */
memset(&sa, 0, sizeof(sa));
@ -239,7 +239,7 @@ sudo_aix_verify(struct passwd *pw, char *prompt, sudo_auth *auth, struct sudo_co
char *pass, *message = NULL;
int result = 1, reenter = 0;
int ret = AUTH_SUCCESS;
debug_decl(sudo_aix_verify, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_aix_verify, SUDOERS_DEBUG_AUTH);
do {
pass = auth_getpass(prompt, SUDO_CONV_PROMPT_ECHO_OFF, callback);
@ -302,7 +302,7 @@ sudo_aix_verify(struct passwd *pw, char *prompt, sudo_auth *auth, struct sudo_co
int
sudo_aix_cleanup(struct passwd *pw, sudo_auth *auth)
{
debug_decl(sudo_aix_cleanup, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_aix_cleanup, SUDOERS_DEBUG_AUTH);
/* Unset AUTHSTATE as it may not be correct for the runas user. */
if (sudo_unsetenv("AUTHSTATE") == -1)

View File

@ -63,7 +63,7 @@ int
bsdauth_init(struct passwd *pw, sudo_auth *auth)
{
static struct bsdauth_state state;
debug_decl(bsdauth_init, SUDOERS_DEBUG_AUTH)
debug_decl(bsdauth_init, SUDOERS_DEBUG_AUTH);
/* Get login class based on auth user, which may not be invoking user. */
if (pw->pw_class && *pw->pw_class)
@ -113,7 +113,7 @@ bsdauth_verify(struct passwd *pw, char *prompt, sudo_auth *auth, struct sudo_con
int authok = 0;
struct sigaction sa, osa;
auth_session_t *as = ((struct bsdauth_state *) auth->data)->as;
debug_decl(bsdauth_verify, SUDOERS_DEBUG_AUTH)
debug_decl(bsdauth_verify, SUDOERS_DEBUG_AUTH);
/* save old signal handler */
sigemptyset(&sa.sa_mask);
@ -178,7 +178,7 @@ int
bsdauth_approval(struct passwd *pw, sudo_auth *auth, bool exempt)
{
struct bsdauth_state *state = auth->data;
debug_decl(bsdauth_approval, SUDOERS_DEBUG_AUTH)
debug_decl(bsdauth_approval, SUDOERS_DEBUG_AUTH);
if (auth_approval(state->as, state->lc, pw->pw_name, "auth-sudo") == 0) {
if (auth_getstate(state->as) & AUTH_EXPIRED)
@ -194,7 +194,7 @@ int
bsdauth_cleanup(struct passwd *pw, sudo_auth *auth)
{
struct bsdauth_state *state = auth->data;
debug_decl(bsdauth_cleanup, SUDOERS_DEBUG_AUTH)
debug_decl(bsdauth_cleanup, SUDOERS_DEBUG_AUTH);
if (state != NULL) {
auth_close(state->as);

View File

@ -71,7 +71,7 @@ sudo_dce_verify(struct passwd *pw, char *plain_pw, sudo_auth *auth, struct sudo_
boolean32 reset_passwd;
sec_login_auth_src_t auth_src;
error_status_t status;
debug_decl(sudo_dce_verify, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_dce_verify, SUDOERS_DEBUG_AUTH);
/*
* Create the local context of the DCE principal necessary
@ -186,7 +186,7 @@ check_dce_status(error_status_t input_status, char *comment)
{
int error_stat;
unsigned char error_string[dce_c_error_string_len];
debug_decl(check_dce_status, SUDOERS_DEBUG_AUTH)
debug_decl(check_dce_status, SUDOERS_DEBUG_AUTH);
if (input_status == rpc_s_ok)
debug_return_int(0);

View File

@ -53,7 +53,7 @@ sudo_fwtk_init(struct passwd *pw, sudo_auth *auth)
{
static Cfg *confp; /* Configuration entry struct */
char resp[128]; /* Response from the server */
debug_decl(sudo_fwtk_init, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_fwtk_init, SUDOERS_DEBUG_AUTH);
if ((confp = cfg_read("sudo")) == (Cfg *)-1) {
sudo_warnx(U_("unable to read fwtk config"));
@ -85,7 +85,7 @@ sudo_fwtk_verify(struct passwd *pw, char *prompt, sudo_auth *auth, struct sudo_c
char buf[SUDO_CONV_REPL_MAX + 12]; /* General prupose buffer */
char resp[128]; /* Response from the server */
int error;
debug_decl(sudo_fwtk_verify, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_fwtk_verify, SUDOERS_DEBUG_AUTH);
/* Send username to authentication server. */
(void) snprintf(buf, sizeof(buf), "authorize %s 'sudo'", pw->pw_name);
@ -147,7 +147,7 @@ done:
int
sudo_fwtk_cleanup(struct passwd *pw, sudo_auth *auth)
{
debug_decl(sudo_fwtk_cleanup, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_fwtk_cleanup, SUDOERS_DEBUG_AUTH);
auth_close();
debug_return_int(AUTH_SUCCESS);

View File

@ -95,7 +95,7 @@ int
sudo_krb5_setup(struct passwd *pw, char **promptp, sudo_auth *auth)
{
static char *krb5_prompt;
debug_decl(sudo_krb5_init, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_krb5_init, SUDOERS_DEBUG_AUTH);
if (krb5_prompt == NULL) {
krb5_context sudo_context;
@ -138,7 +138,7 @@ sudo_krb5_init(struct passwd *pw, sudo_auth *auth)
krb5_context sudo_context;
krb5_error_code error;
char cache_name[64], *pname = pw->pw_name;
debug_decl(sudo_krb5_init, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_krb5_init, SUDOERS_DEBUG_AUTH);
auth->data = (void *) &sudo_krb5_data; /* Stash all our data here */
@ -190,7 +190,7 @@ sudo_krb5_verify(struct passwd *pw, char *pass, sudo_auth *auth, struct sudo_con
krb5_principal princ;
krb5_ccache ccache;
krb5_error_code error;
debug_decl(sudo_krb5_verify, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_krb5_verify, SUDOERS_DEBUG_AUTH);
sudo_context = ((sudo_krb5_datap) auth->data)->sudo_context;
princ = ((sudo_krb5_datap) auth->data)->princ;
@ -209,7 +209,7 @@ sudo_krb5_verify(struct passwd *pw, char *pass, sudo_auth *auth, struct sudo_con
krb5_ccache ccache;
krb5_error_code error;
krb5_get_init_creds_opt *opts = NULL;
debug_decl(sudo_krb5_verify, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_krb5_verify, SUDOERS_DEBUG_AUTH);
sudo_context = ((sudo_krb5_datap) auth->data)->sudo_context;
princ = ((sudo_krb5_datap) auth->data)->princ;
@ -273,7 +273,7 @@ sudo_krb5_cleanup(struct passwd *pw, sudo_auth *auth)
krb5_context sudo_context;
krb5_principal princ;
krb5_ccache ccache;
debug_decl(sudo_krb5_cleanup, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_krb5_cleanup, SUDOERS_DEBUG_AUTH);
sudo_context = ((sudo_krb5_datap) auth->data)->sudo_context;
princ = ((sudo_krb5_datap) auth->data)->princ;
@ -305,7 +305,7 @@ verify_krb_v5_tgt(krb5_context sudo_context, krb5_creds *cred, char *auth_name)
krb5_error_code error;
krb5_principal server;
krb5_verify_init_creds_opt vopt;
debug_decl(verify_krb_v5_tgt, SUDOERS_DEBUG_AUTH)
debug_decl(verify_krb_v5_tgt, SUDOERS_DEBUG_AUTH);
/*
* Get the server principal for the local host.

View File

@ -103,7 +103,7 @@ static struct conv_filter *conv_filter;
static void
conv_filter_init(void)
{
debug_decl(conv_filter_init, SUDOERS_DEBUG_AUTH)
debug_decl(conv_filter_init, SUDOERS_DEBUG_AUTH);
#ifdef __hpux__
/*
@ -198,7 +198,7 @@ sudo_pam_init2(struct passwd *pw, sudo_auth *auth, bool quiet)
const char *tty = user_ttypath;
const char *errstr, *pam_service;
int rc;
debug_decl(sudo_pam_init, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_pam_init, SUDOERS_DEBUG_AUTH);
/* Stash pointer to last pam status. */
auth->data = &pam_status;
@ -292,7 +292,7 @@ sudo_pam_verify(struct passwd *pw, char *prompt, sudo_auth *auth, struct sudo_co
{
const char *s;
int *pam_status = (int *) auth->data;
debug_decl(sudo_pam_verify, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_pam_verify, SUDOERS_DEBUG_AUTH);
def_prompt = prompt; /* for converse */
getpass_error = false; /* set by converse if user presses ^C */
@ -327,7 +327,7 @@ sudo_pam_approval(struct passwd *pw, sudo_auth *auth, bool exempt)
const char *s;
int rc, status = AUTH_SUCCESS;
int *pam_status = (int *) auth->data;
debug_decl(sudo_pam_approval, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_pam_approval, SUDOERS_DEBUG_AUTH);
if (def_pam_acct_mgmt) {
rc = pam_acct_mgmt(pamh, PAM_SILENT);
@ -394,7 +394,7 @@ int
sudo_pam_cleanup(struct passwd *pw, sudo_auth *auth)
{
int *pam_status = (int *) auth->data;
debug_decl(sudo_pam_cleanup, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_pam_cleanup, SUDOERS_DEBUG_AUTH);
/* If successful, we can't close the session until sudo_pam_end_session() */
if (*pam_status != PAM_SUCCESS || auth->end_session == NULL) {
@ -410,7 +410,7 @@ sudo_pam_begin_session(struct passwd *pw, char **user_envp[], sudo_auth *auth)
int rc, status = AUTH_SUCCESS;
int *pam_status = (int *) auth->data;
const char *errstr;
debug_decl(sudo_pam_begin_session, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_pam_begin_session, SUDOERS_DEBUG_AUTH);
/*
* If there is no valid user we cannot open a PAM session.
@ -522,7 +522,7 @@ sudo_pam_end_session(struct passwd *pw, sudo_auth *auth)
{
int rc, status = AUTH_SUCCESS;
const char *errstr;
debug_decl(sudo_pam_end_session, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_pam_end_session, SUDOERS_DEBUG_AUTH);
if (pamh != NULL) {
/*
@ -595,7 +595,7 @@ static bool
use_pam_prompt(const char *pam_prompt)
{
size_t user_len;
debug_decl(use_pam_prompt, SUDOERS_DEBUG_AUTH)
debug_decl(use_pam_prompt, SUDOERS_DEBUG_AUTH);
/* Always use sudo prompt if passprompt_override is set. */
if (def_passprompt_override)
@ -656,7 +656,7 @@ converse(int num_msg, PAM_CONST struct pam_message **msg,
char *pass;
int n, type;
int ret = PAM_SUCCESS;
debug_decl(converse, SUDOERS_DEBUG_AUTH)
debug_decl(converse, SUDOERS_DEBUG_AUTH);
if (num_msg <= 0 || num_msg > PAM_MAX_NUM_MSG) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,

View File

@ -48,7 +48,7 @@
int
sudo_passwd_init(struct passwd *pw, sudo_auth *auth)
{
debug_decl(sudo_passwd_init, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_passwd_init, SUDOERS_DEBUG_AUTH);
#ifdef HAVE_SKEYACCESS
if (skeyaccess(pw, user_tty, NULL, NULL) == 0)
@ -67,7 +67,7 @@ sudo_passwd_verify(struct passwd *pw, char *pass, sudo_auth *auth, struct sudo_c
char *pw_epasswd = auth->data;
size_t pw_len;
int matched = 0;
debug_decl(sudo_passwd_verify, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_passwd_verify, SUDOERS_DEBUG_AUTH);
/* An empty plain-text password must match an empty encrypted password. */
if (pass[0] == '\0')
@ -103,7 +103,7 @@ int
sudo_passwd_cleanup(struct passwd *pw, sudo_auth *auth)
{
char *pw_epasswd = auth->data;
debug_decl(sudo_passwd_cleanup, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_passwd_cleanup, SUDOERS_DEBUG_AUTH);
if (pw_epasswd != NULL) {
memset_s(pw_epasswd, SUDO_CONV_REPL_MAX, 0, strlen(pw_epasswd));

View File

@ -69,7 +69,7 @@ sudo_rfc1938_setup(struct passwd *pw, char **promptp, sudo_auth *auth)
static char *orig_prompt = NULL, *new_prompt = NULL;
static size_t op_len, np_size;
static struct RFC1938 rfc1938;
debug_decl(sudo_rfc1938_setup, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_rfc1938_setup, SUDOERS_DEBUG_AUTH);
/* Stash a pointer to the rfc1938 struct if we have not initialized */
if (!auth->data)
@ -133,7 +133,7 @@ sudo_rfc1938_setup(struct passwd *pw, char **promptp, sudo_auth *auth)
int
sudo_rfc1938_verify(struct passwd *pw, char *pass, sudo_auth *auth, struct sudo_conv_callback *callback)
{
debug_decl(sudo_rfc1938_verify, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_rfc1938_verify, SUDOERS_DEBUG_AUTH);
if (rfc1938verify((struct RFC1938 *) auth->data, pass) == 0)
debug_return_int(AUTH_SUCCESS);

View File

@ -58,7 +58,7 @@ extern int crypt_type;
int
sudo_secureware_init(struct passwd *pw, sudo_auth *auth)
{
debug_decl(sudo_secureware_init, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_secureware_init, SUDOERS_DEBUG_AUTH);
#ifdef __alpha
if (crypt_type == INT_MAX)
@ -76,7 +76,7 @@ sudo_secureware_verify(struct passwd *pw, char *pass, sudo_auth *auth, struct su
{
char *pw_epasswd = auth->data;
char *epass = NULL;
debug_decl(sudo_secureware_verify, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_secureware_verify, SUDOERS_DEBUG_AUTH);
/* An empty plain-text password must match an empty encrypted password. */
if (pass[0] == '\0')
@ -104,7 +104,7 @@ int
sudo_secureware_cleanup(struct passwd *pw, sudo_auth *auth)
{
char *pw_epasswd = auth->data;
debug_decl(sudo_secureware_cleanup, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_secureware_cleanup, SUDOERS_DEBUG_AUTH);
if (pw_epasswd != NULL) {
memset_s(pw_epasswd, SUDO_CONV_REPL_MAX, 0, strlen(pw_epasswd));

View File

@ -66,7 +66,7 @@ int
sudo_securid_init(struct passwd *pw, sudo_auth *auth)
{
static SDI_HANDLE sd_dat; /* SecurID handle */
debug_decl(sudo_securid_init, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_securid_init, SUDOERS_DEBUG_AUTH);
auth->data = (void *) &sd_dat; /* For method-specific data */
@ -96,7 +96,7 @@ sudo_securid_setup(struct passwd *pw, char **promptp, sudo_auth *auth)
{
SDI_HANDLE *sd = (SDI_HANDLE *) auth->data;
int retval;
debug_decl(sudo_securid_setup, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_securid_setup, SUDOERS_DEBUG_AUTH);
/* Re-initialize SecurID every time. */
if (SD_Init(sd) != ACM_OK) {
@ -147,7 +147,7 @@ sudo_securid_verify(struct passwd *pw, char *pass, sudo_auth *auth, struct sudo_
{
SDI_HANDLE *sd = (SDI_HANDLE *) auth->data;
int ret;
debug_decl(sudo_securid_verify, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_securid_verify, SUDOERS_DEBUG_AUTH);
pass = auth_getpass("Enter your PASSCODE: ", SUDO_CONV_PROMPT_ECHO_OFF,
callback);

View File

@ -55,7 +55,7 @@ sudo_sia_setup(struct passwd *pw, char **promptp, sudo_auth *auth)
{
SIAENTITY *siah;
int i;
debug_decl(sudo_sia_setup, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_sia_setup, SUDOERS_DEBUG_AUTH);
/* Rebuild argv for sia_ses_init() */
sudo_argc = NewArgc + 1;
@ -86,7 +86,7 @@ sudo_sia_verify(struct passwd *pw, char *prompt, sudo_auth *auth,
SIAENTITY *siah = auth->data;
char *pass;
int rc;
debug_decl(sudo_sia_verify, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_sia_verify, SUDOERS_DEBUG_AUTH);
/* Get password, return AUTH_INTR if we got ^C */
pass = auth_getpass(prompt, SUDO_CONV_PROMPT_ECHO_OFF, callback);
@ -109,7 +109,7 @@ int
sudo_sia_cleanup(struct passwd *pw, sudo_auth *auth)
{
SIAENTITY *siah = auth->data;
debug_decl(sudo_sia_cleanup, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_sia_cleanup, SUDOERS_DEBUG_AUTH);
(void) sia_ses_release(&siah);
auth->data = NULL;
@ -122,7 +122,7 @@ sudo_sia_begin_session(struct passwd *pw, char **user_envp[], sudo_auth *auth)
{
SIAENTITY *siah;
int status = AUTH_FATAL;
debug_decl(sudo_sia_begin_session, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_sia_begin_session, SUDOERS_DEBUG_AUTH);
/* Re-init sia for the target user's session. */
if (sia_ses_init(&siah, NewArgc, NewArgv, NULL, pw->pw_name, user_ttypath, 0, NULL) != SIASUCCESS) {

View File

@ -107,7 +107,7 @@ sudo_auth_init(struct passwd *pw)
{
sudo_auth *auth;
int status = AUTH_SUCCESS;
debug_decl(sudo_auth_init, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_auth_init, SUDOERS_DEBUG_AUTH);
if (auth_switch[0].name == NULL)
debug_return_int(0);
@ -178,7 +178,7 @@ int
sudo_auth_approval(struct passwd *pw, int validated, bool exempt)
{
sudo_auth *auth;
debug_decl(sudo_auth_approval, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_auth_approval, SUDOERS_DEBUG_AUTH);
/* Call approval routines. */
for (auth = auth_switch; auth->name; auth++) {
@ -202,7 +202,7 @@ int
sudo_auth_cleanup(struct passwd *pw)
{
sudo_auth *auth;
debug_decl(sudo_auth_cleanup, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_auth_cleanup, SUDOERS_DEBUG_AUTH);
/* Call cleanup routines. */
for (auth = auth_switch; auth->name; auth++) {
@ -221,7 +221,7 @@ static void
pass_warn(void)
{
const char *warning = def_badpass_message;
debug_decl(pass_warn, SUDOERS_DEBUG_AUTH)
debug_decl(pass_warn, SUDOERS_DEBUG_AUTH);
#ifdef INSULT
if (def_insults)
@ -254,7 +254,7 @@ verify_user(struct passwd *pw, char *prompt, int validated,
sudo_auth *auth;
sigset_t mask, omask;
struct sigaction sa, saved_sigtstp;
debug_decl(verify_user, SUDOERS_DEBUG_AUTH)
debug_decl(verify_user, SUDOERS_DEBUG_AUTH);
/* Make sure we have at least one auth method. */
if (auth_switch[0].name == NULL) {
@ -374,7 +374,7 @@ int
sudo_auth_begin_session(struct passwd *pw, char **user_env[])
{
sudo_auth *auth;
debug_decl(sudo_auth_begin_session, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_auth_begin_session, SUDOERS_DEBUG_AUTH);
for (auth = auth_switch; auth->name; auth++) {
if (auth->begin_session && !IS_DISABLED(auth)) {
@ -393,7 +393,7 @@ sudo_auth_needs_end_session(void)
{
sudo_auth *auth;
bool needed = false;
debug_decl(sudo_auth_needs_end_session, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_auth_needs_end_session, SUDOERS_DEBUG_AUTH);
for (auth = auth_switch; auth->name; auth++) {
if (auth->end_session && !IS_DISABLED(auth)) {
@ -413,7 +413,7 @@ sudo_auth_end_session(struct passwd *pw)
{
sudo_auth *auth;
int status;
debug_decl(sudo_auth_end_session, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_auth_end_session, SUDOERS_DEBUG_AUTH);
for (auth = auth_switch; auth->name; auth++) {
if (auth->end_session && !IS_DISABLED(auth)) {
@ -438,7 +438,7 @@ auth_getpass(const char *prompt, int type, struct sudo_conv_callback *callback)
struct sudo_conv_message msg;
struct sudo_conv_reply repl;
sigset_t mask, omask;
debug_decl(auth_getpass, SUDOERS_DEBUG_AUTH)
debug_decl(auth_getpass, SUDOERS_DEBUG_AUTH);
/* Mask user input if pwfeedback set and echo is off. */
if (type == SUDO_CONV_PROMPT_ECHO_OFF && def_pwfeedback)
@ -474,7 +474,7 @@ void
dump_auth_methods(void)
{
sudo_auth *auth;
debug_decl(dump_auth_methods, SUDOERS_DEBUG_AUTH)
debug_decl(dump_auth_methods, SUDOERS_DEBUG_AUTH);
sudo_printf(SUDO_CONV_INFO_MSG, _("Authentication methods:"));
for (auth = auth_switch; auth->name; auth++)

View File

@ -69,7 +69,7 @@ base64_decode(const char *in, unsigned char *out, size_t out_size)
unsigned char *out_end = out + out_size;
const unsigned char *out0 = out;
unsigned int rem, v;
debug_decl(base64_decode, SUDOERS_DEBUG_MATCH)
debug_decl(base64_decode, SUDOERS_DEBUG_MATCH);
for (v = 0, rem = 0; *in != '\0' && *in != '='; in++) {
unsigned char ch = base64dec_tab[(unsigned char)*in];
@ -100,7 +100,7 @@ base64_encode(const unsigned char *in, size_t in_len, char *out, size_t out_len)
{
size_t ii, io;
unsigned int rem, v;
debug_decl(base64_encode, SUDOERS_DEBUG_MATCH)
debug_decl(base64_encode, SUDOERS_DEBUG_MATCH);
for (io = 0, ii = 0, v = 0, rem = 0; ii < in_len; ii++) {
unsigned char ch = in[ii];

View File

@ -69,7 +69,7 @@ get_boottime(struct timespec *ts)
long long llval;
ssize_t len;
FILE *fp;
debug_decl(get_boottime, SUDOERS_DEBUG_UTIL)
debug_decl(get_boottime, SUDOERS_DEBUG_UTIL);
/* read btime from /proc/stat */
fp = fopen("/proc/stat", "r");
@ -107,7 +107,7 @@ get_boottime(struct timespec *ts)
size_t size;
int mib[2];
struct timeval tv;
debug_decl(get_boottime, SUDOERS_DEBUG_UTIL)
debug_decl(get_boottime, SUDOERS_DEBUG_UTIL);
mib[0] = CTL_KERN;
mib[1] = KERN_BOOTTIME;
@ -130,7 +130,7 @@ bool
get_boottime(struct timespec *ts)
{
struct utmpx *ut, key;
debug_decl(get_boottime, SUDOERS_DEBUG_UTIL)
debug_decl(get_boottime, SUDOERS_DEBUG_UTIL);
memset(&key, 0, sizeof(key));
key.ut_type = BOOT_TIME;
@ -151,7 +151,7 @@ bool
get_boottime(struct timespec *ts)
{
struct utmp *ut, key;
debug_decl(get_boottime, SUDOERS_DEBUG_UTIL)
debug_decl(get_boottime, SUDOERS_DEBUG_UTIL);
memset(&key, 0, sizeof(key));
key.ut_type = BOOT_TIME;
@ -171,7 +171,7 @@ get_boottime(struct timespec *ts)
bool
get_boottime(struct timespec *ts)
{
debug_decl(get_boottime, SUDOERS_DEBUG_UTIL)
debug_decl(get_boottime, SUDOERS_DEBUG_UTIL);
debug_return_bool(false);
}
#endif

View File

@ -64,7 +64,7 @@ audit_sudo_selected(int sorf)
auditinfo_addr_t ainfo_addr;
struct au_mask *mask;
int rc;
debug_decl(audit_sudo_selected, SUDOERS_DEBUG_AUDIT)
debug_decl(audit_sudo_selected, SUDOERS_DEBUG_AUDIT);
if (getaudit_addr(&ainfo_addr, sizeof(ainfo_addr)) < 0) {
#ifdef BSM_AUDIT_COMPAT
@ -114,7 +114,7 @@ bsm_audit_success(char *exec_args[])
long au_cond;
int aufd, selected;
pid_t pid;
debug_decl(bsm_audit_success, SUDOERS_DEBUG_AUDIT)
debug_decl(bsm_audit_success, SUDOERS_DEBUG_AUDIT);
/*
* If we are not auditing, don't cut an audit record; just return.
@ -206,7 +206,7 @@ bsm_audit_failure(char *exec_args[], char const *const fmt, va_list ap)
au_id_t auid;
pid_t pid;
int aufd;
debug_decl(bsm_audit_success, SUDOERS_DEBUG_AUDIT)
debug_decl(bsm_audit_success, SUDOERS_DEBUG_AUDIT);
/*
* If we are not auditing, don't cut an audit record; just return.

View File

@ -96,7 +96,7 @@ check_user_interactive(int validated, int mode, struct getpass_closure *closure)
int ret = -1;
char *prompt;
bool lectured;
debug_decl(check_user_interactive, SUDOERS_DEBUG_AUTH)
debug_decl(check_user_interactive, SUDOERS_DEBUG_AUTH);
/* Open, lock and read time stamp file if we are using it. */
if (!ISSET(mode, MODE_IGNORE_TICKET)) {
@ -167,7 +167,7 @@ check_user(int validated, int mode)
struct getpass_closure closure = { TS_ERROR };
int ret = -1;
bool exempt = false;
debug_decl(check_user, SUDOERS_DEBUG_AUTH)
debug_decl(check_user, SUDOERS_DEBUG_AUTH);
/*
* Init authentication system regardless of whether we need a password.
@ -242,7 +242,7 @@ display_lecture(int status)
ssize_t nread;
struct sudo_conv_message msg;
struct sudo_conv_reply repl;
debug_decl(lecture, SUDOERS_DEBUG_AUTH)
debug_decl(lecture, SUDOERS_DEBUG_AUTH);
if (def_lecture == never ||
(def_lecture == once && already_lectured(status)))
@ -279,7 +279,7 @@ bool
user_is_exempt(void)
{
bool ret = false;
debug_decl(user_is_exempt, SUDOERS_DEBUG_AUTH)
debug_decl(user_is_exempt, SUDOERS_DEBUG_AUTH);
if (def_exempt_group)
ret = user_in_group(sudo_user.pw, def_exempt_group);
@ -295,7 +295,7 @@ static struct passwd *
get_authpw(int mode)
{
struct passwd *pw = NULL;
debug_decl(get_authpw, SUDOERS_DEBUG_AUTH)
debug_decl(get_authpw, SUDOERS_DEBUG_AUTH);
if (ISSET(mode, (MODE_CHECK|MODE_LIST))) {
/* In list mode we always prompt for the user's password. */
@ -336,7 +336,7 @@ bool
check_user_shell(const struct passwd *pw)
{
const char *shell;
debug_decl(check_user_shell, SUDOERS_DEBUG_AUTH)
debug_decl(check_user_shell, SUDOERS_DEBUG_AUTH);
if (!def_runas_check_shell)
debug_return_bool(true);

View File

@ -110,7 +110,7 @@ main(int argc, char *argv[])
const char *output_file = "-";
const char *conf_file = _PATH_CVTSUDOERS_CONF;
const char *errstr;
debug_decl(main, SUDOERS_DEBUG_MAIN)
debug_decl(main, SUDOERS_DEBUG_MAIN);
#if defined(SUDO_DEVEL) && defined(__OpenBSD__)
{
@ -404,7 +404,7 @@ cvtsudoers_parse_keyword(const char *conf_file, const char *keyword,
{
struct cvtsudoers_conf_table *cur;
const char *errstr;
debug_decl(sudo_ldap_parse_keyword, SUDOERS_DEBUG_UTIL)
debug_decl(sudo_ldap_parse_keyword, SUDOERS_DEBUG_UTIL);
/* Look up keyword in config tables */
for (cur = table; cur->conf_str != NULL; cur++) {
@ -449,7 +449,7 @@ cvtsudoers_conf_read(const char *conf_file)
char *line = NULL;
size_t linesize = 0;
FILE *fp;
debug_decl(cvtsudoers_conf_read, SUDOERS_DEBUG_UTIL)
debug_decl(cvtsudoers_conf_read, SUDOERS_DEBUG_UTIL);
if ((fp = fopen(conf_file, "r")) == NULL)
debug_return_ptr(&cvtsudoers_config);
@ -488,7 +488,7 @@ cvtsudoers_conf_read(const char *conf_file)
static void
cvtsudoers_conf_free(struct cvtsudoers_config *conf)
{
debug_decl(cvtsudoers_conf_free, SUDOERS_DEBUG_UTIL)
debug_decl(cvtsudoers_conf_free, SUDOERS_DEBUG_UTIL);
if (conf != NULL) {
free(conf->sudoers_base);
@ -507,7 +507,7 @@ cvtsudoers_parse_defaults(char *expression)
{
char *last, *cp = expression;
int flags = 0;
debug_decl(cvtsudoers_parse_defaults, SUDOERS_DEBUG_UTIL)
debug_decl(cvtsudoers_parse_defaults, SUDOERS_DEBUG_UTIL);
for ((cp = strtok_r(cp, ",", &last)); cp != NULL; (cp = strtok_r(NULL, ",", &last))) {
if (strcasecmp(cp, "all") == 0) {
@ -536,7 +536,7 @@ cvtsudoers_parse_suppression(char *expression)
{
char *last, *cp = expression;
int flags = 0;
debug_decl(cvtsudoers_parse_suppression, SUDOERS_DEBUG_UTIL)
debug_decl(cvtsudoers_parse_suppression, SUDOERS_DEBUG_UTIL);
for ((cp = strtok_r(cp, ",", &last)); cp != NULL; (cp = strtok_r(NULL, ",", &last))) {
if (strcasecmp(cp, "defaults") == 0) {
@ -558,7 +558,7 @@ static bool
cvtsudoers_parse_filter(char *expression)
{
char *last, *cp = expression;
debug_decl(cvtsudoers_parse_filter, SUDOERS_DEBUG_UTIL)
debug_decl(cvtsudoers_parse_filter, SUDOERS_DEBUG_UTIL);
if (filters == NULL) {
if ((filters = malloc(sizeof(*filters))) == NULL) {
@ -614,7 +614,7 @@ parse_ldif(struct sudoers_parse_tree *parse_tree, const char *input_file,
struct cvtsudoers_config *conf)
{
FILE *fp = stdin;
debug_decl(parse_ldif, SUDOERS_DEBUG_UTIL)
debug_decl(parse_ldif, SUDOERS_DEBUG_UTIL);
/* Open LDIF file and parse it. */
if (strcmp(input_file, "-") != 0) {
@ -629,7 +629,7 @@ parse_ldif(struct sudoers_parse_tree *parse_tree, const char *input_file,
static bool
parse_sudoers(const char *input_file, struct cvtsudoers_config *conf)
{
debug_decl(parse_sudoers, SUDOERS_DEBUG_UTIL)
debug_decl(parse_sudoers, SUDOERS_DEBUG_UTIL);
/* Open sudoers file and parse it. */
if (strcmp(input_file, "-") == 0) {
@ -669,7 +669,7 @@ userlist_matches_filter(struct sudoers_parse_tree *parse_tree,
struct sudoers_string *s;
struct member *m, *next;
bool ret = false;
debug_decl(userlist_matches_filter, SUDOERS_DEBUG_UTIL)
debug_decl(userlist_matches_filter, SUDOERS_DEBUG_UTIL);
if (filters == NULL ||
(STAILQ_EMPTY(&filters->users) && STAILQ_EMPTY(&filters->groups)))
@ -747,7 +747,7 @@ hostlist_matches_filter(struct sudoers_parse_tree *parse_tree,
bool ret = false;
char **shosts;
int n = 0;
debug_decl(hostlist_matches_filter, SUDOERS_DEBUG_UTIL)
debug_decl(hostlist_matches_filter, SUDOERS_DEBUG_UTIL);
if (filters == NULL || STAILQ_EMPTY(&filters->hosts))
debug_return_bool(true);
@ -827,7 +827,7 @@ print_defaults_sudoers(struct sudoers_parse_tree *parse_tree,
struct sudo_lbuf *lbuf, bool expand_aliases)
{
struct defaults *def, *next;
debug_decl(print_defaults_sudoers, SUDOERS_DEBUG_UTIL)
debug_decl(print_defaults_sudoers, SUDOERS_DEBUG_UTIL);
TAILQ_FOREACH_SAFE(def, &parse_tree->defaults, entries, next) {
sudoers_format_default_line(lbuf, parse_tree, def, &next,
@ -843,7 +843,7 @@ print_alias_sudoers(struct sudoers_parse_tree *parse_tree, struct alias *a,
{
struct sudo_lbuf *lbuf = v;
struct member *m;
debug_decl(print_alias_sudoers, SUDOERS_DEBUG_UTIL)
debug_decl(print_alias_sudoers, SUDOERS_DEBUG_UTIL);
sudo_lbuf_append(lbuf, "%s %s = ", alias_type_to_string(a->type),
a->name);
@ -864,7 +864,7 @@ static bool
print_aliases_sudoers(struct sudoers_parse_tree *parse_tree,
struct sudo_lbuf *lbuf)
{
debug_decl(print_aliases_sudoers, SUDOERS_DEBUG_UTIL)
debug_decl(print_aliases_sudoers, SUDOERS_DEBUG_UTIL);
alias_apply(parse_tree, print_alias_sudoers, lbuf);
@ -888,7 +888,7 @@ filter_userspecs(struct sudoers_parse_tree *parse_tree,
{
struct userspec *us, *next_us;
struct privilege *priv, *next_priv;
debug_decl(filter_userspecs, SUDOERS_DEBUG_UTIL)
debug_decl(filter_userspecs, SUDOERS_DEBUG_UTIL);
if (filters == NULL)
debug_return;
@ -931,7 +931,7 @@ alias_matches(struct sudoers_parse_tree *parse_tree, const char *name,
struct alias *a;
struct member *m;
bool ret = false;
debug_decl(alias_matches, SUDOERS_DEBUG_ALIAS)
debug_decl(alias_matches, SUDOERS_DEBUG_ALIAS);
if (strcmp(name, alias_name) == 0)
debug_return_bool(true);
@ -967,7 +967,7 @@ alias_used_by_userspecs(struct sudoers_parse_tree *parse_tree,
struct cmndspec *cs, *cs_next;
struct member *m, *m_next;
struct member *am, *am_next;
debug_decl(alias_used_by_userspecs, SUDOERS_DEBUG_ALIAS)
debug_decl(alias_used_by_userspecs, SUDOERS_DEBUG_ALIAS);
/* Iterate over the policy, checking for aliases. */
TAILQ_FOREACH_SAFE(us, &parse_tree->userspecs, entries, us_next) {
@ -1053,7 +1053,7 @@ filter_defaults(struct sudoers_parse_tree *parse_tree,
struct member *m, *m_next;
struct alias *a;
int alias_type;
debug_decl(filter_defaults, SUDOERS_DEBUG_DEFAULTS)
debug_decl(filter_defaults, SUDOERS_DEBUG_DEFAULTS);
if (filters == NULL && conf->defaults == CVT_DEFAULTS_ALL)
debug_return;
@ -1172,7 +1172,7 @@ static void
alias_remove_unused(struct sudoers_parse_tree *parse_tree)
{
struct rbtree *used_aliases;
debug_decl(alias_remove_unused, SUDOERS_DEBUG_ALIAS)
debug_decl(alias_remove_unused, SUDOERS_DEBUG_ALIAS);
used_aliases = alloc_aliases();
if (used_aliases == NULL)
@ -1220,7 +1220,7 @@ static void
alias_prune(struct sudoers_parse_tree *parse_tree,
struct cvtsudoers_config *conf)
{
debug_decl(alias_prune, SUDOERS_DEBUG_ALIAS)
debug_decl(alias_prune, SUDOERS_DEBUG_ALIAS);
alias_apply(parse_tree, alias_prune_helper, conf);
@ -1236,7 +1236,7 @@ convert_sudoers_sudoers(struct sudoers_parse_tree *parse_tree,
{
bool ret = true;
struct sudo_lbuf lbuf;
debug_decl(convert_sudoers_sudoers, SUDOERS_DEBUG_UTIL)
debug_decl(convert_sudoers_sudoers, SUDOERS_DEBUG_UTIL);
if (strcmp(output_file, "-") == 0) {
output_fp = stdout;

View File

@ -160,7 +160,7 @@ static void
print_pair_json(FILE *fp, const char *pre, const char *name,
const struct json_value *value, const char *post, int indent)
{
debug_decl(print_pair_json, SUDOERS_DEBUG_UTIL)
debug_decl(print_pair_json, SUDOERS_DEBUG_UTIL);
print_indent(fp, indent);
@ -213,7 +213,7 @@ static void
printstr_json(FILE *fp, const char *pre, const char *str, const char *post,
int indent)
{
debug_decl(printstr_json, SUDOERS_DEBUG_UTIL)
debug_decl(printstr_json, SUDOERS_DEBUG_UTIL);
print_indent(fp, indent);
if (pre != NULL)
@ -237,7 +237,7 @@ print_command_json(FILE *fp, const char *name, int type, bool negated, int inden
struct sudo_command *c = (struct sudo_command *)name;
struct json_value value;
const char *digest_name;
debug_decl(print_command_json, SUDOERS_DEBUG_UTIL)
debug_decl(print_command_json, SUDOERS_DEBUG_UTIL);
printstr_json(fp, "{", NULL, NULL, indent);
if (negated || c->digest != NULL) {
@ -346,7 +346,7 @@ print_member_json_int(FILE *fp, struct sudoers_parse_tree *parse_tree,
const char *errstr;
int alias_type = UNSPEC;
id_t id;
debug_decl(print_member_json_int, SUDOERS_DEBUG_UTIL)
debug_decl(print_member_json_int, SUDOERS_DEBUG_UTIL);
/* Most of the time we print a string. */
value.type = JSON_STRING;
@ -534,7 +534,7 @@ print_alias_json(struct sudoers_parse_tree *parse_tree, struct alias *a, void *v
{
struct json_alias_closure *closure = v;
struct member *m;
debug_decl(print_alias_json, SUDOERS_DEBUG_UTIL)
debug_decl(print_alias_json, SUDOERS_DEBUG_UTIL);
if (a->type != closure->alias_type)
debug_return_int(0);
@ -568,7 +568,7 @@ print_binding_json(FILE *fp, struct sudoers_parse_tree *parse_tree,
struct member_list *binding, int type, int indent, bool expand_aliases)
{
struct member *m;
debug_decl(print_binding_json, SUDOERS_DEBUG_UTIL)
debug_decl(print_binding_json, SUDOERS_DEBUG_UTIL);
if (TAILQ_EMPTY(binding))
debug_return;
@ -596,7 +596,7 @@ print_defaults_list_json(FILE *fp, struct defaults *def, int indent)
{
char savech, *start, *end = def->val;
struct json_value value;
debug_decl(print_defaults_list_json, SUDOERS_DEBUG_UTIL)
debug_decl(print_defaults_list_json, SUDOERS_DEBUG_UTIL);
fprintf(fp, "%*s{\n", indent, "");
indent += 4;
@ -670,7 +670,7 @@ print_defaults_json(FILE *fp, struct sudoers_parse_tree *parse_tree,
struct json_value value;
struct defaults *def, *next;
int type;
debug_decl(print_defaults_json, SUDOERS_DEBUG_UTIL)
debug_decl(print_defaults_json, SUDOERS_DEBUG_UTIL);
if (TAILQ_EMPTY(&parse_tree->defaults))
debug_return_bool(need_comma);
@ -749,7 +749,7 @@ print_aliases_by_type_json(FILE *fp, struct sudoers_parse_tree *parse_tree,
int alias_type, const char *title, int indent, bool need_comma)
{
struct json_alias_closure closure;
debug_decl(print_aliases_by_type_json, SUDOERS_DEBUG_UTIL)
debug_decl(print_aliases_by_type_json, SUDOERS_DEBUG_UTIL);
closure.fp = fp;
closure.indent = indent;
@ -777,7 +777,7 @@ static bool
print_aliases_json(FILE *fp, struct sudoers_parse_tree *parse_tree,
int indent, bool need_comma)
{
debug_decl(print_aliases_json, SUDOERS_DEBUG_UTIL)
debug_decl(print_aliases_json, SUDOERS_DEBUG_UTIL);
need_comma = print_aliases_by_type_json(fp, parse_tree, USERALIAS,
"User_Aliases", indent, need_comma);
@ -808,7 +808,7 @@ print_cmndspec_json(FILE *fp, struct sudoers_parse_tree *parse_tree,
struct tm *tp;
bool last_one;
char timebuf[sizeof("20120727121554Z")];
debug_decl(print_cmndspec_json, SUDOERS_DEBUG_UTIL)
debug_decl(print_cmndspec_json, SUDOERS_DEBUG_UTIL);
/* Open Cmnd_Spec object. */
fprintf(fp, "%*s{\n", indent, "");
@ -1041,7 +1041,7 @@ print_userspec_json(FILE *fp, struct sudoers_parse_tree *parse_tree,
struct privilege *priv;
struct member *m;
struct cmndspec *cs, *next;
debug_decl(print_userspec_json, SUDOERS_DEBUG_UTIL)
debug_decl(print_userspec_json, SUDOERS_DEBUG_UTIL);
/*
* Each userspec struct may contain multiple privileges for
@ -1097,7 +1097,7 @@ print_userspecs_json(FILE *fp, struct sudoers_parse_tree *parse_tree,
int indent, bool expand_aliases, bool need_comma)
{
struct userspec *us;
debug_decl(print_userspecs_json, SUDOERS_DEBUG_UTIL)
debug_decl(print_userspecs_json, SUDOERS_DEBUG_UTIL);
if (TAILQ_EMPTY(&parse_tree->userspecs))
debug_return_bool(need_comma);
@ -1123,7 +1123,7 @@ convert_sudoers_json(struct sudoers_parse_tree *parse_tree,
bool ret = true, need_comma = false;
const int indent = 4;
FILE *output_fp = stdout;
debug_decl(convert_sudoers_json, SUDOERS_DEBUG_UTIL)
debug_decl(convert_sudoers_json, SUDOERS_DEBUG_UTIL);
if (strcmp(output_file, "-") != 0) {
if ((output_fp = fopen(output_file, "w")) == NULL)

View File

@ -71,7 +71,7 @@ static bool
safe_string(const char *str)
{
unsigned int ch = *str++;
debug_decl(safe_string, SUDOERS_DEBUG_UTIL)
debug_decl(safe_string, SUDOERS_DEBUG_UTIL);
/* Initial char must be <= 127 and not LF, CR, SPACE, ':', '<' */
switch (ch) {
@ -103,7 +103,7 @@ print_attribute_ldif(FILE *fp, const char *name, const char *value)
const unsigned char *uvalue = (unsigned char *)value;
char *encoded = NULL;
size_t esize;
debug_decl(print_attribute_ldif, SUDOERS_DEBUG_UTIL)
debug_decl(print_attribute_ldif, SUDOERS_DEBUG_UTIL);
if (!safe_string(value)) {
const size_t vlen = strlen(value);
@ -134,7 +134,7 @@ print_options_ldif(FILE *fp, struct defaults_list *options)
struct defaults *opt;
char *attr_val;
int len;
debug_decl(print_options_ldif, SUDOERS_DEBUG_UTIL)
debug_decl(print_options_ldif, SUDOERS_DEBUG_UTIL);
TAILQ_FOREACH(opt, options, entries) {
if (opt->type != DEFAULTS)
@ -171,7 +171,7 @@ print_global_defaults_ldif(FILE *fp, struct sudoers_parse_tree *parse_tree,
struct sudo_lbuf lbuf;
struct defaults *opt;
char *dn;
debug_decl(print_global_defaults_ldif, SUDOERS_DEBUG_UTIL)
debug_decl(print_global_defaults_ldif, SUDOERS_DEBUG_UTIL);
sudo_lbuf_init(&lbuf, NULL, 0, NULL, 80);
@ -222,7 +222,7 @@ print_member_ldif(FILE *fp, struct sudoers_parse_tree *parse_tree, char *name,
struct sudo_command *c;
char *attr_val;
int len;
debug_decl(print_member_ldif, SUDOERS_DEBUG_UTIL)
debug_decl(print_member_ldif, SUDOERS_DEBUG_UTIL);
switch (type) {
case ALL:
@ -284,7 +284,7 @@ print_cmndspec_ldif(FILE *fp, struct sudoers_parse_tree *parse_tree,
struct tm *tp;
bool last_one;
char timebuf[sizeof("20120727121554Z")];
debug_decl(print_cmndspec_ldif, SUDOERS_DEBUG_UTIL)
debug_decl(print_cmndspec_ldif, SUDOERS_DEBUG_UTIL);
/* Print runasuserlist as sudoRunAsUser attributes */
if (cs->runasuserlist != NULL) {
@ -471,7 +471,7 @@ user_to_cn(const char *user)
const char *src;
char *cn, *dst;
size_t size;
debug_decl(user_to_cn, SUDOERS_DEBUG_UTIL)
debug_decl(user_to_cn, SUDOERS_DEBUG_UTIL);
/* Allocate as much as we could possibly need. */
size = (2 * strlen(user)) + 64 + 1;
@ -547,7 +547,7 @@ print_userspec_ldif(FILE *fp, struct sudoers_parse_tree *parse_tree,
struct privilege *priv;
struct member *m;
struct cmndspec *cs, *next;
debug_decl(print_userspec_ldif, SUDOERS_DEBUG_UTIL)
debug_decl(print_userspec_ldif, SUDOERS_DEBUG_UTIL);
/*
* Each userspec struct may contain multiple privileges for
@ -614,7 +614,7 @@ print_userspecs_ldif(FILE *fp, struct sudoers_parse_tree *parse_tree,
struct cvtsudoers_config *conf)
{
struct userspec *us;
debug_decl(print_userspecs_ldif, SUDOERS_DEBUG_UTIL)
debug_decl(print_userspecs_ldif, SUDOERS_DEBUG_UTIL);
TAILQ_FOREACH(us, &parse_tree->userspecs, entries) {
if (!print_userspec_ldif(fp, parse_tree, us, conf))
@ -632,7 +632,7 @@ convert_sudoers_ldif(struct sudoers_parse_tree *parse_tree,
{
bool ret = true;
FILE *output_fp = stdout;
debug_decl(convert_sudoers_ldif, SUDOERS_DEBUG_UTIL)
debug_decl(convert_sudoers_ldif, SUDOERS_DEBUG_UTIL);
if (conf->sudoers_base == NULL) {
sudo_fatalx(U_("the SUDOERS_BASE environment variable is not set and the -b option was not specified."));

View File

@ -88,7 +88,7 @@ cvtsudoers_make_pwitem(uid_t uid, const char *name)
struct cache_item_pw *pwitem;
struct passwd pw, *newpw;
struct sudoers_string *s = NULL;
debug_decl(cvtsudoers_make_pwitem, SUDOERS_DEBUG_NSS)
debug_decl(cvtsudoers_make_pwitem, SUDOERS_DEBUG_NSS);
/* Look up name or uid in filter list. */
if (name != NULL) {
@ -195,7 +195,7 @@ cvtsudoers_make_gritem(gid_t gid, const char *name)
struct cache_item_gr *gritem;
struct group gr, *newgr;
struct sudoers_string *s = NULL;
debug_decl(cvtsudoers_make_gritem, SUDOERS_DEBUG_NSS)
debug_decl(cvtsudoers_make_gritem, SUDOERS_DEBUG_NSS);
/* Look up name or gid in filter list. */
if (name != NULL) {
@ -307,7 +307,7 @@ cvtsudoers_make_gidlist_item(const struct passwd *pw, char * const *unused1,
struct gid_list *gidlist;
GETGROUPS_T *gids = NULL;
int i, ngids = 0;
debug_decl(cvtsudoers_make_gidlist_item, SUDOERS_DEBUG_NSS)
debug_decl(cvtsudoers_make_gidlist_item, SUDOERS_DEBUG_NSS);
/*
* There's only a single gid list.
@ -404,7 +404,7 @@ cvtsudoers_make_grlist_item(const struct passwd *pw, char * const *unused1)
struct sudoers_string *s;
struct group_list *grlist;
int groupname_len;
debug_decl(cvtsudoers_make_grlist_item, SUDOERS_DEBUG_NSS)
debug_decl(cvtsudoers_make_grlist_item, SUDOERS_DEBUG_NSS);
/*
* There's only a single group list.

View File

@ -90,7 +90,7 @@ dump_defaults(void)
struct list_member *item;
struct def_values *def;
char *desc;
debug_decl(dump_defaults, SUDOERS_DEBUG_DEFAULTS)
debug_decl(dump_defaults, SUDOERS_DEBUG_DEFAULTS);
for (cur = sudo_defs_table; cur->name; cur++) {
if (cur->desc) {
@ -179,7 +179,7 @@ static int
find_default(const char *name, const char *file, int lineno, bool quiet)
{
int i;
debug_decl(find_default, SUDOERS_DEBUG_DEFAULTS)
debug_decl(find_default, SUDOERS_DEBUG_DEFAULTS);
for (i = 0; sudo_defs_table[i].name != NULL; i++) {
if (strcmp(name, sudo_defs_table[i].name) == 0)
@ -206,7 +206,7 @@ parse_default_entry(struct sudo_defs_types *def, const char *val, int op,
union sudo_defs_val *sd_un, const char *file, int lineno, bool quiet)
{
int rc;
debug_decl(parse_default_entry, SUDOERS_DEBUG_DEFAULTS)
debug_decl(parse_default_entry, SUDOERS_DEBUG_DEFAULTS);
sudo_debug_printf(SUDO_DEBUG_INFO, "%s: %s:%d %s=%s op=%d",
__func__, file, lineno, def->name, val ? val : "", op);
@ -338,7 +338,7 @@ struct early_default *
is_early_default(const char *name)
{
struct early_default *early;
debug_decl(is_early_default, SUDOERS_DEBUG_DEFAULTS)
debug_decl(is_early_default, SUDOERS_DEBUG_DEFAULTS);
for (early = early_defaults; early->idx != -1; early++) {
if (strcmp(name, sudo_defs_table[early->idx].name) == 0)
@ -350,7 +350,7 @@ is_early_default(const char *name)
static bool
run_callback(struct sudo_defs_types *def)
{
debug_decl(run_callback, SUDOERS_DEBUG_DEFAULTS)
debug_decl(run_callback, SUDOERS_DEBUG_DEFAULTS);
if (def->callback == NULL)
debug_return_bool(true);
@ -366,7 +366,7 @@ set_default(const char *var, const char *val, int op, const char *file,
int lineno, bool quiet)
{
int idx;
debug_decl(set_default, SUDOERS_DEBUG_DEFAULTS)
debug_decl(set_default, SUDOERS_DEBUG_DEFAULTS);
idx = find_default(var, file, lineno, quiet);
if (idx != -1) {
@ -387,7 +387,7 @@ set_early_default(const char *var, const char *val, int op, const char *file,
int lineno, bool quiet, struct early_default *early)
{
int idx;
debug_decl(set_early_default, SUDOERS_DEBUG_DEFAULTS)
debug_decl(set_early_default, SUDOERS_DEBUG_DEFAULTS);
idx = find_default(var, file, lineno, quiet);
if (idx != -1) {
@ -409,7 +409,7 @@ run_early_defaults(void)
{
struct early_default *early;
bool ret = true;
debug_decl(run_early_defaults, SUDOERS_DEBUG_DEFAULTS)
debug_decl(run_early_defaults, SUDOERS_DEBUG_DEFAULTS);
for (early = early_defaults; early->idx != -1; early++) {
if (early->run_callback) {
@ -444,7 +444,7 @@ init_defaults(void)
{
static int firsttime = 1;
struct sudo_defs_types *def;
debug_decl(init_defaults, SUDOERS_DEBUG_DEFAULTS)
debug_decl(init_defaults, SUDOERS_DEBUG_DEFAULTS);
/* Clear any old settings. */
if (!firsttime) {
@ -635,7 +635,7 @@ oom:
static bool
default_type_matches(struct defaults *d, int what)
{
debug_decl(default_type_matches, SUDOERS_DEBUG_DEFAULTS)
debug_decl(default_type_matches, SUDOERS_DEBUG_DEFAULTS);
switch (d->type) {
case DEFAULTS:
@ -670,7 +670,7 @@ static bool
default_binding_matches(struct sudoers_parse_tree *parse_tree,
struct defaults *d, int what)
{
debug_decl(default_binding_matches, SUDOERS_DEBUG_DEFAULTS)
debug_decl(default_binding_matches, SUDOERS_DEBUG_DEFAULTS);
switch (d->type) {
case DEFAULTS:
@ -706,7 +706,7 @@ update_defaults(struct sudoers_parse_tree *parse_tree,
{
struct defaults *d;
bool ret = true;
debug_decl(update_defaults, SUDOERS_DEBUG_DEFAULTS)
debug_decl(update_defaults, SUDOERS_DEBUG_DEFAULTS);
sudo_debug_printf(SUDO_DEBUG_INFO|SUDO_DEBUG_LINENO,
"what: 0x%02x", what);
@ -766,7 +766,7 @@ check_defaults(struct sudoers_parse_tree *parse_tree, bool quiet)
struct defaults *d;
bool ret = true;
int idx;
debug_decl(check_defaults, SUDOERS_DEBUG_DEFAULTS)
debug_decl(check_defaults, SUDOERS_DEBUG_DEFAULTS);
TAILQ_FOREACH(d, &parse_tree->defaults, entries) {
idx = find_default(d->var, d->file, d->lineno, quiet);
@ -792,7 +792,7 @@ store_int(const char *str, union sudo_defs_val *sd_un)
{
const char *errstr;
int i;
debug_decl(store_int, SUDOERS_DEBUG_DEFAULTS)
debug_decl(store_int, SUDOERS_DEBUG_DEFAULTS);
if (str == NULL) {
sd_un->ival = 0;
@ -813,7 +813,7 @@ store_uint(const char *str, union sudo_defs_val *sd_un)
{
const char *errstr;
unsigned int u;
debug_decl(store_uint, SUDOERS_DEBUG_DEFAULTS)
debug_decl(store_uint, SUDOERS_DEBUG_DEFAULTS);
if (str == NULL) {
sd_un->uival = 0;
@ -835,7 +835,7 @@ store_timespec(const char *str, union sudo_defs_val *sd_un)
struct timespec ts;
char sign = '+';
int i;
debug_decl(store_timespec, SUDOERS_DEBUG_DEFAULTS)
debug_decl(store_timespec, SUDOERS_DEBUG_DEFAULTS);
sudo_timespecclear(&ts);
if (str != NULL) {
@ -885,7 +885,7 @@ store_tuple(const char *str, union sudo_defs_val *sd_un,
struct def_values *tuple_vals)
{
struct def_values *v;
debug_decl(store_tuple, SUDOERS_DEBUG_DEFAULTS)
debug_decl(store_tuple, SUDOERS_DEBUG_DEFAULTS);
/*
* Look up tuple value by name to find enum def_tuple value.
@ -910,7 +910,7 @@ store_tuple(const char *str, union sudo_defs_val *sd_un,
static int
store_str(const char *str, union sudo_defs_val *sd_un)
{
debug_decl(store_str, SUDOERS_DEBUG_DEFAULTS)
debug_decl(store_str, SUDOERS_DEBUG_DEFAULTS);
free(sd_un->str);
if (str == NULL) {
@ -927,7 +927,7 @@ store_str(const char *str, union sudo_defs_val *sd_un)
static bool
store_list(const char *str, union sudo_defs_val *sd_un, int op)
{
debug_decl(store_list, SUDOERS_DEBUG_DEFAULTS)
debug_decl(store_list, SUDOERS_DEBUG_DEFAULTS);
/* Remove all old members. */
if (op == false || op == true)
@ -951,7 +951,7 @@ store_list(const char *str, union sudo_defs_val *sd_un, int op)
static bool
store_syslogfac(const char *str, union sudo_defs_val *sd_un)
{
debug_decl(store_syslogfac, SUDOERS_DEBUG_DEFAULTS)
debug_decl(store_syslogfac, SUDOERS_DEBUG_DEFAULTS);
if (str == NULL) {
sd_un->ival = false;
@ -963,7 +963,7 @@ store_syslogfac(const char *str, union sudo_defs_val *sd_un)
static bool
store_syslogpri(const char *str, union sudo_defs_val *sd_un)
{
debug_decl(store_syslogpri, SUDOERS_DEBUG_DEFAULTS)
debug_decl(store_syslogpri, SUDOERS_DEBUG_DEFAULTS);
if (str == NULL) {
sd_un->ival = -1;
@ -977,7 +977,7 @@ store_mode(const char *str, union sudo_defs_val *sd_un)
{
mode_t mode;
const char *errstr;
debug_decl(store_mode, SUDOERS_DEBUG_DEFAULTS)
debug_decl(store_mode, SUDOERS_DEBUG_DEFAULTS);
if (str == NULL) {
sd_un->mode = ACCESSPERMS;
@ -996,7 +996,7 @@ store_mode(const char *str, union sudo_defs_val *sd_un)
static bool
store_timeout(const char *str, union sudo_defs_val *sd_un)
{
debug_decl(store_mode, SUDOERS_DEBUG_DEFAULTS)
debug_decl(store_mode, SUDOERS_DEBUG_DEFAULTS);
if (str == NULL) {
sd_un->ival = 0;
@ -1017,7 +1017,7 @@ list_op(const char *str, size_t len, union sudo_defs_val *sd_un,
enum list_ops op)
{
struct list_member *cur, *prev = NULL;
debug_decl(list_op, SUDOERS_DEBUG_DEFAULTS)
debug_decl(list_op, SUDOERS_DEBUG_DEFAULTS);
if (op == freeall) {
while ((cur = SLIST_FIRST(&sd_un->list)) != NULL) {

View File

@ -35,7 +35,7 @@ const char *
digest_type_to_name(int digest_type)
{
const char *digest_name;
debug_decl(digest_type_to_name, SUDOERS_DEBUG_UTIL)
debug_decl(digest_type_to_name, SUDOERS_DEBUG_UTIL);
switch (digest_type) {
case SUDO_DIGEST_SHA224:

View File

@ -57,7 +57,7 @@ resolve_editor(const char *ed, size_t edlen, int nfiles, char **files,
const char *edend = ed + edlen;
struct stat user_editor_sb;
int nargc;
debug_decl(resolve_editor, SUDOERS_DEBUG_UTIL)
debug_decl(resolve_editor, SUDOERS_DEBUG_UTIL);
/*
* Split editor into an argument vector, including files to edit.
@ -134,7 +134,7 @@ find_editor(int nfiles, char **files, int *argc_out, char ***argv_out,
{
char *ev[3], *editor_path = NULL;
unsigned int i;
debug_decl(find_editor, SUDOERS_DEBUG_UTIL)
debug_decl(find_editor, SUDOERS_DEBUG_UTIL);
/*
* If any of SUDO_EDITOR, VISUAL or EDITOR are set, choose the first one.

View File

@ -242,7 +242,7 @@ env_init(char * const envp[])
{
char * const *ep;
size_t len;
debug_decl(env_init, SUDOERS_DEBUG_ENV)
debug_decl(env_init, SUDOERS_DEBUG_ENV);
if (envp == NULL) {
/* Free the old envp we allocated, if any. */
@ -400,7 +400,7 @@ static int
sudo_putenv(char *str, bool dupcheck, bool overwrite)
{
int ret;
debug_decl(sudo_putenv, SUDOERS_DEBUG_ENV)
debug_decl(sudo_putenv, SUDOERS_DEBUG_ENV);
sudo_debug_printf(SUDO_DEBUG_INFO, "sudo_putenv: %s", str);
@ -425,7 +425,7 @@ sudo_setenv2(const char *var, const char *val, bool dupcheck, bool overwrite)
char *estring;
size_t esize;
int ret = -1;
debug_decl(sudo_setenv2, SUDOERS_DEBUG_ENV)
debug_decl(sudo_setenv2, SUDOERS_DEBUG_ENV);
esize = strlen(var) + 1 + strlen(val) + 1;
if ((estring = malloc(esize)) == NULL) {
@ -547,7 +547,7 @@ int
sudo_unsetenv(const char *name)
{
int ret;
debug_decl(sudo_unsetenv, SUDOERS_DEBUG_ENV)
debug_decl(sudo_unsetenv, SUDOERS_DEBUG_ENV);
sudo_debug_printf(SUDO_DEBUG_INFO, "sudo_unsetenv: %s", name);
@ -587,7 +587,7 @@ char *
sudo_getenv(const char *name)
{
char *val;
debug_decl(sudo_getenv, SUDOERS_DEBUG_ENV)
debug_decl(sudo_getenv, SUDOERS_DEBUG_ENV);
sudo_debug_printf(SUDO_DEBUG_INFO, "sudo_getenv: %s", name);
@ -605,7 +605,7 @@ matches_env_list(const char *var, struct list_members *list, bool *full_match)
{
struct list_member *cur;
bool is_logname = false;
debug_decl(matches_env_list, SUDOERS_DEBUG_ENV)
debug_decl(matches_env_list, SUDOERS_DEBUG_ENV);
switch (*var) {
case 'L':
@ -652,7 +652,7 @@ static bool
matches_env_delete(const char *var)
{
bool full_match; /* unused */
debug_decl(matches_env_delete, SUDOERS_DEBUG_ENV)
debug_decl(matches_env_delete, SUDOERS_DEBUG_ENV);
/* Skip anything listed in env_delete. */
debug_return_bool(matches_env_list(var, &def_env_delete, &full_match));
@ -667,7 +667,7 @@ tz_is_sane(const char *tzval)
{
const char *cp;
char lastch;
debug_decl(tz_is_sane, SUDOERS_DEBUG_ENV)
debug_decl(tz_is_sane, SUDOERS_DEBUG_ENV);
/* tzcode treats a value beginning with a ':' as a path. */
if (tzval[0] == ':')
@ -715,7 +715,7 @@ static int
matches_env_check(const char *var, bool *full_match)
{
int keepit = -1;
debug_decl(matches_env_check, SUDOERS_DEBUG_ENV)
debug_decl(matches_env_check, SUDOERS_DEBUG_ENV);
/* Skip anything listed in env_check that includes '/' or '%'. */
if (matches_env_list(var, &def_env_check, full_match)) {
@ -739,7 +739,7 @@ static bool
matches_env_keep(const char *var, bool *full_match)
{
bool keepit = false;
debug_decl(matches_env_keep, SUDOERS_DEBUG_ENV)
debug_decl(matches_env_keep, SUDOERS_DEBUG_ENV);
/* Preserve SHELL variable for "sudo -s". */
if (ISSET(sudo_mode, MODE_SHELL) && strncmp(var, "SHELL=", 6) == 0) {
@ -780,7 +780,7 @@ env_should_keep(const char *var)
int keepit;
bool full_match = false;
const char *cp;
debug_decl(env_should_keep, SUDOERS_DEBUG_ENV)
debug_decl(env_should_keep, SUDOERS_DEBUG_ENV);
keepit = matches_env_check(var, &full_match);
if (keepit == -1)
@ -810,7 +810,7 @@ env_merge(char * const envp[])
{
char * const *ep;
bool ret = true;
debug_decl(env_merge, SUDOERS_DEBUG_ENV)
debug_decl(env_merge, SUDOERS_DEBUG_ENV);
for (ep = envp; *ep != NULL; ep++) {
/* XXX - avoid checking value here, should only check name */
@ -887,7 +887,7 @@ rebuild_env(void)
char idbuf[MAX_UID_T_LEN + 1];
unsigned int didvar;
bool reset_home = false;
debug_decl(rebuild_env, SUDOERS_DEBUG_ENV)
debug_decl(rebuild_env, SUDOERS_DEBUG_ENV);
/*
* Either clean out the environment or reset to a safe default.
@ -1144,7 +1144,7 @@ insert_env_vars(char * const envp[])
{
char * const *ep;
bool ret = true;
debug_decl(insert_env_vars, SUDOERS_DEBUG_ENV)
debug_decl(insert_env_vars, SUDOERS_DEBUG_ENV);
/* Add user-specified environment variables. */
if (envp != NULL) {
@ -1171,7 +1171,7 @@ validate_env_vars(char * const env_vars[])
char * const *ep;
char *eq, errbuf[4096];
bool okvar, ret = true;
debug_decl(validate_env_vars, SUDOERS_DEBUG_ENV)
debug_decl(validate_env_vars, SUDOERS_DEBUG_ENV);
if (env_vars == NULL)
debug_return_bool(true); /* nothing to do */
@ -1214,7 +1214,7 @@ static void *
env_file_open_local(const char *path)
{
struct env_file_local *efl;
debug_decl(env_file_open_local, SUDOERS_DEBUG_ENV)
debug_decl(env_file_open_local, SUDOERS_DEBUG_ENV);
efl = calloc(1, sizeof(*efl));
if (efl != NULL) {
@ -1232,7 +1232,7 @@ static void
env_file_close_local(void *cookie)
{
struct env_file_local *efl = cookie;
debug_decl(env_file_close_local, SUDOERS_DEBUG_ENV)
debug_decl(env_file_close_local, SUDOERS_DEBUG_ENV);
if (efl != NULL) {
if (efl->fp != NULL)
@ -1259,7 +1259,7 @@ env_file_next_local(void *cookie, int *errnum)
struct env_file_local *efl = cookie;
char *var, *val, *ret = NULL;
size_t var_len, val_len;
debug_decl(env_file_next_local, SUDOERS_DEBUG_ENV)
debug_decl(env_file_next_local, SUDOERS_DEBUG_ENV);
*errnum = 0;
if (efl->fp == NULL)
@ -1344,7 +1344,7 @@ read_env_file(const char *path, bool overwrite, bool restricted)
char *envstr;
void *cookie;
int errnum;
debug_decl(read_env_file, SUDOERS_DEBUG_ENV)
debug_decl(read_env_file, SUDOERS_DEBUG_ENV);
/*
* The environment file may be handled differently depending on
@ -1393,7 +1393,7 @@ init_envtables(void)
{
struct list_member *cur;
const char **p;
debug_decl(init_envtables, SUDOERS_DEBUG_ENV)
debug_decl(init_envtables, SUDOERS_DEBUG_ENV);
/* Fill in the "env_delete" list. */
for (p = initial_badenv_table; *p; p++) {

View File

@ -43,7 +43,7 @@ matches_env_pattern(const char *pattern, const char *var, bool *full_match)
bool iswild = false, match = false;
bool saw_sep = false;
const char *cp;
debug_decl(matches_env_pattern, SUDOERS_DEBUG_ENV)
debug_decl(matches_env_pattern, SUDOERS_DEBUG_ENV);
/* Locate position of the '=' separator in var=value. */
sep_pos = strcspn(var, "=");

View File

@ -51,7 +51,7 @@ struct sudo_file_handle {
static int
sudo_file_close(struct sudo_nss *nss)
{
debug_decl(sudo_file_close, SUDOERS_DEBUG_NSS)
debug_decl(sudo_file_close, SUDOERS_DEBUG_NSS);
struct sudo_file_handle *handle = nss->handle;
if (handle != NULL) {
@ -69,7 +69,7 @@ sudo_file_close(struct sudo_nss *nss)
static int
sudo_file_open(struct sudo_nss *nss)
{
debug_decl(sudo_file_open, SUDOERS_DEBUG_NSS)
debug_decl(sudo_file_open, SUDOERS_DEBUG_NSS);
struct sudo_file_handle *handle;
if (def_ignore_local_sudoers)
@ -101,7 +101,7 @@ sudo_file_open(struct sudo_nss *nss)
static struct sudoers_parse_tree *
sudo_file_parse(struct sudo_nss *nss)
{
debug_decl(sudo_file_close, SUDOERS_DEBUG_NSS)
debug_decl(sudo_file_close, SUDOERS_DEBUG_NSS);
struct sudo_file_handle *handle = nss->handle;
if (handle == NULL || handle->fp == NULL) {
@ -133,7 +133,7 @@ sudo_file_parse(struct sudo_nss *nss)
static int
sudo_file_query(struct sudo_nss *nss, struct passwd *pw)
{
debug_decl(sudo_file_query, SUDOERS_DEBUG_NSS)
debug_decl(sudo_file_query, SUDOERS_DEBUG_NSS);
debug_return_int(0);
}
@ -143,7 +143,7 @@ sudo_file_query(struct sudo_nss *nss, struct passwd *pw)
static int
sudo_file_getdefs(struct sudo_nss *nss)
{
debug_decl(sudo_file_getdefs, SUDOERS_DEBUG_NSS)
debug_decl(sudo_file_getdefs, SUDOERS_DEBUG_NSS);
debug_return_int(0);
}

View File

@ -54,7 +54,7 @@ sudo_filedigest(int fd, const char *file, int digest_type, size_t *digest_len)
FILE *fp = NULL;
size_t nread;
int fd2;
debug_decl(sudo_filedigest, SUDOERS_DEBUG_UTIL)
debug_decl(sudo_filedigest, SUDOERS_DEBUG_UTIL);
*digest_len = sudo_digest_getlen(digest_type);
if (*digest_len == (size_t)-1) {

View File

@ -54,7 +54,7 @@ cmnd_allowed(char *cmnd, size_t cmnd_size, struct stat *cmnd_sbp,
{
const char *cmnd_base;
char * const *wl;
debug_decl(cmnd_allowed, SUDOERS_DEBUG_UTIL)
debug_decl(cmnd_allowed, SUDOERS_DEBUG_UTIL);
if (!sudo_goodpath(cmnd, cmnd_sbp))
debug_return_bool(false);
@ -106,7 +106,7 @@ find_path(const char *infile, char **outfile, struct stat *sbp,
bool found = false;
bool checkdot = false;
int len;
debug_decl(find_path, SUDOERS_DEBUG_UTIL)
debug_decl(find_path, SUDOERS_DEBUG_UTIL);
/*
* If we were given a fully qualified or relative path

View File

@ -51,7 +51,7 @@ sudoers_format_member_int(struct sudo_lbuf *lbuf,
struct alias *a;
struct member *m;
struct sudo_command *c;
debug_decl(sudoers_format_member_int, SUDOERS_DEBUG_UTIL)
debug_decl(sudoers_format_member_int, SUDOERS_DEBUG_UTIL);
switch (type) {
case ALL:
@ -140,7 +140,7 @@ sudoers_defaults_to_tags(const char *var, const char *val, int op,
struct cmndtag *tags)
{
bool ret = true;
debug_decl(sudoers_defaults_to_tags, SUDOERS_DEBUG_UTIL)
debug_decl(sudoers_defaults_to_tags, SUDOERS_DEBUG_UTIL);
if (op == true || op == false) {
if (strcmp(var, "authenticate") == 0) {
@ -176,7 +176,7 @@ sudoers_defaults_list_to_tags(struct defaults_list *defs, struct cmndtag *tags)
{
bool ret = true;
struct defaults *d;
debug_decl(sudoers_defaults_list_to_tags, SUDOERS_DEBUG_UTIL)
debug_decl(sudoers_defaults_list_to_tags, SUDOERS_DEBUG_UTIL);
TAGS_INIT(*tags);
if (defs != NULL) {
@ -212,7 +212,7 @@ sudoers_format_cmndspec(struct sudo_lbuf *lbuf,
struct sudoers_parse_tree *parse_tree, struct cmndspec *cs,
struct cmndspec *prev_cs, struct cmndtag tags, bool expand_aliases)
{
debug_decl(sudoers_format_cmndspec, SUDOERS_DEBUG_UTIL)
debug_decl(sudoers_format_cmndspec, SUDOERS_DEBUG_UTIL);
/* Merge privilege-level tags with cmndspec tags. */
TAGS_MERGE(tags, cs->tags);
@ -276,7 +276,7 @@ sudoers_format_privilege(struct sudo_lbuf *lbuf,
struct cmndspec *cs, *prev_cs;
struct cmndtag tags;
struct member *m;
debug_decl(sudoers_format_privilege, SUDOERS_DEBUG_UTIL)
debug_decl(sudoers_format_privilege, SUDOERS_DEBUG_UTIL);
/* Convert per-privilege defaults to tags. */
sudoers_defaults_list_to_tags(&priv->defaults, &tags);
@ -339,7 +339,7 @@ sudoers_format_userspec(struct sudo_lbuf *lbuf,
struct privilege *priv;
struct sudoers_comment *comment;
struct member *m;
debug_decl(sudoers_format_userspec, SUDOERS_DEBUG_UTIL)
debug_decl(sudoers_format_userspec, SUDOERS_DEBUG_UTIL);
/* Print comments (if any). */
STAILQ_FOREACH(comment, &us->comments, entries) {
@ -376,7 +376,7 @@ sudoers_format_userspecs(struct sudo_lbuf *lbuf,
bool expand_aliases, bool flush)
{
struct userspec *us;
debug_decl(sudoers_format_userspecs, SUDOERS_DEBUG_UTIL)
debug_decl(sudoers_format_userspecs, SUDOERS_DEBUG_UTIL);
TAILQ_FOREACH(us, &parse_tree->userspecs, entries) {
if (separator != NULL && us != TAILQ_FIRST(&parse_tree->userspecs))
@ -395,7 +395,7 @@ sudoers_format_userspecs(struct sudo_lbuf *lbuf,
bool
sudoers_format_default(struct sudo_lbuf *lbuf, struct defaults *d)
{
debug_decl(sudoers_format_default, SUDOERS_DEBUG_UTIL)
debug_decl(sudoers_format_default, SUDOERS_DEBUG_UTIL);
if (d->val != NULL) {
sudo_lbuf_append(lbuf, "%s%s", d->var,
@ -425,7 +425,7 @@ sudoers_format_default_line( struct sudo_lbuf *lbuf,
{
struct member *m;
int alias_type;
debug_decl(sudoers_format_default_line, SUDOERS_DEBUG_UTIL)
debug_decl(sudoers_format_default_line, SUDOERS_DEBUG_UTIL);
/* Print Defaults type and binding (if present) */
switch (d->type) {

View File

@ -49,7 +49,7 @@ sudoers_gc_add(enum sudoers_gc_types type, void *v)
{
#ifdef NO_LEAKS
struct sudoers_gc_entry *gc;
debug_decl(sudoers_gc_add, SUDOERS_DEBUG_UTIL)
debug_decl(sudoers_gc_add, SUDOERS_DEBUG_UTIL);
if (v == NULL)
debug_return_bool(false);
@ -84,7 +84,7 @@ sudoers_gc_remove(enum sudoers_gc_types type, void *v)
{
#ifdef NO_LEAKS
struct sudoers_gc_entry *gc, *prev = NULL;
debug_decl(sudoers_gc_remove, SUDOERS_DEBUG_UTIL)
debug_decl(sudoers_gc_remove, SUDOERS_DEBUG_UTIL);
SLIST_FOREACH(gc, &sudoers_gc_list, entries) {
switch (gc->type) {
@ -119,7 +119,7 @@ sudoers_gc_run(void)
{
struct sudoers_gc_entry *gc;
char **cur;
debug_decl(sudoers_gc_run, SUDOERS_DEBUG_UTIL)
debug_decl(sudoers_gc_run, SUDOERS_DEBUG_UTIL);
/* Collect garbage. */
while ((gc = SLIST_FIRST(&sudoers_gc_list))) {

View File

@ -60,7 +60,7 @@ parse_gentime(const char *timestr)
size_t len;
int items, tzoff = 0;
bool islocal = false;
debug_decl(parse_gentime, SUDOERS_DEBUG_PARSER)
debug_decl(parse_gentime, SUDOERS_DEBUG_PARSER);
/* Make a copy of the time without time zone for easy parsing. */
len = strspn(timestr, "0123456789.,");

View File

@ -71,7 +71,7 @@ char *
sudo_getepw(const struct passwd *pw)
{
char *epw = NULL;
debug_decl(sudo_getepw, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_getepw, SUDOERS_DEBUG_AUTH);
/* If there is a function to check for shadow enabled, use it... */
#ifdef HAVE_ISCOMSEC
@ -118,7 +118,7 @@ done:
void
sudo_setspent(void)
{
debug_decl(sudo_setspent, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_setspent, SUDOERS_DEBUG_AUTH);
#ifdef HAVE_GETPRPWNAM
setprpwent();
@ -132,7 +132,7 @@ sudo_setspent(void)
void
sudo_endspent(void)
{
debug_decl(sudo_endspent, SUDOERS_DEBUG_AUTH)
debug_decl(sudo_endspent, SUDOERS_DEBUG_AUTH);
#ifdef HAVE_GETPRPWNAM
endprpwent();

View File

@ -49,7 +49,7 @@ bool
sudo_goodpath(const char *path, struct stat *sbp)
{
bool ret = false;
debug_decl(sudo_goodpath, SUDOERS_DEBUG_UTIL)
debug_decl(sudo_goodpath, SUDOERS_DEBUG_UTIL);
if (path != NULL) {
struct stat sb;

View File

@ -682,7 +682,7 @@ int yyparse(void);
void
sudoerserror(const char *s)
{
debug_decl(sudoerserror, SUDOERS_DEBUG_PARSER)
debug_decl(sudoerserror, SUDOERS_DEBUG_PARSER);
/* Save the line the first error occurred on. */
if (errorlineno == -1) {
@ -712,7 +712,7 @@ static struct defaults *
new_default(char *var, char *val, short op)
{
struct defaults *d;
debug_decl(new_default, SUDOERS_DEBUG_PARSER)
debug_decl(new_default, SUDOERS_DEBUG_PARSER);
if ((d = calloc(1, sizeof(struct defaults))) == NULL) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
@ -736,7 +736,7 @@ static struct member *
new_member(char *name, int type)
{
struct member *m;
debug_decl(new_member, SUDOERS_DEBUG_PARSER)
debug_decl(new_member, SUDOERS_DEBUG_PARSER);
if ((m = calloc(1, sizeof(struct member))) == NULL) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
@ -755,7 +755,7 @@ static struct command_digest *
new_digest(int digest_type, char *digest_str)
{
struct command_digest *digest;
debug_decl(new_digest, SUDOERS_DEBUG_PARSER)
debug_decl(new_digest, SUDOERS_DEBUG_PARSER);
if ((digest = malloc(sizeof(*digest))) == NULL) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
@ -786,7 +786,7 @@ add_defaults(int type, struct member *bmem, struct defaults *defs)
struct defaults *d, *next;
struct member_list *binding;
bool ret = true;
debug_decl(add_defaults, SUDOERS_DEBUG_PARSER)
debug_decl(add_defaults, SUDOERS_DEBUG_PARSER);
if (defs != NULL) {
/*
@ -825,7 +825,7 @@ static bool
add_userspec(struct member *members, struct privilege *privs)
{
struct userspec *u;
debug_decl(add_userspec, SUDOERS_DEBUG_PARSER)
debug_decl(add_userspec, SUDOERS_DEBUG_PARSER);
if ((u = calloc(1, sizeof(*u))) == NULL) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
@ -848,7 +848,7 @@ add_userspec(struct member *members, struct privilege *privs)
void
free_member(struct member *m)
{
debug_decl(free_member, SUDOERS_DEBUG_PARSER)
debug_decl(free_member, SUDOERS_DEBUG_PARSER);
if (m->type == COMMAND) {
struct sudo_command *c = (struct sudo_command *)m->name;
@ -872,7 +872,7 @@ void
free_members(struct member_list *members)
{
struct member *m;
debug_decl(free_members, SUDOERS_DEBUG_PARSER)
debug_decl(free_members, SUDOERS_DEBUG_PARSER);
while ((m = TAILQ_FIRST(members)) != NULL) {
TAILQ_REMOVE(members, m, entries);
@ -887,7 +887,7 @@ free_defaults(struct defaults_list *defs)
{
struct member_list *prev_binding = NULL;
struct defaults *def;
debug_decl(free_defaults, SUDOERS_DEBUG_PARSER)
debug_decl(free_defaults, SUDOERS_DEBUG_PARSER);
while ((def = TAILQ_FIRST(defs)) != NULL) {
TAILQ_REMOVE(defs, def, entries);
@ -900,7 +900,7 @@ free_defaults(struct defaults_list *defs)
void
free_default(struct defaults *def, struct member_list **binding)
{
debug_decl(free_default, SUDOERS_DEBUG_PARSER)
debug_decl(free_default, SUDOERS_DEBUG_PARSER);
if (def->binding != *binding) {
*binding = def->binding;
@ -930,7 +930,7 @@ free_privilege(struct privilege *priv)
#ifdef HAVE_PRIV_SET
char *privs = NULL, *limitprivs = NULL;
#endif /* HAVE_PRIV_SET */
debug_decl(free_privilege, SUDOERS_DEBUG_PARSER)
debug_decl(free_privilege, SUDOERS_DEBUG_PARSER);
free(priv->ldap_role);
free_members(&priv->hostlist);
@ -985,7 +985,7 @@ void
free_userspecs(struct userspec_list *usl)
{
struct userspec *us;
debug_decl(free_userspecs, SUDOERS_DEBUG_PARSER)
debug_decl(free_userspecs, SUDOERS_DEBUG_PARSER);
while ((us = TAILQ_FIRST(usl)) != NULL) {
TAILQ_REMOVE(usl, us, entries);
@ -1000,7 +1000,7 @@ free_userspec(struct userspec *us)
{
struct privilege *priv;
struct sudoers_comment *comment;
debug_decl(free_userspec, SUDOERS_DEBUG_PARSER)
debug_decl(free_userspec, SUDOERS_DEBUG_PARSER);
free_members(&us->users);
while ((priv = TAILQ_FIRST(&us->privileges)) != NULL) {
@ -1064,7 +1064,7 @@ bool
init_parser(const char *path, bool quiet, bool strict)
{
bool ret = true;
debug_decl(init_parser, SUDOERS_DEBUG_PARSER)
debug_decl(init_parser, SUDOERS_DEBUG_PARSER);
free_parse_tree(&parsed_policy);
init_lexer();

View File

@ -911,7 +911,7 @@ group : ALIAS {
void
sudoerserror(const char *s)
{
debug_decl(sudoerserror, SUDOERS_DEBUG_PARSER)
debug_decl(sudoerserror, SUDOERS_DEBUG_PARSER);
/* Save the line the first error occurred on. */
if (errorlineno == -1) {
@ -941,7 +941,7 @@ static struct defaults *
new_default(char *var, char *val, short op)
{
struct defaults *d;
debug_decl(new_default, SUDOERS_DEBUG_PARSER)
debug_decl(new_default, SUDOERS_DEBUG_PARSER);
if ((d = calloc(1, sizeof(struct defaults))) == NULL) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
@ -965,7 +965,7 @@ static struct member *
new_member(char *name, int type)
{
struct member *m;
debug_decl(new_member, SUDOERS_DEBUG_PARSER)
debug_decl(new_member, SUDOERS_DEBUG_PARSER);
if ((m = calloc(1, sizeof(struct member))) == NULL) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
@ -984,7 +984,7 @@ static struct command_digest *
new_digest(int digest_type, char *digest_str)
{
struct command_digest *digest;
debug_decl(new_digest, SUDOERS_DEBUG_PARSER)
debug_decl(new_digest, SUDOERS_DEBUG_PARSER);
if ((digest = malloc(sizeof(*digest))) == NULL) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
@ -1015,7 +1015,7 @@ add_defaults(int type, struct member *bmem, struct defaults *defs)
struct defaults *d, *next;
struct member_list *binding;
bool ret = true;
debug_decl(add_defaults, SUDOERS_DEBUG_PARSER)
debug_decl(add_defaults, SUDOERS_DEBUG_PARSER);
if (defs != NULL) {
/*
@ -1054,7 +1054,7 @@ static bool
add_userspec(struct member *members, struct privilege *privs)
{
struct userspec *u;
debug_decl(add_userspec, SUDOERS_DEBUG_PARSER)
debug_decl(add_userspec, SUDOERS_DEBUG_PARSER);
if ((u = calloc(1, sizeof(*u))) == NULL) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_LINENO,
@ -1077,7 +1077,7 @@ add_userspec(struct member *members, struct privilege *privs)
void
free_member(struct member *m)
{
debug_decl(free_member, SUDOERS_DEBUG_PARSER)
debug_decl(free_member, SUDOERS_DEBUG_PARSER);
if (m->type == COMMAND) {
struct sudo_command *c = (struct sudo_command *)m->name;
@ -1101,7 +1101,7 @@ void
free_members(struct member_list *members)
{
struct member *m;
debug_decl(free_members, SUDOERS_DEBUG_PARSER)
debug_decl(free_members, SUDOERS_DEBUG_PARSER);
while ((m = TAILQ_FIRST(members)) != NULL) {
TAILQ_REMOVE(members, m, entries);
@ -1116,7 +1116,7 @@ free_defaults(struct defaults_list *defs)
{
struct member_list *prev_binding = NULL;
struct defaults *def;
debug_decl(free_defaults, SUDOERS_DEBUG_PARSER)
debug_decl(free_defaults, SUDOERS_DEBUG_PARSER);
while ((def = TAILQ_FIRST(defs)) != NULL) {
TAILQ_REMOVE(defs, def, entries);
@ -1129,7 +1129,7 @@ free_defaults(struct defaults_list *defs)
void
free_default(struct defaults *def, struct member_list **binding)
{
debug_decl(free_default, SUDOERS_DEBUG_PARSER)
debug_decl(free_default, SUDOERS_DEBUG_PARSER);
if (def->binding != *binding) {
*binding = def->binding;
@ -1159,7 +1159,7 @@ free_privilege(struct privilege *priv)
#ifdef HAVE_PRIV_SET
char *privs = NULL, *limitprivs = NULL;
#endif /* HAVE_PRIV_SET */
debug_decl(free_privilege, SUDOERS_DEBUG_PARSER)
debug_decl(free_privilege, SUDOERS_DEBUG_PARSER);
free(priv->ldap_role);
free_members(&priv->hostlist);
@ -1214,7 +1214,7 @@ void
free_userspecs(struct userspec_list *usl)
{
struct userspec *us;
debug_decl(free_userspecs, SUDOERS_DEBUG_PARSER)
debug_decl(free_userspecs, SUDOERS_DEBUG_PARSER);
while ((us = TAILQ_FIRST(usl)) != NULL) {
TAILQ_REMOVE(usl, us, entries);
@ -1229,7 +1229,7 @@ free_userspec(struct userspec *us)
{
struct privilege *priv;
struct sudoers_comment *comment;
debug_decl(free_userspec, SUDOERS_DEBUG_PARSER)
debug_decl(free_userspec, SUDOERS_DEBUG_PARSER);
free_members(&us->users);
while ((priv = TAILQ_FIRST(&us->privileges)) != NULL) {
@ -1293,7 +1293,7 @@ bool
init_parser(const char *path, bool quiet, bool strict)
{
bool ret = true;
debug_decl(init_parser, SUDOERS_DEBUG_PARSER)
debug_decl(init_parser, SUDOERS_DEBUG_PARSER);
free_parse_tree(&parsed_policy);
init_lexer();

View File

@ -60,7 +60,7 @@ group_plugin_load(char *plugin_info)
char *args, path[PATH_MAX];
char **argv = NULL;
int len, rc = -1;
debug_decl(group_plugin_load, SUDOERS_DEBUG_UTIL)
debug_decl(group_plugin_load, SUDOERS_DEBUG_UTIL);
/*
* Fill in .so path and split out args (if any).
@ -170,7 +170,7 @@ done:
void
group_plugin_unload(void)
{
debug_decl(group_plugin_unload, SUDOERS_DEBUG_UTIL)
debug_decl(group_plugin_unload, SUDOERS_DEBUG_UTIL);
if (group_plugin != NULL) {
(group_plugin->cleanup)();
@ -187,7 +187,7 @@ int
group_plugin_query(const char *user, const char *group,
const struct passwd *pwd)
{
debug_decl(group_plugin_query, SUDOERS_DEBUG_UTIL)
debug_decl(group_plugin_query, SUDOERS_DEBUG_UTIL);
if (group_plugin == NULL)
debug_return_int(false);
@ -203,14 +203,14 @@ group_plugin_query(const char *user, const char *group,
int
group_plugin_load(char *plugin_info)
{
debug_decl(group_plugin_load, SUDOERS_DEBUG_UTIL)
debug_decl(group_plugin_load, SUDOERS_DEBUG_UTIL);
debug_return_int(false);
}
void
group_plugin_unload(void)
{
debug_decl(group_plugin_unload, SUDOERS_DEBUG_UTIL)
debug_decl(group_plugin_unload, SUDOERS_DEBUG_UTIL);
debug_return;
}
@ -218,7 +218,7 @@ int
group_plugin_query(const char *user, const char *group,
const struct passwd *pwd)
{
debug_decl(group_plugin_query, SUDOERS_DEBUG_UTIL)
debug_decl(group_plugin_query, SUDOERS_DEBUG_UTIL);
debug_return_int(false);
}
@ -231,7 +231,7 @@ bool
cb_group_plugin(const union sudo_defs_val *sd_un)
{
bool rc = true;
debug_decl(cb_group_plugin, SUDOERS_DEBUG_PLUGIN)
debug_decl(cb_group_plugin, SUDOERS_DEBUG_PLUGIN);
/* Unload any existing group plugin before loading a new one. */
group_plugin_unload();

View File

@ -37,7 +37,7 @@ hexchar(const char *s)
{
unsigned char result[2];
int i;
debug_decl(hexchar, SUDOERS_DEBUG_UTIL)
debug_decl(hexchar, SUDOERS_DEBUG_UTIL);
for (i = 0; i < 2; i++) {
switch (s[i]) {

View File

@ -63,7 +63,7 @@ set_interfaces(const char *ai)
char *addrinfo, *addr, *mask, *last;
struct interface *ifp;
bool ret = false;
debug_decl(set_interfaces, SUDOERS_DEBUG_NETIF)
debug_decl(set_interfaces, SUDOERS_DEBUG_NETIF);
if ((addrinfo = strdup(ai)) == NULL)
debug_return_bool(false);
@ -130,7 +130,7 @@ dump_interfaces(const char *ai)
{
const char *cp, *ep;
const char *ai_end = ai + strlen(ai);
debug_decl(set_interfaces, SUDOERS_DEBUG_NETIF)
debug_decl(set_interfaces, SUDOERS_DEBUG_NETIF);
sudo_printf(SUDO_CONV_INFO_MSG,
_("Local IP address and netmask pairs:\n"));

View File

@ -72,7 +72,7 @@ cb_maxseq(const union sudo_defs_val *sd_un)
{
const char *errstr;
unsigned int value;
debug_decl(cb_maxseq, SUDO_DEBUG_UTIL)
debug_decl(cb_maxseq, SUDO_DEBUG_UTIL);
value = sudo_strtonum(sd_un->str, 0, SESSID_MAX, &errstr);
if (errstr != NULL) {
@ -96,7 +96,7 @@ cb_iolog_user(const union sudo_defs_val *sd_un)
{
const char *name = sd_un->str;
struct passwd *pw;
debug_decl(cb_iolog_user, SUDOERS_DEBUG_UTIL)
debug_decl(cb_iolog_user, SUDOERS_DEBUG_UTIL);
/* NULL name means reset to default. */
if (name == NULL) {
@ -121,7 +121,7 @@ cb_iolog_group(const union sudo_defs_val *sd_un)
{
const char *name = sd_un->str;
struct group *gr;
debug_decl(cb_iolog_group, SUDOERS_DEBUG_UTIL)
debug_decl(cb_iolog_group, SUDOERS_DEBUG_UTIL);
/* NULL name means reset to default. */
if (name == NULL) {
@ -158,7 +158,7 @@ deserialize_stringlist(const char *s)
struct sudoers_string *str;
const char *s_end = s + strlen(s);
const char *cp, *ep;
debug_decl(deserialize_stringlist, SUDOERS_DEBUG_UTIL)
debug_decl(deserialize_stringlist, SUDOERS_DEBUG_UTIL);
if ((strlist = str_list_alloc()) == NULL)
debug_return_ptr(NULL);
@ -201,7 +201,7 @@ iolog_deserialize_info(struct iolog_details *details, char * const user_info[],
id_t id;
uid_t runas_uid = 0;
gid_t runas_gid = 0;
debug_decl(iolog_deserialize_info, SUDOERS_DEBUG_UTIL)
debug_decl(iolog_deserialize_info, SUDOERS_DEBUG_UTIL);
details->lines = 24;
details->cols = 80;
@ -462,7 +462,7 @@ static bool
write_info_log(int dfd, char *iolog_dir, struct iolog_details *details)
{
struct iolog_info iolog_info;
debug_decl(write_info_log, SUDOERS_DEBUG_UTIL)
debug_decl(write_info_log, SUDOERS_DEBUG_UTIL);
/* XXX - just use iolog_info in the first place? */
memset(&iolog_info, 0, sizeof(iolog_info));
@ -495,7 +495,7 @@ copy_vector_shallow(char * const *vec)
{
char **copy;
size_t len;
debug_decl(copy_vector, SUDOERS_DEBUG_UTIL)
debug_decl(copy_vector, SUDOERS_DEBUG_UTIL);
for (len = 0; vec[len] != NULL; len++)
continue;
@ -516,7 +516,7 @@ sudoers_io_open_local(void)
size_t len;
int iolog_dir_fd = -1;
int i, ret = -1;
debug_decl(sudoers_io_open_local, SUDOERS_DEBUG_PLUGIN)
debug_decl(sudoers_io_open_local, SUDOERS_DEBUG_PLUGIN);
/* If no I/O log path defined we need to figure it out ourselves. */
if (iolog_details.iolog_path == NULL) {
@ -586,7 +586,7 @@ static int
sudoers_io_open_remote(void)
{
int sock, ret = -1;
debug_decl(sudoers_io_open_remote, SUDOERS_DEBUG_PLUGIN)
debug_decl(sudoers_io_open_remote, SUDOERS_DEBUG_PLUGIN);
/* Connect to log server. */
sock = log_server_connect(iolog_details.log_servers,
@ -623,7 +623,7 @@ sudoers_io_open(unsigned int version, sudo_conv_t conversation,
char * const *cur;
const char *cp, *plugin_path = NULL;
int ret = -1;
debug_decl(sudoers_io_open, SUDOERS_DEBUG_PLUGIN)
debug_decl(sudoers_io_open, SUDOERS_DEBUG_PLUGIN);
sudo_conv = conversation;
sudo_printf = plugin_printf;
@ -724,7 +724,7 @@ sudoers_io_close(int exit_status, int error)
{
const char *errstr = NULL;
int i;
debug_decl(sudoers_io_close, SUDOERS_DEBUG_PLUGIN)
debug_decl(sudoers_io_close, SUDOERS_DEBUG_PLUGIN);
if (iolog_remote) {
client_close(&client_closure, exit_status, error);
@ -754,7 +754,7 @@ sudoers_io_close(int exit_status, int error)
static int
sudoers_io_version(int verbose)
{
debug_decl(sudoers_io_version, SUDOERS_DEBUG_PLUGIN)
debug_decl(sudoers_io_version, SUDOERS_DEBUG_PLUGIN);
sudo_printf(SUDO_CONV_INFO_MSG, "Sudoers I/O plugin version %s\n",
PACKAGE_VERSION);
@ -774,7 +774,7 @@ sudoers_io_log_local(int event, const char *buf, unsigned int len,
struct iolog_file *iol;
char tbuf[1024];
int ret = -1;
debug_decl(sudoers_io_log_local, SUDOERS_DEBUG_PLUGIN)
debug_decl(sudoers_io_log_local, SUDOERS_DEBUG_PLUGIN);
if (event < 0 || event >= IOFD_MAX) {
*errstr = NULL;
@ -821,7 +821,7 @@ sudoers_io_log_remote(int event, const char *buf, unsigned int len,
struct timespec *delay, const char **errstr)
{
int type, ret = -1;
debug_decl(sudoers_io_log_remote, SUDOERS_DEBUG_PLUGIN)
debug_decl(sudoers_io_log_remote, SUDOERS_DEBUG_PLUGIN);
if (client_closure.disabled)
debug_return_int(1);
@ -870,7 +870,7 @@ sudoers_io_log(const char *buf, unsigned int len, int event)
struct timespec now, delay;
const char *errstr = NULL;
int ret = -1;
debug_decl(sudoers_io_log, SUDOERS_DEBUG_PLUGIN)
debug_decl(sudoers_io_log, SUDOERS_DEBUG_PLUGIN);
if (sudo_gettime_awake(&now) == -1) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_ERRNO,
@ -941,7 +941,7 @@ sudoers_io_change_winsize_local(unsigned int lines, unsigned int cols,
{
char tbuf[1024];
int len, ret = -1;
debug_decl(sudoers_io_change_winsize_local, SUDOERS_DEBUG_PLUGIN)
debug_decl(sudoers_io_change_winsize_local, SUDOERS_DEBUG_PLUGIN);
/* Write window change event to the timing file. */
len = snprintf(tbuf, sizeof(tbuf), "%d %lld.%09ld %u %u\n",
@ -967,7 +967,7 @@ sudoers_io_change_winsize_remote(unsigned int lines, unsigned int cols,
struct timespec *delay, const char **errstr)
{
int ret = -1;
debug_decl(sudoers_io_change_winsize_remote, SUDOERS_DEBUG_PLUGIN)
debug_decl(sudoers_io_change_winsize_remote, SUDOERS_DEBUG_PLUGIN);
if (client_closure.disabled)
debug_return_int(1);
@ -991,7 +991,7 @@ sudoers_io_change_winsize(unsigned int lines, unsigned int cols)
struct timespec now, delay;
const char *errstr = NULL;
int ret = -1;
debug_decl(sudoers_io_change_winsize, SUDOERS_DEBUG_PLUGIN)
debug_decl(sudoers_io_change_winsize, SUDOERS_DEBUG_PLUGIN);
if (sudo_gettime_awake(&now) == -1) {
sudo_debug_printf(SUDO_DEBUG_ERROR|SUDO_DEBUG_ERRNO,
@ -1033,7 +1033,7 @@ sudoers_io_suspend_local(const char *signame, struct timespec *delay,
unsigned int len;
char tbuf[1024];
int ret = -1;
debug_decl(sudoers_io_suspend_local, SUDOERS_DEBUG_PLUGIN)
debug_decl(sudoers_io_suspend_local, SUDOERS_DEBUG_PLUGIN);
/* Write suspend event to the timing file. */
len = (unsigned int)snprintf(tbuf, sizeof(tbuf), "%d %lld.%09ld %s\n",
@ -1058,7 +1058,7 @@ sudoers_io_suspend_remote(const char *signame, struct timespec *delay,
const char **errstr)
{
int ret = -1;
debug_decl(sudoers_io_suspend_remote, SUDOERS_DEBUG_PLUGIN)
debug_decl(sudoers_io_suspend_remote, SUDOERS_DEBUG_PLUGIN);
if (client_closure.disabled)
debug_return_int(1);
@ -1083,7 +1083,7 @@ sudoers_io_suspend(int signo)
char signame[SIG2STR_MAX];
const char *errstr = NULL;
int ret = -1;
debug_decl(sudoers_io_suspend, SUDOERS_DEBUG_PLUGIN)
debug_decl(sudoers_io_suspend, SUDOERS_DEBUG_PLUGIN);
if (signo <= 0 || sig2str(signo, signame) == -1) {
sudo_warnx(U_("%s: internal error, invalid signal %d"),

View File

@ -63,7 +63,7 @@ connect_cb(int sock, int what, void *v)
{
int optval, ret, *errnump = v;
socklen_t optlen = sizeof(optval);
debug_decl(connect_cb, SUDOERS_DEBUG_UTIL)
debug_decl(connect_cb, SUDOERS_DEBUG_UTIL);
if (what == SUDO_PLUGIN_EV_TIMEOUT) {
*errnump = ETIMEDOUT;
@ -85,7 +85,7 @@ timed_connect(int sock, const struct sockaddr *addr, socklen_t addrlen,
struct sudo_event_base *evbase = NULL;
struct sudo_event *connect_event = NULL;
int ret, errnum = 0;
debug_decl(timed_connect, SUDOERS_DEBUG_UTIL)
debug_decl(timed_connect, SUDOERS_DEBUG_UTIL);
ret = connect(sock, addr, addrlen);
if (ret == -1 && errno == EINPROGRESS) {
@ -129,7 +129,7 @@ connect_server(const char *host, const char *port, struct timespec *timo,
struct addrinfo hints, *res, *res0;
const char *cause = NULL;
int error, sock = -1;
debug_decl(connect_server, SUDOERS_DEBUG_UTIL)
debug_decl(connect_server, SUDOERS_DEBUG_UTIL);
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_UNSPEC;
@ -187,7 +187,7 @@ log_server_connect(struct sudoers_str_list *servers, struct timespec *timo)
char *copy, *host, *port;
const char *cause = NULL;
int sock = -1;
debug_decl(restore_nproc, SUDOERS_DEBUG_UTIL)
debug_decl(restore_nproc, SUDOERS_DEBUG_UTIL);
STAILQ_FOREACH(server, servers, entries) {
copy = strdup(server->str);
@ -217,7 +217,7 @@ log_server_connect(struct sudoers_str_list *servers, struct timespec *timo)
static bool
tls_init(struct client_closure *closure, bool peer_auth)
{
debug_decl(tls_init, SUDOERS_DEBUG_PLUGIN)
debug_decl(tls_init, SUDOERS_DEBUG_PLUGIN);
if (closure->log_details->ca_bundle == NULL) {
sudo_warnx(U_("CA bundle file is not set in sudoers"));
@ -301,7 +301,7 @@ tls_connect_cb(int sock, int what, void *v)
struct timespec timeo = { 10, 0 };
int tls_con, err;
debug_decl(tls_connect_cb, SUDO_DEBUG_UTIL)
debug_decl(tls_connect_cb, SUDO_DEBUG_UTIL);
if (what == SUDO_PLUGIN_EV_TIMEOUT) {
sudo_warnx(U_("TLS handshake timeout occured"));
@ -342,7 +342,7 @@ tls_timed_connect(struct client_closure *closure)
{
struct sudo_event_base *evbase = NULL;
debug_decl(tls_timed_connect, SUDO_DEBUG_UTIL)
debug_decl(tls_timed_connect, SUDO_DEBUG_UTIL);
evbase = sudo_ev_base_alloc();
closure->tls_conn_status = false;
@ -380,7 +380,7 @@ void
client_closure_free(struct client_closure *closure)
{
struct connection_buffer *buf;
debug_decl(client_closure_free, SUDOERS_DEBUG_UTIL)
debug_decl(client_closure_free, SUDOERS_DEBUG_UTIL);
if (closure->sock != -1) {
close(closure->sock);
@ -431,7 +431,7 @@ static struct connection_buffer *
get_free_buf(struct client_closure *closure)
{
struct connection_buffer *buf;
debug_decl(get_free_buf, SUDOERS_DEBUG_UTIL)
debug_decl(get_free_buf, SUDOERS_DEBUG_UTIL);
buf = TAILQ_FIRST(&closure->free_bufs);
if (buf != NULL)
@ -454,7 +454,7 @@ fmt_client_message(struct client_closure *closure, ClientMessage *msg)
uint32_t msg_len;
bool ret = false;
size_t len;
debug_decl(fmt_client_message, SUDOERS_DEBUG_UTIL)
debug_decl(fmt_client_message, SUDOERS_DEBUG_UTIL);
if ((buf = get_free_buf(closure)) == NULL) {
sudo_warnx(U_("%s: %s"), __func__, U_("unable to allocate memory"));
@ -514,7 +514,7 @@ fmt_accept_message(struct client_closure *closure)
size_t info_msgs_size, n;
struct timespec now;
bool ret = false;
debug_decl(fmt_accept_message, SUDOERS_DEBUG_UTIL)
debug_decl(fmt_accept_message, SUDOERS_DEBUG_UTIL);
/*
* Fill in AcceptMessage and add it to ClientMessage.
@ -671,7 +671,7 @@ fmt_restart_message(struct client_closure *closure)
RestartMessage restart_msg = RESTART_MESSAGE__INIT;
TimeSpec tv = TIME_SPEC__INIT;
bool ret = false;
debug_decl(fmt_restart_message, SUDOERS_DEBUG_UTIL)
debug_decl(fmt_restart_message, SUDOERS_DEBUG_UTIL);
sudo_debug_printf(SUDO_DEBUG_INFO,
"%s: sending RestartMessage, [%lld, %ld]", __func__,
@ -705,7 +705,7 @@ fmt_exit_message(struct client_closure *closure, int exit_status, int error)
char signame[SIG2STR_MAX];
bool ret = false;
struct timespec run_time;
debug_decl(fmt_exit_message, SUDOERS_DEBUG_UTIL)
debug_decl(fmt_exit_message, SUDOERS_DEBUG_UTIL);
if (sudo_gettime_awake(&run_time) == -1) {
sudo_warn("%s", U_("unable to get time of day"));
@ -773,7 +773,7 @@ fmt_io_buf(struct client_closure *closure, int type, const char *buf,
IoBuffer iobuf_msg = IO_BUFFER__INIT;
TimeSpec ts = TIME_SPEC__INIT;
bool ret = false;
debug_decl(fmt_io_buf, SUDOERS_DEBUG_UTIL)
debug_decl(fmt_io_buf, SUDOERS_DEBUG_UTIL);
/* Fill in IoBuffer. */
ts.tv_sec = delay->tv_sec;
@ -811,7 +811,7 @@ fmt_winsize(struct client_closure *closure, unsigned int lines,
ChangeWindowSize winsize_msg = CHANGE_WINDOW_SIZE__INIT;
TimeSpec ts = TIME_SPEC__INIT;
bool ret = false;
debug_decl(fmt_winsize, SUDOERS_DEBUG_UTIL)
debug_decl(fmt_winsize, SUDOERS_DEBUG_UTIL);
/* Fill in ChangeWindowSize message. */
ts.tv_sec = delay->tv_sec;
@ -847,7 +847,7 @@ fmt_suspend(struct client_closure *closure, const char *signame, struct timespec
CommandSuspend suspend_msg = COMMAND_SUSPEND__INIT;
TimeSpec ts = TIME_SPEC__INIT;
bool ret = false;
debug_decl(fmt_suspend, SUDOERS_DEBUG_UTIL)
debug_decl(fmt_suspend, SUDOERS_DEBUG_UTIL);
/* Fill in CommandSuspend message. */
ts.tv_sec = delay->tv_sec;
@ -878,7 +878,7 @@ done:
static bool
client_message_completion(struct client_closure *closure)
{
debug_decl(client_message_completion, SUDOERS_DEBUG_UTIL)
debug_decl(client_message_completion, SUDOERS_DEBUG_UTIL);
switch (closure->state) {
case SEND_ACCEPT:
@ -915,7 +915,7 @@ static bool
handle_server_hello(ServerHello *msg, struct client_closure *closure)
{
size_t n;
debug_decl(handle_server_hello, SUDOERS_DEBUG_UTIL)
debug_decl(handle_server_hello, SUDOERS_DEBUG_UTIL);
if (closure->state != RECV_HELLO) {
sudo_warnx(U_("%s: unexpected state %d"), __func__, closure->state);
@ -973,7 +973,7 @@ handle_server_hello(ServerHello *msg, struct client_closure *closure)
static bool
handle_commit_point(TimeSpec *commit_point, struct client_closure *closure)
{
debug_decl(handle_commit_point, SUDOERS_DEBUG_UTIL)
debug_decl(handle_commit_point, SUDOERS_DEBUG_UTIL);
/* Only valid after we have sent an IO buffer. */
if (closure->state < SEND_IO) {
@ -1004,7 +1004,7 @@ handle_commit_point(TimeSpec *commit_point, struct client_closure *closure)
static bool
handle_log_id(char *id, struct client_closure *closure)
{
debug_decl(handle_log_id, SUDOERS_DEBUG_UTIL)
debug_decl(handle_log_id, SUDOERS_DEBUG_UTIL);
sudo_debug_printf(SUDO_DEBUG_INFO, "%s: remote log ID: %s", __func__, id);
if ((closure->iolog_id = strdup(id)) == NULL)
@ -1019,7 +1019,7 @@ handle_log_id(char *id, struct client_closure *closure)
static bool
handle_server_error(char *errmsg, struct client_closure *closure)
{
debug_decl(handle_server_error, SUDOERS_DEBUG_UTIL)
debug_decl(handle_server_error, SUDOERS_DEBUG_UTIL);
sudo_warnx(U_("error message received from server: %s"), errmsg);
debug_return_bool(false);
@ -1032,7 +1032,7 @@ handle_server_error(char *errmsg, struct client_closure *closure)
static bool
handle_server_abort(char *errmsg, struct client_closure *closure)
{
debug_decl(handle_server_abort, SUDOERS_DEBUG_UTIL)
debug_decl(handle_server_abort, SUDOERS_DEBUG_UTIL);
sudo_warnx(U_("abort message received from server: %s"), errmsg);
debug_return_bool(false);
@ -1048,7 +1048,7 @@ handle_server_message(uint8_t *buf, size_t len,
{
ServerMessage *msg;
bool ret = false;
debug_decl(handle_server_message, SUDOERS_DEBUG_UTIL)
debug_decl(handle_server_message, SUDOERS_DEBUG_UTIL);
sudo_debug_printf(SUDO_DEBUG_INFO, "%s: unpacking ServerMessage", __func__);
msg = server_message__unpack(NULL, len, buf);
@ -1103,7 +1103,7 @@ static bool
expand_buf(struct connection_buffer *buf, unsigned int needed)
{
void *newdata;
debug_decl(expand_buf, SUDO_DEBUG_UTIL)
debug_decl(expand_buf, SUDO_DEBUG_UTIL);
if (buf->size < needed) {
/* Expand buffer. */
@ -1140,7 +1140,7 @@ server_msg_cb(int fd, int what, void *v)
struct connection_buffer *buf = &closure->read_buf;
ssize_t nread;
uint32_t msg_len;
debug_decl(server_msg_cb, SUDOERS_DEBUG_UTIL)
debug_decl(server_msg_cb, SUDOERS_DEBUG_UTIL);
if (what == SUDO_PLUGIN_EV_TIMEOUT) {
sudo_debug_printf(SUDO_DEBUG_INFO, "%s: timed out reading from server",
@ -1245,7 +1245,7 @@ client_msg_cb(int fd, int what, void *v)
struct client_closure *closure = v;
struct connection_buffer *buf;
ssize_t nwritten;
debug_decl(client_msg_cb, SUDOERS_DEBUG_UTIL)
debug_decl(client_msg_cb, SUDOERS_DEBUG_UTIL);
if (what == SUDO_PLUGIN_EV_TIMEOUT) {
sudo_debug_printf(SUDO_DEBUG_INFO, "%s: timed out writiing to server",
@ -1336,7 +1336,7 @@ bool
client_closure_fill(struct client_closure *closure, int sock,
struct iolog_details *details, struct io_plugin *sudoers_io)
{
debug_decl(client_closure_alloc, SUDOERS_DEBUG_UTIL)
debug_decl(client_closure_alloc, SUDOERS_DEBUG_UTIL);
closure->sock = -1;
closure->state = RECV_HELLO;
@ -1398,7 +1398,7 @@ client_close(struct client_closure *closure, int exit_status, int error)
struct sudo_event_base *evbase = NULL;
short events;
bool ret = false;
debug_decl(client_close, SUDOERS_DEBUG_UTIL)
debug_decl(client_close, SUDOERS_DEBUG_UTIL);
if (closure->disabled)
goto done;

View File

@ -45,13 +45,13 @@ static size_t
fill_seq(char *str, size_t strsize, void *v)
{
#ifdef SUDOERS_NO_SEQ
debug_decl(fill_seq, SUDO_DEBUG_UTIL)
debug_decl(fill_seq, SUDO_DEBUG_UTIL);
debug_return_size_t(strlcpy(str, "%{seq}", strsize));
#else
char *logdir = v;
static char sessid[7];
int len;
debug_decl(fill_seq, SUDO_DEBUG_UTIL)
debug_decl(fill_seq, SUDO_DEBUG_UTIL);
if (sessid[0] == '\0') {
if (!iolog_nextid(logdir, sessid))
@ -70,7 +70,7 @@ fill_seq(char *str, size_t strsize, void *v)
static size_t
fill_user(char *str, size_t strsize, void *unused)
{
debug_decl(fill_user, SUDO_DEBUG_UTIL)
debug_decl(fill_user, SUDO_DEBUG_UTIL);
debug_return_size_t(strlcpy(str, user_name, strsize));
}
@ -79,7 +79,7 @@ fill_group(char *str, size_t strsize, void *unused)
{
struct group *grp;
size_t len;
debug_decl(fill_group, SUDO_DEBUG_UTIL)
debug_decl(fill_group, SUDO_DEBUG_UTIL);
if ((grp = sudo_getgrgid(user_gid)) != NULL) {
len = strlcpy(str, grp->gr_name, strsize);
@ -95,7 +95,7 @@ fill_group(char *str, size_t strsize, void *unused)
static size_t
fill_runas_user(char *str, size_t strsize, void *unused)
{
debug_decl(fill_runas_user, SUDO_DEBUG_UTIL)
debug_decl(fill_runas_user, SUDO_DEBUG_UTIL);
debug_return_size_t(strlcpy(str, runas_pw->pw_name, strsize));
}
@ -104,7 +104,7 @@ fill_runas_group(char *str, size_t strsize, void *unused)
{
struct group *grp;
size_t len;
debug_decl(fill_runas_group, SUDO_DEBUG_UTIL)
debug_decl(fill_runas_group, SUDO_DEBUG_UTIL);
if (runas_gr != NULL) {
len = strlcpy(str, runas_gr->gr_name, strsize);
@ -124,14 +124,14 @@ fill_runas_group(char *str, size_t strsize, void *unused)
static size_t
fill_hostname(char *str, size_t strsize, void *unused)
{
debug_decl(fill_hostname, SUDO_DEBUG_UTIL)
debug_decl(fill_hostname, SUDO_DEBUG_UTIL);
debug_return_size_t(strlcpy(str, user_shost, strsize));
}
static size_t
fill_command(char *str, size_t strsize, void *unused)
{
debug_decl(fill_command, SUDO_DEBUG_UTIL)
debug_decl(fill_command, SUDO_DEBUG_UTIL);
debug_return_size_t(strlcpy(str, user_base, strsize));
}

View File

@ -170,7 +170,7 @@ sudo_ldap_join_uri(struct ldap_config_str_list *uri_list)
struct ldap_config_str *uri;
size_t len = 0;
char *buf = NULL;
debug_decl(sudo_ldap_join_uri, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_ldap_join_uri, SUDOERS_DEBUG_LDAP);
STAILQ_FOREACH(uri, uri_list, entries) {
if (ldap_conf.ssl_mode == SUDO_LDAP_STARTTLS) {
@ -206,7 +206,7 @@ sudo_ldap_init(LDAP **ldp, const char *host, int port)
{
LDAP *ld;
int ret = LDAP_CONNECT_ERROR;
debug_decl(sudo_ldap_init, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_ldap_init, SUDOERS_DEBUG_LDAP);
#ifdef HAVE_LDAPSSL_INIT
if (ldap_conf.ssl_mode != SUDO_LDAP_CLEAR) {
@ -324,7 +324,7 @@ sudo_ldap_check_non_unix_group(LDAP *ld, LDAPMessage *entry, struct passwd *pw)
bool ret = false;
char *val;
int rc;
debug_decl(sudo_ldap_check_non_unix_group, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_ldap_check_non_unix_group, SUDOERS_DEBUG_LDAP);
if (!entry)
debug_return_bool(ret);
@ -368,7 +368,7 @@ sudo_ldap_get_first_rdn(LDAP *ld, LDAPMessage *entry)
#ifdef HAVE_LDAP_STR2DN
char *dn, *rdn = NULL;
LDAPDN tmpDN;
debug_decl(sudo_ldap_get_first_rdn, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_ldap_get_first_rdn, SUDOERS_DEBUG_LDAP);
if ((dn = ldap_get_dn(ld, entry)) == NULL)
debug_return_str(NULL);
@ -380,7 +380,7 @@ sudo_ldap_get_first_rdn(LDAP *ld, LDAPMessage *entry)
debug_return_str(rdn);
#else
char *dn, **edn;
debug_decl(sudo_ldap_get_first_rdn, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_ldap_get_first_rdn, SUDOERS_DEBUG_LDAP);
if ((dn = ldap_get_dn(ld, entry)) == NULL)
debug_return_str(NULL);
@ -401,7 +401,7 @@ sudo_ldap_parse_options(LDAP *ld, LDAPMessage *entry, struct defaults_list *defs
char *cn, *cp, *source = NULL;
bool ret = false;
int rc;
debug_decl(sudo_ldap_parse_options, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_ldap_parse_options, SUDOERS_DEBUG_LDAP);
bv = sudo_ldap_get_values_len(ld, entry, "sudoOption", &rc);
if (bv == NULL) {
@ -474,7 +474,7 @@ sudo_ldap_timefilter(char *buffer, size_t buffersize)
time_t now;
char timebuffer[sizeof("20120727121554.0Z")];
int len = -1;
debug_decl(sudo_ldap_timefilter, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_ldap_timefilter, SUDOERS_DEBUG_LDAP);
/* Make sure we have a formatted timestamp for __now__. */
time(&now);
@ -509,7 +509,7 @@ static char *
sudo_ldap_build_default_filter(void)
{
char *filt;
debug_decl(sudo_ldap_build_default_filter, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_ldap_build_default_filter, SUDOERS_DEBUG_LDAP);
if (!ldap_conf.search_filter)
debug_return_str(strdup("cn=defaults"));
@ -910,7 +910,7 @@ sudo_ldap_build_pass1(LDAP *ld, struct passwd *pw)
struct group *grp;
size_t sz = 0;
int i;
debug_decl(sudo_ldap_build_pass1, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_ldap_build_pass1, SUDOERS_DEBUG_LDAP);
STAILQ_INIT(&netgroups);
@ -1084,7 +1084,7 @@ sudo_ldap_build_pass2(void)
char *filt, timebuffer[TIMEFILTER_LENGTH + 1];
bool query_netgroups = def_use_netgroups;
int len;
debug_decl(sudo_ldap_build_pass2, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_ldap_build_pass2, SUDOERS_DEBUG_LDAP);
/* No need to query netgroups if using netgroup_base. */
if (!STAILQ_EMPTY(&ldap_conf.netgroup_base))
@ -1141,7 +1141,7 @@ ldap_to_sudoers(LDAP *ld, struct ldap_result *lres,
struct member *m;
unsigned int i;
int rc;
debug_decl(ldap_to_sudoers, SUDOERS_DEBUG_LDAP)
debug_decl(ldap_to_sudoers, SUDOERS_DEBUG_LDAP);
/* We only have a single userspec */
if ((us = calloc(1, sizeof(*us))) == NULL)
@ -1253,7 +1253,7 @@ sudo_set_krb5_ccache_name(const char *name, const char **old_name)
int ret = 0;
unsigned int junk;
static bool initialized;
debug_decl(sudo_set_krb5_ccache_name, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_set_krb5_ccache_name, SUDOERS_DEBUG_LDAP);
if (!initialized) {
sudo_gss_krb5_ccache_name = (sudo_gss_krb5_ccache_name_t)
@ -1296,7 +1296,7 @@ sudo_krb5_copy_cc_file(const char *old_ccname)
ssize_t nread, nwritten = -1;
static char new_ccname[sizeof(_PATH_TMP) + sizeof("sudocc_XXXXXXXX") - 1];
char buf[10240], *ret = NULL;
debug_decl(sudo_krb5_copy_cc_file, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_krb5_copy_cc_file, SUDOERS_DEBUG_LDAP);
old_ccname = sudo_krb5_ccname_path(old_ccname);
if (old_ccname != NULL) {
@ -1358,7 +1358,7 @@ sudo_ldap_sasl_interact(LDAP *ld, unsigned int flags, void *_auth_id,
char *auth_id = (char *)_auth_id;
sasl_interact_t *interact = (sasl_interact_t *)_interact;
int ret = LDAP_SUCCESS;
debug_decl(sudo_ldap_sasl_interact, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_ldap_sasl_interact, SUDOERS_DEBUG_LDAP);
for (; interact->id != SASL_CB_LIST_END; interact++) {
if (interact->id != SASL_CB_USER) {
@ -1397,7 +1397,7 @@ static struct ldap_result *
sudo_ldap_result_alloc(void)
{
struct ldap_result *result;
debug_decl(sudo_ldap_result_alloc, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_ldap_result_alloc, SUDOERS_DEBUG_LDAP);
result = calloc(1, sizeof(*result));
if (result != NULL)
@ -1413,7 +1413,7 @@ static void
sudo_ldap_result_free(struct ldap_result *lres)
{
struct ldap_search_result *s;
debug_decl(sudo_ldap_result_free, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_ldap_result_free, SUDOERS_DEBUG_LDAP);
if (lres != NULL) {
if (lres->nentries) {
@ -1438,7 +1438,7 @@ sudo_ldap_result_add_search(struct ldap_result *lres, LDAP *ldap,
LDAPMessage *searchresult)
{
struct ldap_search_result *news;
debug_decl(sudo_ldap_result_add_search, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_ldap_result_add_search, SUDOERS_DEBUG_LDAP);
/* Create new entry and add it to the end of the chain. */
news = calloc(1, sizeof(*news));
@ -1459,7 +1459,7 @@ static int
sudo_ldap_bind_s(LDAP *ld)
{
int ret;
debug_decl(sudo_ldap_bind_s, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_ldap_bind_s, SUDOERS_DEBUG_LDAP);
#ifdef HAVE_LDAP_SASL_INTERACTIVE_BIND_S
if (ldap_conf.rootuse_sasl == true ||
@ -1553,7 +1553,7 @@ static int
sudo_ldap_close(struct sudo_nss *nss)
{
struct sudo_ldap_handle *handle = nss->handle;
debug_decl(sudo_ldap_close, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_ldap_close, SUDOERS_DEBUG_LDAP);
if (handle != NULL) {
/* Unbind and close the LDAP connection. */
@ -1583,7 +1583,7 @@ sudo_ldap_open(struct sudo_nss *nss)
int rc = -1;
bool ldapnoinit = false;
struct sudo_ldap_handle *handle;
debug_decl(sudo_ldap_open, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_ldap_open, SUDOERS_DEBUG_LDAP);
if (nss->handle != NULL) {
sudo_debug_printf(SUDO_DEBUG_ERROR,
@ -1688,7 +1688,7 @@ sudo_ldap_getdefs(struct sudo_nss *nss)
char *filt = NULL;
int rc, ret = -1;
static bool cached;
debug_decl(sudo_ldap_getdefs, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_ldap_getdefs, SUDOERS_DEBUG_LDAP);
if (handle == NULL) {
sudo_debug_printf(SUDO_DEBUG_ERROR,
@ -1746,7 +1746,7 @@ ldap_entry_compare(const void *a, const void *b)
{
const struct ldap_entry_wrapper *aw = a;
const struct ldap_entry_wrapper *bw = b;
debug_decl(ldap_entry_compare, SUDOERS_DEBUG_LDAP)
debug_decl(ldap_entry_compare, SUDOERS_DEBUG_LDAP);
debug_return_int(aw->order < bw->order ? -1 :
(aw->order > bw->order ? 1 : 0));
@ -1759,7 +1759,7 @@ ldap_entry_compare(const void *a, const void *b)
static struct ldap_search_result *
sudo_ldap_result_last_search(struct ldap_result *lres)
{
debug_decl(sudo_ldap_result_last_search, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_ldap_result_last_search, SUDOERS_DEBUG_LDAP);
debug_return_ptr(STAILQ_LAST(&lres->searches, ldap_search_result, entries));
}
@ -1775,7 +1775,7 @@ sudo_ldap_result_add_entry(struct ldap_result *lres, LDAPMessage *entry)
double order = 0.0;
char *ep;
int rc;
debug_decl(sudo_ldap_result_add_entry, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_ldap_result_add_entry, SUDOERS_DEBUG_LDAP);
/* Determine whether the entry has the sudoOrder attribute. */
last = sudo_ldap_result_last_search(lres);
@ -1836,7 +1836,7 @@ sudo_ldap_result_get(struct sudo_nss *nss, struct passwd *pw)
LDAP *ld = handle->ld;
char *filt = NULL;
int pass, rc;
debug_decl(sudo_ldap_result_get, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_ldap_result_get, SUDOERS_DEBUG_LDAP);
/*
* Okay - time to search for anything that matches this user
@ -1934,7 +1934,7 @@ sudo_ldap_query(struct sudo_nss *nss, struct passwd *pw)
struct sudo_ldap_handle *handle = nss->handle;
struct ldap_result *lres = NULL;
int ret = -1;
debug_decl(sudo_ldap_query, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_ldap_query, SUDOERS_DEBUG_LDAP);
if (handle == NULL) {
sudo_debug_printf(SUDO_DEBUG_ERROR,
@ -1986,7 +1986,7 @@ static struct sudoers_parse_tree *
sudo_ldap_parse(struct sudo_nss *nss)
{
struct sudo_ldap_handle *handle = nss->handle;
debug_decl(sudo_ldap_parse, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_ldap_parse, SUDOERS_DEBUG_LDAP);
if (handle == NULL) {
sudo_debug_printf(SUDO_DEBUG_ERROR,

View File

@ -197,7 +197,7 @@ sudo_ldap_conf_add_ports(void)
char *host, *last, *port, defport[13];
char hostbuf[LINE_MAX * 2];
int len;
debug_decl(sudo_ldap_conf_add_ports, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_ldap_conf_add_ports, SUDOERS_DEBUG_LDAP);
hostbuf[0] = '\0';
len = snprintf(defport, sizeof(defport), ":%d", ldap_conf.port);
@ -243,7 +243,7 @@ sudo_ldap_parse_uri(const struct ldap_config_str_list *uri_list)
char *buf, hostbuf[LINE_MAX];
int nldap = 0, nldaps = 0;
int ret = -1;
debug_decl(sudo_ldap_parse_uri, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_ldap_parse_uri, SUDOERS_DEBUG_LDAP);
hostbuf[0] = '\0';
STAILQ_FOREACH(entry, uri_list, entries) {
@ -328,7 +328,7 @@ sudo_ldap_decode_secret(const char *secret)
{
unsigned char *result = NULL;
size_t len, reslen;
debug_decl(sudo_ldap_decode_secret, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_ldap_decode_secret, SUDOERS_DEBUG_LDAP);
if (strncasecmp(secret, "base64:", sizeof("base64:") - 1) == 0) {
/*
@ -360,7 +360,7 @@ sudo_ldap_read_secret(const char *path)
char *line = NULL;
size_t linesize = 0;
ssize_t len;
debug_decl(sudo_ldap_read_secret, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_ldap_read_secret, SUDOERS_DEBUG_LDAP);
if ((fp = fopen(path_ldap_secret, "r")) != NULL) {
len = getdelim(&line, &linesize, '\n', fp);
@ -396,7 +396,7 @@ sudo_ldap_parse_keyword(const char *keyword, const char *value,
{
struct ldap_config_table *cur;
const char *errstr;
debug_decl(sudo_ldap_parse_keyword, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_ldap_parse_keyword, SUDOERS_DEBUG_LDAP);
/* Look up keyword in config tables */
for (cur = table; cur->conf_str != NULL; cur++) {
@ -478,7 +478,7 @@ const char *
sudo_krb5_ccname_path(const char *old_ccname)
{
const char *ccname = old_ccname;
debug_decl(sudo_krb5_ccname_path, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_krb5_ccname_path, SUDOERS_DEBUG_LDAP);
/* Strip off leading FILE: or WRFILE: prefix. */
switch (ccname[0]) {
@ -505,7 +505,7 @@ sudo_check_krb5_ccname(const char *ccname)
{
int fd = -1;
const char *ccname_path;
debug_decl(sudo_check_krb5_ccname, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_check_krb5_ccname, SUDOERS_DEBUG_LDAP);
/* Strip off prefix to get path name. */
ccname_path = sudo_krb5_ccname_path(ccname);
@ -535,7 +535,7 @@ sudo_ldap_read_config(void)
struct ldap_config_str *conf_str;
size_t linesize = 0;
FILE *fp;
debug_decl(sudo_ldap_read_config, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_ldap_read_config, SUDOERS_DEBUG_LDAP);
/* defaults */
ldap_conf.version = 3;
@ -815,7 +815,7 @@ sudo_ldap_set_options_table(LDAP *ld, struct ldap_config_table *table)
struct ldap_config_table *cur;
int ival, rc, errors = 0;
char *sval;
debug_decl(sudo_ldap_set_options_table, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_ldap_set_options_table, SUDOERS_DEBUG_LDAP);
for (cur = table; cur->conf_str != NULL; cur++) {
if (cur->opt_val == -1)
@ -860,7 +860,7 @@ int
sudo_ldap_set_options_global(void)
{
int ret;
debug_decl(sudo_ldap_set_options_global, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_ldap_set_options_global, SUDOERS_DEBUG_LDAP);
/* Set ber options */
#ifdef LBER_OPT_DEBUG_LEVEL
@ -881,7 +881,7 @@ int
sudo_ldap_set_options_conn(LDAP *ld)
{
int rc;
debug_decl(sudo_ldap_set_options_conn, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_ldap_set_options_conn, SUDOERS_DEBUG_LDAP);
/* Parse per-connection LDAP options table. */
rc = sudo_ldap_set_options_table(ld, ldap_conf_conn);

View File

@ -56,7 +56,7 @@ sudo_ldap_is_negated(char **valp)
{
char *val = *valp;
bool ret = false;
debug_decl(sudo_ldap_is_negated, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_ldap_is_negated, SUDOERS_DEBUG_LDAP);
while (*val == '!') {
ret = !ret;
@ -78,7 +78,7 @@ sudo_ldap_parse_option(char *optstr, char **varp, char **valp)
char *cp, *val = NULL;
char *var = optstr;
int op;
debug_decl(sudo_ldap_parse_option, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_ldap_parse_option, SUDOERS_DEBUG_LDAP);
/* check for equals sign past first char */
cp = strchr(var, '=');
@ -130,7 +130,7 @@ array_to_member_list(void *a, sudo_ldap_iter_t iter)
struct member_list *members;
struct member *m;
char *val;
debug_decl(bv_to_member_list, SUDOERS_DEBUG_LDAP)
debug_decl(bv_to_member_list, SUDOERS_DEBUG_LDAP);
if ((members = calloc(1, sizeof(*members))) == NULL)
return NULL;
@ -199,7 +199,7 @@ is_address(char *host)
union sudo_in_addr_un addr;
bool ret = false;
char *slash;
debug_decl(is_address, SUDOERS_DEBUG_LDAP)
debug_decl(is_address, SUDOERS_DEBUG_LDAP);
/* Check for mask, not currently parsed. */
if ((slash = strchr(host, '/')) != NULL)
@ -222,7 +222,7 @@ static struct member *
host_to_member(char *host)
{
struct member *m;
debug_decl(host_to_member, SUDOERS_DEBUG_LDAP)
debug_decl(host_to_member, SUDOERS_DEBUG_LDAP);
if ((m = calloc(1, sizeof(*m))) == NULL)
goto oom;
@ -260,7 +260,7 @@ sudo_ldap_add_default(const char *var, const char *val, int op,
char *source, struct defaults_list *defs)
{
struct defaults *def;
debug_decl(sudo_ldap_add_default, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_ldap_add_default, SUDOERS_DEBUG_LDAP);
if ((def = calloc(1, sizeof(*def))) == NULL)
goto oom;
@ -304,7 +304,7 @@ sudo_ldap_role_to_priv(const char *cn, void *hosts, void *runasusers,
struct privilege *priv;
struct member *m;
char *cmnd;
debug_decl(sudo_ldap_role_to_priv, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_ldap_role_to_priv, SUDOERS_DEBUG_LDAP);
if ((priv = calloc(1, sizeof(*priv))) == NULL)
goto oom;
@ -526,7 +526,7 @@ sudo_ldap_extract_digest(char **cmnd, struct command_digest *digest)
{
char *ep, *cp = *cmnd;
int digest_type = SUDO_DIGEST_INVALID;
debug_decl(sudo_ldap_check_command, SUDOERS_DEBUG_LDAP)
debug_decl(sudo_ldap_check_command, SUDOERS_DEBUG_LDAP);
/*
* Check for and extract a digest prefix, e.g.

View File

@ -46,7 +46,7 @@ static int
linux_audit_open(void)
{
static int au_fd = -1;
debug_decl(linux_audit_open, SUDOERS_DEBUG_AUDIT)
debug_decl(linux_audit_open, SUDOERS_DEBUG_AUDIT);
if (au_fd != -1)
debug_return_int(au_fd);
@ -69,7 +69,7 @@ linux_audit_command(char *argv[], int result)
int au_fd, rc = -1;
char *command, *cp, **av;
size_t size, n;
debug_decl(linux_audit_command, SUDOERS_DEBUG_AUDIT)
debug_decl(linux_audit_command, SUDOERS_DEBUG_AUDIT);
/* Don't return an error if auditing is not configured. */
if ((au_fd = linux_audit_open()) < 0)

View File

@ -54,14 +54,14 @@ static char *sudoers_locale;
int
sudoers_getlocale(void)
{
debug_decl(sudoers_getlocale, SUDOERS_DEBUG_UTIL)
debug_decl(sudoers_getlocale, SUDOERS_DEBUG_UTIL);
debug_return_int(current_locale);
}
bool
sudoers_initlocale(const char *ulocale, const char *slocale)
{
debug_decl(sudoers_initlocale, SUDOERS_DEBUG_UTIL)
debug_decl(sudoers_initlocale, SUDOERS_DEBUG_UTIL);
if (ulocale != NULL) {
free(user_locale);
@ -88,7 +88,7 @@ bool
sudoers_setlocale(int newlocale, int *prevlocale)
{
char *res = NULL;
debug_decl(sudoers_setlocale, SUDOERS_DEBUG_UTIL)
debug_decl(sudoers_setlocale, SUDOERS_DEBUG_UTIL);
switch (newlocale) {
case SUDOERS_LOCALE_USER:
@ -135,7 +135,7 @@ sudoers_setlocale(int newlocale, int *prevlocale)
bool
sudoers_warn_setlocale(bool restore, int *cookie)
{
debug_decl(sudoers_warn_setlocale, SUDOERS_DEBUG_UTIL)
debug_decl(sudoers_warn_setlocale, SUDOERS_DEBUG_UTIL);
if (restore)
debug_return_bool(sudoers_setlocale(*cookie, NULL));
@ -148,7 +148,7 @@ sudoers_warn_setlocale(bool restore, int *cookie)
bool
sudoers_locale_callback(const union sudo_defs_val *sd_un)
{
debug_decl(sudoers_locale_callback, SUDOERS_DEBUG_UTIL)
debug_decl(sudoers_locale_callback, SUDOERS_DEBUG_UTIL);
if (sudoers_initlocale(NULL, sd_un->str)) {
if (setlocale(LC_ALL, sd_un->str) != NULL)

View File

@ -85,7 +85,7 @@ mysyslog(int pri, const char *fmt, ...)
{
const int flags = def_syslog_pid ? LOG_PID : 0;
va_list ap;
debug_decl(mysyslog, SUDOERS_DEBUG_LOGGING)
debug_decl(mysyslog, SUDOERS_DEBUG_LOGGING);
openlog("sudo", flags, def_syslog);
va_start(ap, fmt);
@ -106,7 +106,7 @@ do_syslog(int pri, char *msg)
char *p, *tmp, save;
const char *fmt;
int oldlocale;
debug_decl(do_syslog, SUDOERS_DEBUG_LOGGING)
debug_decl(do_syslog, SUDOERS_DEBUG_LOGGING);
/* A priority of -1 corresponds to "none". */
if (pri == -1)
@ -164,7 +164,7 @@ do_logfile(const char *msg)
char *full_line;
mode_t oldmask;
FILE *fp;
debug_decl(do_logfile, SUDOERS_DEBUG_LOGGING)
debug_decl(do_logfile, SUDOERS_DEBUG_LOGGING);
sudoers_setlocale(SUDOERS_LOCALE_SUDOERS, &oldlocale);
@ -241,7 +241,7 @@ log_denial(int status, bool inform_user)
int oldlocale;
bool uid_changed, ret = true;
bool mailit;
debug_decl(log_denial, SUDOERS_DEBUG_LOGGING)
debug_decl(log_denial, SUDOERS_DEBUG_LOGGING);
/* Handle auditing first (audit_failure() handles the locale itself). */
if (ISSET(status, FLAG_NO_USER | FLAG_NO_HOST))
@ -328,7 +328,7 @@ bool
log_failure(int status, int flags)
{
bool ret, inform_user = true;
debug_decl(log_failure, SUDOERS_DEBUG_LOGGING)
debug_decl(log_failure, SUDOERS_DEBUG_LOGGING);
/* The user doesn't always get to see the log message (path info). */
if (!ISSET(status, FLAG_NO_USER | FLAG_NO_HOST) && def_path_info &&
@ -361,7 +361,7 @@ log_auth_failure(int status, unsigned int tries)
{
int flags = 0;
bool ret = true;
debug_decl(log_auth_failure, SUDOERS_DEBUG_LOGGING)
debug_decl(log_auth_failure, SUDOERS_DEBUG_LOGGING);
/* Handle auditing first. */
audit_failure(NewArgc, NewArgv, N_("authentication failure"));
@ -405,7 +405,7 @@ log_allowed(int status)
int oldlocale;
bool uid_changed, ret = true;
bool mailit;
debug_decl(log_allowed, SUDOERS_DEBUG_LOGGING)
debug_decl(log_allowed, SUDOERS_DEBUG_LOGGING);
/* Send mail based on status. */
mailit = should_mail(status);
@ -457,7 +457,7 @@ fmt_authfail_message(char **str, va_list ap)
char *src, *dst0, *dst, *dst_end;
size_t size;
int len;
debug_decl(fmt_authfail_message, SUDOERS_DEBUG_LOGGING)
debug_decl(fmt_authfail_message, SUDOERS_DEBUG_LOGGING);
if (def_authfail_message == NULL) {
debug_return_int(asprintf(str, ngettext("%u incorrect password attempt",
@ -514,7 +514,7 @@ vlog_warning(int flags, int errnum, const char *fmt, va_list ap)
bool uid_changed, ret = true;
va_list ap2;
int len;
debug_decl(vlog_warning, SUDOERS_DEBUG_LOGGING)
debug_decl(vlog_warning, SUDOERS_DEBUG_LOGGING);
/* Need extra copy of ap for sudo_vwarn()/sudo_vwarnx() below. */
va_copy(ap2, ap);
@ -625,7 +625,7 @@ log_warning(int flags, const char *fmt, ...)
{
va_list ap;
bool ret;
debug_decl(log_warning, SUDOERS_DEBUG_LOGGING)
debug_decl(log_warning, SUDOERS_DEBUG_LOGGING);
/* Log the error. */
va_start(ap, fmt);
@ -640,7 +640,7 @@ log_warningx(int flags, const char *fmt, ...)
{
va_list ap;
bool ret;
debug_decl(log_warningx, SUDOERS_DEBUG_LOGGING)
debug_decl(log_warningx, SUDOERS_DEBUG_LOGGING);
/* Log the error. */
va_start(ap, fmt);
@ -655,7 +655,7 @@ gai_log_warning(int flags, int errnum, const char *fmt, ...)
{
va_list ap;
bool ret;
debug_decl(gai_log_warning, SUDOERS_DEBUG_LOGGING)
debug_decl(gai_log_warning, SUDOERS_DEBUG_LOGGING);
/* Log the error. */
va_start(ap, fmt);
@ -670,7 +670,7 @@ closefrom_nodebug(int lowfd)
{
unsigned char *debug_fds;
int fd, startfd;
debug_decl(closefrom_nodebug, SUDOERS_DEBUG_LOGGING)
debug_decl(closefrom_nodebug, SUDOERS_DEBUG_LOGGING);
startfd = sudo_debug_get_fds(&debug_fds) + 1;
if (lowfd > startfd)
@ -720,7 +720,7 @@ exec_mailer(int pipein)
NULL
};
#endif /* NO_ROOT_MAILER */
debug_decl(exec_mailer, SUDOERS_DEBUG_LOGGING)
debug_decl(exec_mailer, SUDOERS_DEBUG_LOGGING);
/* Set stdin to read side of the pipe. */
if (dup3(pipein, STDIN_FILENO, 0) == -1) {
@ -780,7 +780,7 @@ send_mail(const char *fmt, ...)
pid_t pid, rv;
struct stat sb;
va_list ap;
debug_decl(send_mail, SUDOERS_DEBUG_LOGGING)
debug_decl(send_mail, SUDOERS_DEBUG_LOGGING);
/* If mailer is disabled just return. */
if (!def_mailerpath || !def_mailto)
@ -927,7 +927,7 @@ send_mail(const char *fmt, ...)
static bool
should_mail(int status)
{
debug_decl(should_mail, SUDOERS_DEBUG_LOGGING)
debug_decl(should_mail, SUDOERS_DEBUG_LOGGING);
debug_return_bool(def_mail_always || ISSET(status, VALIDATE_ERROR) ||
(def_mail_all_cmnds && ISSET(sudo_mode, (MODE_RUN|MODE_EDIT))) ||
@ -964,7 +964,7 @@ new_logline(const char *message, const char *errstr)
#endif
const char *tsid = NULL;
size_t len = 0;
debug_decl(new_logline, SUDOERS_DEBUG_LOGGING)
debug_decl(new_logline, SUDOERS_DEBUG_LOGGING);
#ifndef SUDOERS_NO_SEQ
/* A TSID may be a sudoers-style session ID or a free-form string. */

View File

@ -42,7 +42,7 @@ writeln_wrap(FILE *fp, char *line, size_t linelen, size_t maxlen)
char *beg = line;
char *end;
int len, outlen = 0;
debug_decl(writeln_wrap, SUDOERS_DEBUG_LOGGING)
debug_decl(writeln_wrap, SUDOERS_DEBUG_LOGGING);
/*
* Print out line with word wrap around maxlen characters.

View File

@ -76,7 +76,7 @@ user_matches(struct sudoers_parse_tree *parse_tree, const struct passwd *pw,
const char *shost = parse_tree->shost ? parse_tree->shost : user_srunhost;
int matched = UNSPEC;
struct alias *a;
debug_decl(user_matches, SUDOERS_DEBUG_MATCH)
debug_decl(user_matches, SUDOERS_DEBUG_MATCH);
switch (m->type) {
case ALL:
@ -120,7 +120,7 @@ userlist_matches(struct sudoers_parse_tree *parse_tree, const struct passwd *pw,
{
struct member *m;
int matched = UNSPEC;
debug_decl(userlist_matches, SUDOERS_DEBUG_MATCH)
debug_decl(userlist_matches, SUDOERS_DEBUG_MATCH);
TAILQ_FOREACH_REVERSE(m, list, member_list, entries) {
if ((matched = user_matches(parse_tree, pw, m)) != UNSPEC)
@ -133,7 +133,7 @@ struct gid_list *
runas_getgroups(void)
{
const struct passwd *pw;
debug_decl(runas_getgroups, SUDOERS_DEBUG_MATCH)
debug_decl(runas_getgroups, SUDOERS_DEBUG_MATCH);
if (def_preserve_groups) {
sudo_gidlist_addref(user_gid_list);
@ -162,7 +162,7 @@ runaslist_matches(struct sudoers_parse_tree *parse_tree,
struct member *m;
struct alias *a;
int rc;
debug_decl(runaslist_matches, SUDOERS_DEBUG_MATCH)
debug_decl(runaslist_matches, SUDOERS_DEBUG_MATCH);
if (ISSET(sudo_user.flags, RUNAS_USER_SPECIFIED) || !ISSET(sudo_user.flags, RUNAS_GROUP_SPECIFIED)) {
/* If no runas user or runas group listed in sudoers, use default. */
@ -295,7 +295,7 @@ hostlist_matches_int(struct sudoers_parse_tree *parse_tree,
{
struct member *m;
int matched = UNSPEC;
debug_decl(hostlist_matches, SUDOERS_DEBUG_MATCH)
debug_decl(hostlist_matches, SUDOERS_DEBUG_MATCH);
TAILQ_FOREACH_REVERSE(m, list, member_list, entries) {
matched = host_matches(parse_tree, pw, lhost, shost, m);
@ -329,7 +329,7 @@ host_matches(struct sudoers_parse_tree *parse_tree, const struct passwd *pw,
{
struct alias *a;
int matched = UNSPEC;
debug_decl(host_matches, SUDOERS_DEBUG_MATCH)
debug_decl(host_matches, SUDOERS_DEBUG_MATCH);
switch (m->type) {
case ALL:
@ -374,7 +374,7 @@ cmndlist_matches(struct sudoers_parse_tree *parse_tree,
{
struct member *m;
int matched = UNSPEC;
debug_decl(cmndlist_matches, SUDOERS_DEBUG_MATCH)
debug_decl(cmndlist_matches, SUDOERS_DEBUG_MATCH);
TAILQ_FOREACH_REVERSE(m, list, member_list, entries) {
matched = cmnd_matches(parse_tree, m);
@ -394,7 +394,7 @@ cmnd_matches(struct sudoers_parse_tree *parse_tree, const struct member *m)
struct alias *a;
struct sudo_command *c;
int rc, matched = UNSPEC;
debug_decl(cmnd_matches, SUDOERS_DEBUG_MATCH)
debug_decl(cmnd_matches, SUDOERS_DEBUG_MATCH);
switch (m->type) {
case ALL:
@ -426,7 +426,7 @@ hostname_matches(const char *shost, const char *lhost, const char *pattern)
{
const char *host;
bool rc;
debug_decl(hostname_matches, SUDOERS_DEBUG_MATCH)
debug_decl(hostname_matches, SUDOERS_DEBUG_MATCH);
host = strchr(pattern, '.') != NULL ? lhost : shost;
if (has_meta(pattern)) {
@ -450,7 +450,7 @@ userpw_matches(const char *sudoers_user, const char *user, const struct passwd *
const char *errstr;
uid_t uid;
bool rc;
debug_decl(userpw_matches, SUDOERS_DEBUG_MATCH)
debug_decl(userpw_matches, SUDOERS_DEBUG_MATCH);
if (pw != NULL && *sudoers_user == '#') {
uid = (uid_t) sudo_strtoid(sudoers_user + 1, &errstr);
@ -480,7 +480,7 @@ group_matches(const char *sudoers_group, const struct group *gr)
const char *errstr;
gid_t gid;
bool rc;
debug_decl(group_matches, SUDOERS_DEBUG_MATCH)
debug_decl(group_matches, SUDOERS_DEBUG_MATCH);
if (*sudoers_group == '#') {
gid = (gid_t) sudo_strtoid(sudoers_group + 1, &errstr);
@ -509,7 +509,7 @@ usergr_matches(const char *group, const char *user, const struct passwd *pw)
{
bool matched = false;
struct passwd *pw0 = NULL;
debug_decl(usergr_matches, SUDOERS_DEBUG_MATCH)
debug_decl(usergr_matches, SUDOERS_DEBUG_MATCH);
/* Make sure we have a valid usergroup, sudo style */
if (*group++ != '%') {
@ -566,7 +566,7 @@ static bool
valid_domain(const char *domain)
{
const char *cp;
debug_decl(valid_domain, SUDOERS_DEBUG_MATCH)
debug_decl(valid_domain, SUDOERS_DEBUG_MATCH);
for (cp = domain; *cp != '\0'; cp++) {
/* Check for illegal characters, Linux may use "(none)". */
@ -586,7 +586,7 @@ sudo_getdomainname(void)
{
static char *domain;
static bool initialized;
debug_decl(sudo_getdomainname, SUDOERS_DEBUG_MATCH)
debug_decl(sudo_getdomainname, SUDOERS_DEBUG_MATCH);
if (!initialized) {
size_t host_name_max;
@ -624,7 +624,7 @@ sudo_getdomainname(void)
const char *
sudo_getdomainname(void)
{
debug_decl(sudo_getdomainname, SUDOERS_DEBUG_MATCH)
debug_decl(sudo_getdomainname, SUDOERS_DEBUG_MATCH);
debug_return_ptr(NULL);
}
#endif /* HAVE_GETDOMAINNAME || SI_SRPC_DOMAIN */
@ -641,7 +641,7 @@ netgr_matches(const char *netgr, const char *lhost, const char *shost, const cha
const char *domain;
#endif
bool rc = false;
debug_decl(netgr_matches, SUDOERS_DEBUG_MATCH)
debug_decl(netgr_matches, SUDOERS_DEBUG_MATCH);
if (!def_use_netgroups) {
sudo_debug_printf(SUDO_DEBUG_INFO, "netgroups are disabled");

View File

@ -58,7 +58,7 @@ addr_matches_if(const char *n)
unsigned int j;
#endif
unsigned int family;
debug_decl(addr_matches_if, SUDOERS_DEBUG_MATCH)
debug_decl(addr_matches_if, SUDOERS_DEBUG_MATCH);
#ifdef HAVE_STRUCT_IN6_ADDR
if (inet_pton(AF_INET6, n, &addr.ip6) == 1) {
@ -111,7 +111,7 @@ addr_matches_if_netmask(const char *n, const char *m)
#endif
unsigned int family;
const char *errstr;
debug_decl(addr_matches_if, SUDOERS_DEBUG_MATCH)
debug_decl(addr_matches_if, SUDOERS_DEBUG_MATCH);
#ifdef HAVE_STRUCT_IN6_ADDR
if (inet_pton(AF_INET6, n, &addr.ip6) == 1)
@ -197,7 +197,7 @@ addr_matches(char *n)
{
char *m;
bool rc;
debug_decl(addr_matches, SUDOERS_DEBUG_MATCH)
debug_decl(addr_matches, SUDOERS_DEBUG_MATCH);
/* If there's an explicit netmask, use it. */
if ((m = strchr(n, '/'))) {

View File

@ -65,7 +65,7 @@ static bool
command_args_match(const char *sudoers_cmnd, const char *sudoers_args)
{
int flags = 0;
debug_decl(command_args_match, SUDOERS_DEBUG_MATCH)
debug_decl(command_args_match, SUDOERS_DEBUG_MATCH);
/*
* If no args specified in sudoers, any user args are allowed.
@ -93,7 +93,7 @@ command_args_match(const char *sudoers_cmnd, const char *sudoers_args)
static bool
do_stat(int fd, const char *path, struct stat *sb)
{
debug_decl(do_stat, SUDOERS_DEBUG_MATCH)
debug_decl(do_stat, SUDOERS_DEBUG_MATCH);
if (fd != -1)
debug_return_bool(fstat(fd, sb) == 0);
@ -108,7 +108,7 @@ is_script(int fd)
{
bool ret = false;
char magic[2];
debug_decl(is_script, SUDOERS_DEBUG_MATCH)
debug_decl(is_script, SUDOERS_DEBUG_MATCH);
if (read(fd, magic, 2) == 2) {
if (magic[0] == '#' && magic[1] == '!')
@ -129,7 +129,7 @@ static bool
open_cmnd(const char *path, const struct command_digest *digest, int *fdp)
{
int fd = -1;
debug_decl(open_cmnd, SUDOERS_DEBUG_MATCH)
debug_decl(open_cmnd, SUDOERS_DEBUG_MATCH);
/* Only open the file for fdexec or for digest matching. */
if (def_fdexec != always && digest == NULL)
@ -155,7 +155,7 @@ open_cmnd(const char *path, const struct command_digest *digest, int *fdp)
static void
set_cmnd_fd(int fd)
{
debug_decl(set_cmnd_fd, SUDOERS_DEBUG_MATCH)
debug_decl(set_cmnd_fd, SUDOERS_DEBUG_MATCH);
if (cmnd_fd != -1)
close(cmnd_fd);
@ -204,7 +204,7 @@ command_matches_dir(const char *sudoers_dir, size_t dlen,
char buf[PATH_MAX];
int fd = -1;
DIR *dirp;
debug_decl(command_matches_dir, SUDOERS_DEBUG_MATCH)
debug_decl(command_matches_dir, SUDOERS_DEBUG_MATCH);
/*
* Grot through directory entries, looking for user_base.
@ -269,7 +269,7 @@ command_matches_fnmatch(const char *sudoers_cmnd, const char *sudoers_args,
{
struct stat sb; /* XXX - unused */
int fd = -1;
debug_decl(command_matches_fnmatch, SUDOERS_DEBUG_MATCH)
debug_decl(command_matches_fnmatch, SUDOERS_DEBUG_MATCH);
/*
* Return true if fnmatch(3) succeeds AND
@ -313,7 +313,7 @@ command_matches_glob(const char *sudoers_cmnd, const char *sudoers_args,
int fd = -1;
size_t dlen;
glob_t gl;
debug_decl(command_matches_glob, SUDOERS_DEBUG_MATCH)
debug_decl(command_matches_glob, SUDOERS_DEBUG_MATCH);
/*
* First check to see if we can avoid the call to glob(3).
@ -439,7 +439,7 @@ command_matches_normal(const char *sudoers_cmnd, const char *sudoers_args, const
const char *base;
size_t dlen;
int fd = -1;
debug_decl(command_matches_normal, SUDOERS_DEBUG_MATCH)
debug_decl(command_matches_normal, SUDOERS_DEBUG_MATCH);
/* If it ends in '/' it is a directory spec. */
dlen = strlen(sudoers_cmnd);
@ -501,7 +501,7 @@ bool
command_matches(const char *sudoers_cmnd, const char *sudoers_args, const struct command_digest *digest)
{
bool rc = false;
debug_decl(command_matches, SUDOERS_DEBUG_MATCH)
debug_decl(command_matches, SUDOERS_DEBUG_MATCH);
/* Check for pseudo-commands */
if (sudoers_cmnd[0] != '/') {

View File

@ -50,7 +50,7 @@ digest_matches(int fd, const char *file, const struct command_digest *digest)
unsigned char *sudoers_digest = NULL;
bool matched = false;
size_t digest_len;
debug_decl(digest_matches, SUDOERS_DEBUG_MATCH)
debug_decl(digest_matches, SUDOERS_DEBUG_MATCH);
if (fd == -1)
goto done;

View File

@ -59,7 +59,7 @@ sudoers_lookup_pseudo(struct sudo_nss_list *snl, struct passwd *pw,
struct defaults *def;
int nopass;
enum def_tuple pwcheck;
debug_decl(sudoers_lookup_pseudo, SUDOERS_DEBUG_PARSER)
debug_decl(sudoers_lookup_pseudo, SUDOERS_DEBUG_PARSER);
pwcheck = (pwflag == -1) ? never : sudo_defs_table[pwflag].sd_un.tuple;
nopass = (pwcheck == never || pwcheck == all) ? true : false;
@ -128,7 +128,7 @@ sudoers_lookup_check(struct sudo_nss *nss, struct passwd *pw,
struct privilege *priv;
struct userspec *us;
struct member *matching_user;
debug_decl(sudoers_lookup_check, SUDOERS_DEBUG_PARSER)
debug_decl(sudoers_lookup_check, SUDOERS_DEBUG_PARSER);
TAILQ_FOREACH_REVERSE(us, &nss->parse_tree->userspecs, userspec_list, entries) {
if (userlist_matches(nss->parse_tree, pw, &us->users) != ALLOW)
@ -187,7 +187,7 @@ sudoers_lookup_check(struct sudo_nss *nss, struct passwd *pw,
static bool
apply_cmndspec(struct cmndspec *cs)
{
debug_decl(apply_cmndspec, SUDOERS_DEBUG_PARSER)
debug_decl(apply_cmndspec, SUDOERS_DEBUG_PARSER);
if (cs != NULL) {
#ifdef HAVE_SELINUX
@ -286,7 +286,7 @@ sudoers_lookup(struct sudo_nss_list *snl, struct passwd *pw, int validated,
struct sudo_nss *nss;
int m, match = UNSPEC;
time_t now;
debug_decl(sudoers_lookup, SUDOERS_DEBUG_PARSER)
debug_decl(sudoers_lookup, SUDOERS_DEBUG_PARSER);
/*
* Special case checking the "validate", "list" and "kill" pseudo-commands.
@ -337,7 +337,7 @@ display_priv_short(struct sudoers_parse_tree *parse_tree, struct passwd *pw,
{
struct privilege *priv;
int nfound = 0;
debug_decl(display_priv_short, SUDOERS_DEBUG_PARSER)
debug_decl(display_priv_short, SUDOERS_DEBUG_PARSER);
TAILQ_FOREACH(priv, &us->privileges, entries) {
struct cmndspec *cs, *prev_cs = NULL;
@ -397,7 +397,7 @@ display_priv_short(struct sudoers_parse_tree *parse_tree, struct passwd *pw,
static bool
new_long_entry(struct cmndspec *cs, struct cmndspec *prev_cs)
{
debug_decl(new_long_entry, SUDOERS_DEBUG_PARSER)
debug_decl(new_long_entry, SUDOERS_DEBUG_PARSER);
if (prev_cs == NULL)
debug_return_bool(true);
@ -430,7 +430,7 @@ display_priv_long(struct sudoers_parse_tree *parse_tree, struct passwd *pw,
{
struct privilege *priv;
int nfound = 0;
debug_decl(display_priv_long, SUDOERS_DEBUG_PARSER)
debug_decl(display_priv_long, SUDOERS_DEBUG_PARSER);
TAILQ_FOREACH(priv, &us->privileges, entries) {
struct cmndspec *cs, *prev_cs;
@ -545,7 +545,7 @@ sudo_display_userspecs(struct sudoers_parse_tree *parse_tree, struct passwd *pw,
{
struct userspec *us;
int nfound = 0;
debug_decl(sudo_display_userspecs, SUDOERS_DEBUG_PARSER)
debug_decl(sudo_display_userspecs, SUDOERS_DEBUG_PARSER);
TAILQ_FOREACH(us, &parse_tree->userspecs, entries) {
if (userlist_matches(parse_tree, pw, &us->users) != ALLOW)
@ -571,7 +571,7 @@ display_defaults(struct sudoers_parse_tree *parse_tree, struct passwd *pw,
struct defaults *d;
char *prefix;
int nfound = 0;
debug_decl(display_defaults, SUDOERS_DEBUG_PARSER)
debug_decl(display_defaults, SUDOERS_DEBUG_PARSER);
if (lbuf->len == 0 || isspace((unsigned char)lbuf->buf[lbuf->len - 1]))
prefix = " ";
@ -614,7 +614,7 @@ display_bound_defaults_by_type(struct sudoers_parse_tree *parse_tree,
struct member *m;
char *dsep;
int atype, nfound = 0;
debug_decl(display_bound_defaults_by_type, SUDOERS_DEBUG_PARSER)
debug_decl(display_bound_defaults_by_type, SUDOERS_DEBUG_PARSER);
switch (deftype) {
case DEFAULTS_HOST:
@ -670,7 +670,7 @@ display_bound_defaults(struct sudoers_parse_tree *parse_tree,
struct passwd *pw, struct sudo_lbuf *lbuf)
{
int nfound = 0;
debug_decl(display_bound_defaults, SUDOERS_DEBUG_PARSER)
debug_decl(display_bound_defaults, SUDOERS_DEBUG_PARSER);
/* XXX - should only print ones that match what the user can do. */
nfound += display_bound_defaults_by_type(parse_tree, DEFAULTS_RUNAS, lbuf);
@ -686,7 +686,7 @@ output(const char *buf)
{
struct sudo_conv_message msg;
struct sudo_conv_reply repl;
debug_decl(output, SUDOERS_DEBUG_NSS)
debug_decl(output, SUDOERS_DEBUG_NSS);
/* Call conversation function */
memset(&msg, 0, sizeof(msg));
@ -709,7 +709,7 @@ display_privs(struct sudo_nss_list *snl, struct passwd *pw, bool verbose)
struct sudo_lbuf def_buf, priv_buf;
struct stat sb;
int cols, count, olen, n;
debug_decl(display_privs, SUDOERS_DEBUG_PARSER)
debug_decl(display_privs, SUDOERS_DEBUG_PARSER);
cols = sudo_user.cols;
if (fstat(STDOUT_FILENO, &sb) == 0 && S_ISFIFO(sb.st_mode))
@ -796,7 +796,7 @@ display_cmnd_check(struct sudoers_parse_tree *parse_tree, struct passwd *pw,
struct cmndspec *cs;
struct privilege *priv;
struct userspec *us;
debug_decl(display_cmnd_check, SUDOERS_DEBUG_PARSER)
debug_decl(display_cmnd_check, SUDOERS_DEBUG_PARSER);
TAILQ_FOREACH_REVERSE(us, &parse_tree->userspecs, userspec_list, entries) {
if (userlist_matches(parse_tree, pw, &us->users) != ALLOW)
@ -839,7 +839,7 @@ display_cmnd(struct sudo_nss_list *snl, struct passwd *pw)
int m, match = UNSPEC;
int ret = false;
time_t now;
debug_decl(display_cmnd, SUDOERS_DEBUG_PARSER)
debug_decl(display_cmnd, SUDOERS_DEBUG_PARSER);
/* Iterate over each source, checking for the command. */
time(&now);

View File

@ -58,7 +58,7 @@ STAILQ_HEAD(sudo_role_list, sudo_role);
static void
sudo_role_free(struct sudo_role *role)
{
debug_decl(sudo_role_free, SUDOERS_DEBUG_UTIL)
debug_decl(sudo_role_free, SUDOERS_DEBUG_UTIL);
if (role != NULL) {
free(role->cn);
@ -80,7 +80,7 @@ static struct sudo_role *
sudo_role_alloc(void)
{
struct sudo_role *role;
debug_decl(sudo_role_alloc, SUDOERS_DEBUG_UTIL)
debug_decl(sudo_role_alloc, SUDOERS_DEBUG_UTIL);
role = calloc(1, sizeof(*role));
if (role != NULL) {
@ -112,7 +112,7 @@ ldif_parse_attribute(char *line, char **name, char **value)
bool encoded = false;
char *attr, *cp, *ep, *colon;
size_t len;
debug_decl(ldif_parse_attribute, SUDOERS_DEBUG_UTIL)
debug_decl(ldif_parse_attribute, SUDOERS_DEBUG_UTIL);
/* Parse attribute name: [a-zA-Z][a-zA-Z0-9-]*: */
if (!isalpha((unsigned char)*line))
@ -180,7 +180,7 @@ static void
ldif_store_string(const char *str, struct sudoers_str_list *strlist, bool sorted)
{
struct sudoers_string *ls;
debug_decl(ldif_store_string, SUDOERS_DEBUG_UTIL)
debug_decl(ldif_store_string, SUDOERS_DEBUG_UTIL);
if ((ls = sudoers_string_alloc(str)) == NULL) {
sudo_fatalx(U_("%s: %s"), __func__,
@ -231,7 +231,7 @@ role_order_cmp(const void *va, const void *vb)
{
const struct sudo_role *a = *(const struct sudo_role **)va;
const struct sudo_role *b = *(const struct sudo_role **)vb;
debug_decl(role_order_cmp, SUDOERS_DEBUG_LDAP)
debug_decl(role_order_cmp, SUDOERS_DEBUG_LDAP);
debug_return_int(a->order < b->order ? -1 :
(a->order > b->order ? 1 : 0));
@ -247,7 +247,7 @@ ldif_store_options(struct sudoers_parse_tree *parse_tree,
struct defaults *d;
struct sudoers_string *ls;
char *var, *val;
debug_decl(ldif_store_options, SUDOERS_DEBUG_UTIL)
debug_decl(ldif_store_options, SUDOERS_DEBUG_UTIL);
STAILQ_FOREACH(ls, options, entries) {
if ((d = calloc(1, sizeof(*d))) == NULL ||
@ -297,7 +297,7 @@ str_list_cache(struct rbtree *cache, struct sudoers_str_list **strlistp)
struct sudoers_str_list *strlist = *strlistp;
struct rbnode *node;
int ret;
debug_decl(str_list_cache, SUDOERS_DEBUG_UTIL)
debug_decl(str_list_cache, SUDOERS_DEBUG_UTIL);
ret = rbinsert(cache, strlist, &node);
switch (ret) {
@ -328,7 +328,7 @@ role_to_sudoers(struct sudoers_parse_tree *parse_tree, struct sudo_role *role,
struct sudoers_string *ls;
struct userspec *us;
struct member *m;
debug_decl(role_to_sudoers, SUDOERS_DEBUG_UTIL)
debug_decl(role_to_sudoers, SUDOERS_DEBUG_UTIL);
/*
* TODO: use cn to create a UserAlias if multiple users in it?
@ -465,7 +465,7 @@ ldif_to_sudoers(struct sudoers_parse_tree *parse_tree,
{
struct sudo_role **role_array, *role = NULL;
unsigned int n;
debug_decl(ldif_to_sudoers, SUDOERS_DEBUG_UTIL)
debug_decl(ldif_to_sudoers, SUDOERS_DEBUG_UTIL);
/* Convert from list of roles to array and sort by order. */
role_array = reallocarray(NULL, numroles + 1, sizeof(*role_array));
@ -531,7 +531,7 @@ char *unquote_cn(const char *src)
{
char *dst, *new_cn;
size_t len;
debug_decl(unquote_cn, SUDOERS_DEBUG_UTIL)
debug_decl(unquote_cn, SUDOERS_DEBUG_UTIL);
len = strlen(src);
if ((new_cn = malloc(len + 1)) == NULL)
@ -566,7 +566,7 @@ sudoers_parse_ldif(struct sudoers_parse_tree *parse_tree,
ssize_t savedlen = 0;
bool mismatch = false;
int errors = 0;
debug_decl(sudoers_parse_ldif, SUDOERS_DEBUG_UTIL)
debug_decl(sudoers_parse_ldif, SUDOERS_DEBUG_UTIL);
/* Free old contents of the parse tree (if any). */
free_parse_tree(parse_tree);

View File

@ -77,7 +77,7 @@ extern char *login_style;
static int
parse_bool(const char *line, int varlen, int *flags, int fval)
{
debug_decl(parse_bool, SUDOERS_DEBUG_PLUGIN)
debug_decl(parse_bool, SUDOERS_DEBUG_PLUGIN);
switch (sudo_strtobool(line + varlen + 1)) {
case true:
@ -105,7 +105,7 @@ sudoers_policy_deserialize_info(void *v, char **runas_user, char **runas_group)
const char *p, *errstr, *groups = NULL;
const char *remhost = NULL;
int flags = 0;
debug_decl(sudoers_policy_deserialize_info, SUDOERS_DEBUG_PLUGIN)
debug_decl(sudoers_policy_deserialize_info, SUDOERS_DEBUG_PLUGIN);
#define MATCHES(s, v) \
(strncmp((s), (v), sizeof(v) - 1) == 0)
@ -516,7 +516,7 @@ serialize_list(const char *varname, struct list_members *members)
struct list_member *lm, *next;
size_t len, result_size;
char *result;
debug_decl(serialize_list, SUDOERS_DEBUG_PLUGIN)
debug_decl(serialize_list, SUDOERS_DEBUG_PLUGIN);
result_size = strlen(varname) + 1;
SLIST_FOREACH(lm, members, entries) {
@ -558,7 +558,7 @@ sudoers_policy_exec_setup(char *argv[], char *envp[], mode_t cmnd_umask,
struct sudoers_exec_args *exec_args = v;
char **command_info;
int info_len = 0;
debug_decl(sudoers_policy_exec_setup, SUDOERS_DEBUG_PLUGIN)
debug_decl(sudoers_policy_exec_setup, SUDOERS_DEBUG_PLUGIN);
/* Increase the length of command_info as needed, it is *not* checked. */
command_info = calloc(48, sizeof(char *));
@ -830,7 +830,7 @@ sudoers_policy_open(unsigned int version, sudo_conv_t conversation,
struct sudoers_policy_open_info info;
const char *cp, *plugin_path = NULL;
char * const *cur;
debug_decl(sudoers_policy_open, SUDOERS_DEBUG_PLUGIN)
debug_decl(sudoers_policy_open, SUDOERS_DEBUG_PLUGIN);
sudo_version = version;
sudo_conv = conversation;
@ -866,7 +866,7 @@ sudoers_policy_open(unsigned int version, sudo_conv_t conversation,
static void
sudoers_policy_close(int exit_status, int error_code)
{
debug_decl(sudoers_policy_close, SUDOERS_DEBUG_PLUGIN)
debug_decl(sudoers_policy_close, SUDOERS_DEBUG_PLUGIN);
/* We do not currently log the exit status. */
if (error_code) {
@ -915,7 +915,7 @@ sudoers_policy_close(int exit_status, int error_code)
static int
sudoers_policy_init_session(struct passwd *pwd, char **user_env[])
{
debug_decl(sudoers_policy_init_session, SUDOERS_DEBUG_PLUGIN)
debug_decl(sudoers_policy_init_session, SUDOERS_DEBUG_PLUGIN);
/* user_env is only specified for API version 1.2 and higher. */
if (sudo_version < SUDO_API_MKVERSION(1, 2))
@ -930,7 +930,7 @@ sudoers_policy_check(int argc, char * const argv[], char *env_add[],
{
struct sudoers_exec_args exec_args;
int ret;
debug_decl(sudoers_policy_check, SUDOERS_DEBUG_PLUGIN)
debug_decl(sudoers_policy_check, SUDOERS_DEBUG_PLUGIN);
if (!ISSET(sudo_mode, MODE_EDIT))
SET(sudo_mode, MODE_RUN);
@ -952,7 +952,7 @@ sudoers_policy_check(int argc, char * const argv[], char *env_add[],
static int
sudoers_policy_validate(void)
{
debug_decl(sudoers_policy_validate, SUDOERS_DEBUG_PLUGIN)
debug_decl(sudoers_policy_validate, SUDOERS_DEBUG_PLUGIN);
user_cmnd = "validate";
SET(sudo_mode, MODE_VALIDATE);
@ -963,7 +963,7 @@ sudoers_policy_validate(void)
static void
sudoers_policy_invalidate(int remove)
{
debug_decl(sudoers_policy_invalidate, SUDOERS_DEBUG_PLUGIN)
debug_decl(sudoers_policy_invalidate, SUDOERS_DEBUG_PLUGIN);
user_cmnd = "kill";
/* XXX - plugin API should support a return value for fatal errors. */
@ -978,7 +978,7 @@ sudoers_policy_list(int argc, char * const argv[], int verbose,
const char *list_user)
{
int ret;
debug_decl(sudoers_policy_list, SUDOERS_DEBUG_PLUGIN)
debug_decl(sudoers_policy_list, SUDOERS_DEBUG_PLUGIN);
user_cmnd = "list";
if (argc)
@ -1004,7 +1004,7 @@ sudoers_policy_list(int argc, char * const argv[], int verbose,
static int
sudoers_policy_version(int verbose)
{
debug_decl(sudoers_policy_version, SUDOERS_DEBUG_PLUGIN)
debug_decl(sudoers_policy_version, SUDOERS_DEBUG_PLUGIN);
sudo_printf(SUDO_CONV_INFO_MSG, _("Sudoers policy plugin version %s\n"),
PACKAGE_VERSION);

View File

@ -53,7 +53,7 @@ expand_prompt(const char *old_prompt, const char *auth_user)
int subst;
const char *p;
char *np, *new_prompt, *endp;
debug_decl(expand_prompt, SUDOERS_DEBUG_AUTH)
debug_decl(expand_prompt, SUDOERS_DEBUG_AUTH);
/* How much space do we need to malloc for the prompt? */
subst = 0;

View File

@ -92,7 +92,7 @@ void
sudo_pwutil_set_backend(sudo_make_pwitem_t pwitem, sudo_make_gritem_t gritem,
sudo_make_gidlist_item_t gidlist_item, sudo_make_grlist_item_t grlist_item)
{
debug_decl(sudo_pwutil_set_backend, SUDOERS_DEBUG_NSS)
debug_decl(sudo_pwutil_set_backend, SUDOERS_DEBUG_NSS);
make_pwitem = pwitem;
make_gritem = gritem;
@ -158,7 +158,7 @@ cmp_gidlist(const void *v1, const void *v2)
void
sudo_pw_addref(struct passwd *pw)
{
debug_decl(sudo_pw_addref, SUDOERS_DEBUG_NSS)
debug_decl(sudo_pw_addref, SUDOERS_DEBUG_NSS);
ptr_to_item(pw)->refcnt++;
debug_return;
}
@ -167,7 +167,7 @@ static void
sudo_pw_delref_item(void *v)
{
struct cache_item *item = v;
debug_decl(sudo_pw_delref_item, SUDOERS_DEBUG_NSS)
debug_decl(sudo_pw_delref_item, SUDOERS_DEBUG_NSS);
if (--item->refcnt == 0)
free(item);
@ -178,7 +178,7 @@ sudo_pw_delref_item(void *v)
void
sudo_pw_delref(struct passwd *pw)
{
debug_decl(sudo_pw_delref, SUDOERS_DEBUG_NSS)
debug_decl(sudo_pw_delref, SUDOERS_DEBUG_NSS);
sudo_pw_delref_item(ptr_to_item(pw));
debug_return;
}
@ -191,7 +191,7 @@ sudo_getpwuid(uid_t uid)
{
struct cache_item key, *item;
struct rbnode *node;
debug_decl(sudo_getpwuid, SUDOERS_DEBUG_NSS)
debug_decl(sudo_getpwuid, SUDOERS_DEBUG_NSS);
if (pwcache_byuid == NULL) {
pwcache_byuid = rbcreate(cmp_pwuid);
@ -262,7 +262,7 @@ sudo_getpwnam(const char *name)
{
struct cache_item key, *item;
struct rbnode *node;
debug_decl(sudo_getpwnam, SUDOERS_DEBUG_NSS)
debug_decl(sudo_getpwnam, SUDOERS_DEBUG_NSS);
if (pwcache_byname == NULL) {
pwcache_byname = rbcreate(cmp_pwnam);
@ -338,7 +338,7 @@ sudo_mkpwent(const char *user, uid_t uid, gid_t gid, const char *home,
struct passwd *pw;
size_t len, name_len, home_len, shell_len;
int i;
debug_decl(sudo_mkpwent, SUDOERS_DEBUG_NSS)
debug_decl(sudo_mkpwent, SUDOERS_DEBUG_NSS);
if (pwcache_byuid == NULL)
pwcache_byuid = rbcreate(cmp_pwuid);
@ -434,7 +434,7 @@ sudo_fakepwnam(const char *user, gid_t gid)
{
const char *errstr;
uid_t uid;
debug_decl(sudo_fakepwnam, SUDOERS_DEBUG_NSS)
debug_decl(sudo_fakepwnam, SUDOERS_DEBUG_NSS);
uid = (uid_t) sudo_strtoid(user + 1, &errstr);
if (errstr != NULL) {
@ -448,7 +448,7 @@ sudo_fakepwnam(const char *user, gid_t gid)
void
sudo_freepwcache(void)
{
debug_decl(sudo_freepwcache, SUDOERS_DEBUG_NSS)
debug_decl(sudo_freepwcache, SUDOERS_DEBUG_NSS);
if (pwcache_byuid != NULL) {
rbdestroy(pwcache_byuid, sudo_pw_delref_item);
@ -481,7 +481,7 @@ cmp_grgid(const void *v1, const void *v2)
void
sudo_gr_addref(struct group *gr)
{
debug_decl(sudo_gr_addref, SUDOERS_DEBUG_NSS)
debug_decl(sudo_gr_addref, SUDOERS_DEBUG_NSS);
ptr_to_item(gr)->refcnt++;
debug_return;
}
@ -490,7 +490,7 @@ static void
sudo_gr_delref_item(void *v)
{
struct cache_item *item = v;
debug_decl(sudo_gr_delref_item, SUDOERS_DEBUG_NSS)
debug_decl(sudo_gr_delref_item, SUDOERS_DEBUG_NSS);
if (--item->refcnt == 0)
free(item);
@ -501,7 +501,7 @@ sudo_gr_delref_item(void *v)
void
sudo_gr_delref(struct group *gr)
{
debug_decl(sudo_gr_delref, SUDOERS_DEBUG_NSS)
debug_decl(sudo_gr_delref, SUDOERS_DEBUG_NSS);
sudo_gr_delref_item(ptr_to_item(gr));
debug_return;
}
@ -514,7 +514,7 @@ sudo_getgrgid(gid_t gid)
{
struct cache_item key, *item;
struct rbnode *node;
debug_decl(sudo_getgrgid, SUDOERS_DEBUG_NSS)
debug_decl(sudo_getgrgid, SUDOERS_DEBUG_NSS);
if (grcache_bygid == NULL) {
grcache_bygid = rbcreate(cmp_grgid);
@ -578,7 +578,7 @@ sudo_getgrnam(const char *name)
{
struct cache_item key, *item;
struct rbnode *node;
debug_decl(sudo_getgrnam, SUDOERS_DEBUG_NSS)
debug_decl(sudo_getgrnam, SUDOERS_DEBUG_NSS);
if (grcache_byname == NULL) {
grcache_byname = rbcreate(cmp_grnam);
@ -647,7 +647,7 @@ sudo_fakegrnam(const char *group)
struct group *gr;
size_t len, name_len;
int i;
debug_decl(sudo_fakegrnam, SUDOERS_DEBUG_NSS)
debug_decl(sudo_fakegrnam, SUDOERS_DEBUG_NSS);
if (grcache_bygid == NULL)
grcache_bygid = rbcreate(cmp_grgid);
@ -722,7 +722,7 @@ sudo_fakegrnam(const char *group)
void
sudo_gidlist_addref(struct gid_list *gidlist)
{
debug_decl(sudo_gidlist_addref, SUDOERS_DEBUG_NSS)
debug_decl(sudo_gidlist_addref, SUDOERS_DEBUG_NSS);
ptr_to_item(gidlist)->refcnt++;
debug_return;
}
@ -731,7 +731,7 @@ static void
sudo_gidlist_delref_item(void *v)
{
struct cache_item *item = v;
debug_decl(sudo_gidlist_delref_item, SUDOERS_DEBUG_NSS)
debug_decl(sudo_gidlist_delref_item, SUDOERS_DEBUG_NSS);
if (--item->refcnt == 0)
free(item);
@ -742,7 +742,7 @@ sudo_gidlist_delref_item(void *v)
void
sudo_gidlist_delref(struct gid_list *gidlist)
{
debug_decl(sudo_gidlist_delref, SUDOERS_DEBUG_NSS)
debug_decl(sudo_gidlist_delref, SUDOERS_DEBUG_NSS);
sudo_gidlist_delref_item(ptr_to_item(gidlist));
debug_return;
}
@ -750,7 +750,7 @@ sudo_gidlist_delref(struct gid_list *gidlist)
void
sudo_grlist_addref(struct group_list *grlist)
{
debug_decl(sudo_grlist_addref, SUDOERS_DEBUG_NSS)
debug_decl(sudo_grlist_addref, SUDOERS_DEBUG_NSS);
ptr_to_item(grlist)->refcnt++;
debug_return;
}
@ -759,7 +759,7 @@ static void
sudo_grlist_delref_item(void *v)
{
struct cache_item *item = v;
debug_decl(sudo_grlist_delref_item, SUDOERS_DEBUG_NSS)
debug_decl(sudo_grlist_delref_item, SUDOERS_DEBUG_NSS);
if (--item->refcnt == 0)
free(item);
@ -770,7 +770,7 @@ sudo_grlist_delref_item(void *v)
void
sudo_grlist_delref(struct group_list *grlist)
{
debug_decl(sudo_grlist_delref, SUDOERS_DEBUG_NSS)
debug_decl(sudo_grlist_delref, SUDOERS_DEBUG_NSS);
sudo_grlist_delref_item(ptr_to_item(grlist));
debug_return;
}
@ -778,7 +778,7 @@ sudo_grlist_delref(struct group_list *grlist)
void
sudo_freegrcache(void)
{
debug_decl(sudo_freegrcache, SUDOERS_DEBUG_NSS)
debug_decl(sudo_freegrcache, SUDOERS_DEBUG_NSS);
if (grcache_bygid != NULL) {
rbdestroy(grcache_bygid, sudo_gr_delref_item);
@ -805,7 +805,7 @@ sudo_get_grlist(const struct passwd *pw)
{
struct cache_item key, *item;
struct rbnode *node;
debug_decl(sudo_get_grlist, SUDOERS_DEBUG_NSS)
debug_decl(sudo_get_grlist, SUDOERS_DEBUG_NSS);
sudo_debug_printf(SUDO_DEBUG_DEBUG, "%s: looking up group names for %s",
__func__, pw->pw_name);
@ -865,7 +865,7 @@ sudo_set_grlist(struct passwd *pw, char * const *groups)
{
struct cache_item key, *item;
struct rbnode *node;
debug_decl(sudo_set_grlist, SUDOERS_DEBUG_NSS)
debug_decl(sudo_set_grlist, SUDOERS_DEBUG_NSS);
if (grlist_cache == NULL) {
grlist_cache = rbcreate(cmp_pwnam);
@ -906,7 +906,7 @@ sudo_get_gidlist(const struct passwd *pw, unsigned int type)
{
struct cache_item key, *item;
struct rbnode *node;
debug_decl(sudo_get_gidlist, SUDOERS_DEBUG_NSS)
debug_decl(sudo_get_gidlist, SUDOERS_DEBUG_NSS);
sudo_debug_printf(SUDO_DEBUG_DEBUG, "%s: looking up group-IDs for %s",
__func__, pw->pw_name);
@ -967,7 +967,7 @@ sudo_set_gidlist(struct passwd *pw, char * const *gids, unsigned int type)
{
struct cache_item key, *item;
struct rbnode *node;
debug_decl(sudo_set_gidlist, SUDOERS_DEBUG_NSS)
debug_decl(sudo_set_gidlist, SUDOERS_DEBUG_NSS);
if (gidlist_cache == NULL) {
gidlist_cache = rbcreate(cmp_gidlist);
@ -1012,7 +1012,7 @@ user_in_group(const struct passwd *pw, const char *group)
struct group *grp = NULL;
bool matched = false;
int i;
debug_decl(user_in_group, SUDOERS_DEBUG_NSS)
debug_decl(user_in_group, SUDOERS_DEBUG_NSS);
/*
* If it could be a sudo-style group-ID check gids first.

Some files were not shown because too many files have changed in this diff Show More