2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 06:15:37 +00:00

Go back to a 2 args debug_decl and just use the "default" instance,

now renamed "active".
This commit is contained in:
Todd C. Miller
2015-02-01 08:24:49 -07:00
parent e71726d0f9
commit 59ab26dbcc
95 changed files with 843 additions and 895 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2014 Todd C. Miller <Todd.Miller@courtesan.com>
* Copyright (c) 2014-2015 Todd C. Miller <Todd.Miller@courtesan.com>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -70,7 +70,7 @@ static struct timestamp_entry timestamp_key;
static bool
ts_match_record(struct timestamp_entry *key, struct timestamp_entry *entry)
{
debug_decl(ts_match_record, SUDOERS_DEBUG_AUTH, sudoers_debug_instance)
debug_decl(ts_match_record, SUDOERS_DEBUG_AUTH)
if (entry->version != key->version)
debug_return_bool(false);
@@ -110,7 +110,7 @@ static bool
ts_find_record(int fd, struct timestamp_entry *key, struct timestamp_entry *entry)
{
struct timestamp_entry cur;
debug_decl(ts_find_record, SUDOERS_DEBUG_AUTH, sudoers_debug_instance)
debug_decl(ts_find_record, SUDOERS_DEBUG_AUTH)
/*
* Look for a matching record.
@@ -145,7 +145,7 @@ ts_update_record(int fd, struct timestamp_entry *entry, off_t timestamp_hint)
struct timestamp_entry cur;
ssize_t nwritten;
off_t old_eof = (off_t)-1;
debug_decl(ts_update_record, SUDOERS_DEBUG_AUTH, sudoers_debug_instance)
debug_decl(ts_update_record, SUDOERS_DEBUG_AUTH)
/* First try the hint if one is given. */
if (timestamp_hint != (off_t)-1) {
@@ -215,7 +215,7 @@ ts_mkdirs(char *path, uid_t owner, mode_t mode, mode_t parent_mode, bool quiet)
gid_t parent_gid = 0;
char *slash = path;
bool rval = false;
debug_decl(ts_mkdirs, SUDOERS_DEBUG_AUTH, sudoers_debug_instance)
debug_decl(ts_mkdirs, SUDOERS_DEBUG_AUTH)
while ((slash = strchr(slash + 1, '/')) != NULL) {
*slash = '\0';
@@ -265,7 +265,7 @@ ts_secure_dir(char *path, bool make_it, bool quiet)
{
struct stat sb;
bool rval = false;
debug_decl(ts_secure_dir, SUDOERS_DEBUG_AUTH, sudoers_debug_instance)
debug_decl(ts_secure_dir, SUDOERS_DEBUG_AUTH)
sudo_debug_printf(SUDO_DEBUG_INFO|SUDO_DEBUG_LINENO, "checking %s", path);
switch (sudo_secure_dir(path, timestamp_uid, -1, &sb)) {
@@ -309,7 +309,7 @@ int
build_timestamp(struct passwd *pw)
{
int len;
debug_decl(build_timestamp, SUDOERS_DEBUG_AUTH, sudoers_debug_instance)
debug_decl(build_timestamp, SUDOERS_DEBUG_AUTH)
len = snprintf(timestamp_file, sizeof(timestamp_file), "%s/%s",
def_timestampdir, user_name);
@@ -333,7 +333,7 @@ update_timestamp(struct passwd *pw)
bool uid_changed = false;
bool rval = false;
int fd;
debug_decl(update_timestamp, SUDOERS_DEBUG_AUTH, sudoers_debug_instance)
debug_decl(update_timestamp, SUDOERS_DEBUG_AUTH)
/* Zero timeout means don't update the time stamp file. */
if (def_timestamp_timeout == 0)
@@ -382,7 +382,7 @@ timestamp_status(struct passwd *pw)
int status = TS_ERROR; /* assume the worst */
struct stat sb;
int fd = -1;
debug_decl(timestamp_status, SUDOERS_DEBUG_AUTH, sudoers_debug_instance)
debug_decl(timestamp_status, SUDOERS_DEBUG_AUTH)
/* Reset time stamp offset hint. */
timestamp_hint = (off_t)-1;
@@ -533,7 +533,7 @@ remove_timestamp(bool unlink_it)
struct timestamp_entry entry;
bool uid_changed = false;
int fd = -1;
debug_decl(remove_timestamp, SUDOERS_DEBUG_AUTH, sudoers_debug_instance)
debug_decl(remove_timestamp, SUDOERS_DEBUG_AUTH)
if (build_timestamp(NULL) == -1)
debug_return;
@@ -602,7 +602,7 @@ already_lectured(int unused)
char status_file[PATH_MAX];
struct stat sb;
int len;
debug_decl(already_lectured, SUDOERS_DEBUG_AUTH, sudoers_debug_instance)
debug_decl(already_lectured, SUDOERS_DEBUG_AUTH)
if (ts_secure_dir(def_lecture_status_dir, false, true)) {
len = snprintf(status_file, sizeof(status_file), "%s/%s",
@@ -626,7 +626,7 @@ set_lectured(void)
char lecture_status[PATH_MAX];
bool uid_changed = false;
int len, fd = -1;
debug_decl(set_lectured, SUDOERS_DEBUG_AUTH, sudoers_debug_instance)
debug_decl(set_lectured, SUDOERS_DEBUG_AUTH)
len = snprintf(lecture_status, sizeof(lecture_status), "%s/%s",
def_lecture_status_dir, user_name);