mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-31 14:25:15 +00:00
Go back to a 2 args debug_decl and just use the "default" instance,
now renamed "active".
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1993-1996, 1998-2014 Todd C. Miller <Todd.Miller@courtesan.com>
|
||||
* Copyright (c) 1993-1996, 1998-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
|
||||
@@ -120,7 +120,7 @@ sudoers_policy_init(void *info, char * const envp[])
|
||||
volatile int sources = 0;
|
||||
struct sudo_nss *nss, *nss_next;
|
||||
int rval = -1;
|
||||
debug_decl(sudoers_policy_init, SUDOERS_DEBUG_PLUGIN, sudoers_debug_instance)
|
||||
debug_decl(sudoers_policy_init, SUDOERS_DEBUG_PLUGIN)
|
||||
|
||||
bindtextdomain("sudoers", LOCALEDIR);
|
||||
|
||||
@@ -226,7 +226,7 @@ sudoers_policy_main(int argc, char * const argv[], int pwflag, char *env_add[],
|
||||
struct sudo_nss *nss;
|
||||
int cmnd_status = -1, oldlocale, validated;
|
||||
volatile int rval = true;
|
||||
debug_decl(sudoers_policy_main, SUDOERS_DEBUG_PLUGIN, sudoers_debug_instance)
|
||||
debug_decl(sudoers_policy_main, SUDOERS_DEBUG_PLUGIN)
|
||||
|
||||
/* Is root even allowed to run sudo? */
|
||||
if (user_uid == 0 && !def_root_sudo) {
|
||||
@@ -561,7 +561,7 @@ init_vars(char * const envp[])
|
||||
{
|
||||
char * const * ep;
|
||||
bool unknown_user = false;
|
||||
debug_decl(init_vars, SUDOERS_DEBUG_PLUGIN, sudoers_debug_instance)
|
||||
debug_decl(init_vars, SUDOERS_DEBUG_PLUGIN)
|
||||
|
||||
sudoers_initlocale(setlocale(LC_ALL, NULL), def_sudoers_locale);
|
||||
|
||||
@@ -642,7 +642,7 @@ set_cmnd(void)
|
||||
{
|
||||
int rval = FOUND;
|
||||
char *path = user_path;
|
||||
debug_decl(set_cmnd, SUDOERS_DEBUG_PLUGIN, sudoers_debug_instance)
|
||||
debug_decl(set_cmnd, SUDOERS_DEBUG_PLUGIN)
|
||||
|
||||
/* Allocate user_stat for find_path() and match functions. */
|
||||
user_stat = sudo_ecalloc(1, sizeof(struct stat));
|
||||
@@ -739,7 +739,7 @@ open_sudoers(const char *sudoers, bool doedit, bool *keepopen)
|
||||
{
|
||||
struct stat sb;
|
||||
FILE *fp = NULL;
|
||||
debug_decl(open_sudoers, SUDOERS_DEBUG_PLUGIN, sudoers_debug_instance)
|
||||
debug_decl(open_sudoers, SUDOERS_DEBUG_PLUGIN)
|
||||
|
||||
if (!set_perms(PERM_SUDOERS))
|
||||
debug_return_ptr(NULL);
|
||||
@@ -817,7 +817,7 @@ set_loginclass(struct passwd *pw)
|
||||
const int errflags = SLOG_RAW_MSG;
|
||||
login_cap_t *lc;
|
||||
bool rval = true;
|
||||
debug_decl(set_loginclass, SUDOERS_DEBUG_PLUGIN, sudoers_debug_instance)
|
||||
debug_decl(set_loginclass, SUDOERS_DEBUG_PLUGIN)
|
||||
|
||||
if (!def_use_loginclass)
|
||||
goto done;
|
||||
@@ -875,7 +875,7 @@ set_fqdn(void)
|
||||
struct addrinfo *res0, hint;
|
||||
bool remote;
|
||||
char *p;
|
||||
debug_decl(set_fqdn, SUDOERS_DEBUG_PLUGIN, sudoers_debug_instance)
|
||||
debug_decl(set_fqdn, SUDOERS_DEBUG_PLUGIN)
|
||||
|
||||
/* If the -h flag was given we need to resolve both host and runhost. */
|
||||
remote = strcmp(user_runhost, user_host) != 0;
|
||||
@@ -940,7 +940,7 @@ static bool
|
||||
set_runaspw(const char *user, bool quiet)
|
||||
{
|
||||
struct passwd *pw = NULL;
|
||||
debug_decl(set_runaspw, SUDOERS_DEBUG_PLUGIN, sudoers_debug_instance)
|
||||
debug_decl(set_runaspw, SUDOERS_DEBUG_PLUGIN)
|
||||
|
||||
if (*user == '#') {
|
||||
const char *errstr;
|
||||
@@ -971,7 +971,7 @@ static bool
|
||||
set_runasgr(const char *group, bool quiet)
|
||||
{
|
||||
struct group *gr = NULL;
|
||||
debug_decl(set_runasgr, SUDOERS_DEBUG_PLUGIN, sudoers_debug_instance)
|
||||
debug_decl(set_runasgr, SUDOERS_DEBUG_PLUGIN)
|
||||
|
||||
if (*group == '#') {
|
||||
const char *errstr;
|
||||
@@ -1023,7 +1023,7 @@ void
|
||||
sudoers_cleanup(void)
|
||||
{
|
||||
struct sudo_nss *nss;
|
||||
debug_decl(sudoers_cleanup, SUDOERS_DEBUG_PLUGIN, sudoers_debug_instance)
|
||||
debug_decl(sudoers_cleanup, SUDOERS_DEBUG_PLUGIN)
|
||||
|
||||
if (snl != NULL) {
|
||||
TAILQ_FOREACH(nss, snl, entries) {
|
||||
@@ -1044,7 +1044,7 @@ resolve_editor(const char *ed, size_t edlen, int nfiles, char **files, int *argc
|
||||
char *cp, **nargv, *editor, *editor_path = NULL;
|
||||
int ac, i, nargc;
|
||||
bool wasblank;
|
||||
debug_decl(resolve_editor, SUDOERS_DEBUG_PLUGIN, sudoers_debug_instance)
|
||||
debug_decl(resolve_editor, SUDOERS_DEBUG_PLUGIN)
|
||||
|
||||
/* Note: editor becomes part of argv_out and is not freed. */
|
||||
editor = sudo_emalloc(edlen + 1);
|
||||
@@ -1098,7 +1098,7 @@ find_editor(int nfiles, char **files, int *argc_out, char ***argv_out)
|
||||
const char *cp, *ep, *editor;
|
||||
char *editor_path = NULL, **ev, *ev0[4];
|
||||
size_t len;
|
||||
debug_decl(find_editor, SUDOERS_DEBUG_PLUGIN, sudoers_debug_instance)
|
||||
debug_decl(find_editor, SUDOERS_DEBUG_PLUGIN)
|
||||
|
||||
/*
|
||||
* If any of SUDO_EDITOR, VISUAL or EDITOR are set, choose the first one.
|
||||
@@ -1139,7 +1139,7 @@ create_admin_success_flag(void)
|
||||
struct stat statbuf;
|
||||
char flagfile[PATH_MAX];
|
||||
int fd, n;
|
||||
debug_decl(create_admin_success_flag, SUDOERS_DEBUG_PLUGIN, sudoers_debug_instance)
|
||||
debug_decl(create_admin_success_flag, SUDOERS_DEBUG_PLUGIN)
|
||||
|
||||
/* Check whether the user is in the admin group. */
|
||||
if (!user_in_group(sudo_user.pw, "admin"))
|
||||
|
Reference in New Issue
Block a user