2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 06:15:37 +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

@@ -127,7 +127,7 @@ unlimit_nproc(void)
{
#ifdef __linux__
struct rlimit rl;
debug_decl(unlimit_nproc, SUDOERS_DEBUG_UTIL)
debug_decl(unlimit_nproc, SUDOERS_DEBUG_UTIL);
if (getrlimit(RLIMIT_NPROC, &nproclimit) != 0)
sudo_warn("getrlimit(RLIMIT_NPROC)");
@@ -148,7 +148,7 @@ static void
restore_nproc(void)
{
#ifdef __linux__
debug_decl(restore_nproc, SUDOERS_DEBUG_UTIL)
debug_decl(restore_nproc, SUDOERS_DEBUG_UTIL);
if (setrlimit(RLIMIT_NPROC, &nproclimit) != 0)
sudo_warn("setrlimit(RLIMIT_NPROC)");
@@ -163,7 +163,7 @@ sudoers_policy_init(void *info, char * const envp[])
struct sudo_nss *nss, *nss_next;
int oldlocale, sources = 0;
int ret = -1;
debug_decl(sudoers_policy_init, SUDOERS_DEBUG_PLUGIN)
debug_decl(sudoers_policy_init, SUDOERS_DEBUG_PLUGIN);
bindtextdomain("sudoers", LOCALEDIR);
@@ -247,7 +247,7 @@ format_iolog_path(void)
char *iolog_path = NULL;
int oldlocale;
bool ok;
debug_decl(format_iolog_path, SUDOERS_DEBUG_PLUGIN)
debug_decl(format_iolog_path, SUDOERS_DEBUG_PLUGIN);
/* Use sudoers locale for strftime() */
sudoers_setlocale(SUDOERS_LOCALE_SUDOERS, &oldlocale);
@@ -284,7 +284,7 @@ sudoers_policy_main(int argc, char * const argv[], int pwflag, char *env_add[],
struct sudo_nss *nss;
int cmnd_status = -1, oldlocale, validated;
int ret = -1;
debug_decl(sudoers_policy_main, SUDOERS_DEBUG_PLUGIN)
debug_decl(sudoers_policy_main, SUDOERS_DEBUG_PLUGIN);
sudo_warn_set_locale_func(sudoers_warn_setlocale);
@@ -711,7 +711,7 @@ init_vars(char * const envp[])
{
char * const * ep;
bool unknown_user = false;
debug_decl(init_vars, SUDOERS_DEBUG_PLUGIN)
debug_decl(init_vars, SUDOERS_DEBUG_PLUGIN);
if (!sudoers_initlocale(setlocale(LC_ALL, NULL), def_sudoers_locale)) {
sudo_warnx(U_("%s: %s"), __func__, U_("unable to allocate memory"));
@@ -838,7 +838,7 @@ set_cmnd(void)
struct sudo_nss *nss;
char *path = user_path;
int ret = FOUND;
debug_decl(set_cmnd, SUDOERS_DEBUG_PLUGIN)
debug_decl(set_cmnd, SUDOERS_DEBUG_PLUGIN);
/* Allocate user_stat for find_path() and match functions. */
user_stat = calloc(1, sizeof(struct stat));
@@ -953,7 +953,7 @@ open_sudoers(const char *sudoers, bool doedit, bool *keepopen)
struct stat sb;
FILE *fp = NULL;
bool perm_root = false;
debug_decl(open_sudoers, SUDOERS_DEBUG_PLUGIN)
debug_decl(open_sudoers, SUDOERS_DEBUG_PLUGIN);
if (!set_perms(PERM_SUDOERS))
debug_return_ptr(NULL);
@@ -1050,7 +1050,7 @@ set_loginclass(struct passwd *pw)
const int errflags = SLOG_RAW_MSG;
login_cap_t *lc;
bool ret = true;
debug_decl(set_loginclass, SUDOERS_DEBUG_PLUGIN)
debug_decl(set_loginclass, SUDOERS_DEBUG_PLUGIN);
if (!def_use_loginclass)
goto done;
@@ -1109,7 +1109,7 @@ resolve_host(const char *host, char **longp, char **shortp)
struct addrinfo *res0, hint;
char *cp, *lname, *sname;
int ret;
debug_decl(resolve_host, SUDOERS_DEBUG_PLUGIN)
debug_decl(resolve_host, SUDOERS_DEBUG_PLUGIN);
memset(&hint, 0, sizeof(hint));
hint.ai_family = PF_UNSPEC;
@@ -1147,7 +1147,7 @@ cb_fqdn(const union sudo_defs_val *sd_un)
{
bool remote;
char *lhost, *shost;
debug_decl(cb_fqdn, SUDOERS_DEBUG_PLUGIN)
debug_decl(cb_fqdn, SUDOERS_DEBUG_PLUGIN);
/* Nothing to do if fqdn flag is disabled. */
if (sd_un != NULL && !sd_un->flag)
@@ -1215,7 +1215,7 @@ static bool
set_runaspw(const char *user, bool quiet)
{
struct passwd *pw = NULL;
debug_decl(set_runaspw, SUDOERS_DEBUG_PLUGIN)
debug_decl(set_runaspw, SUDOERS_DEBUG_PLUGIN);
unknown_runas_uid = false;
if (*user == '#') {
@@ -1249,7 +1249,7 @@ static bool
set_runasgr(const char *group, bool quiet)
{
struct group *gr = NULL;
debug_decl(set_runasgr, SUDOERS_DEBUG_PLUGIN)
debug_decl(set_runasgr, SUDOERS_DEBUG_PLUGIN);
unknown_runas_gid = false;
if (*group == '#') {
@@ -1281,7 +1281,7 @@ set_runasgr(const char *group, bool quiet)
static bool
cb_runas_default(const union sudo_defs_val *sd_un)
{
debug_decl(cb_runas_default, SUDOERS_DEBUG_PLUGIN)
debug_decl(cb_runas_default, SUDOERS_DEBUG_PLUGIN);
/* Only reset runaspw if user didn't specify one. */
if (!runas_user && !runas_group)
@@ -1295,7 +1295,7 @@ cb_runas_default(const union sudo_defs_val *sd_un)
static bool
cb_tty_tickets(const union sudo_defs_val *sd_un)
{
debug_decl(cb_tty_tickets, SUDOERS_DEBUG_PLUGIN)
debug_decl(cb_tty_tickets, SUDOERS_DEBUG_PLUGIN);
/* Convert tty_tickets -> timestamp_type */
if (sd_un->flag)
@@ -1311,7 +1311,7 @@ cb_tty_tickets(const union sudo_defs_val *sd_un)
static bool
cb_umask(const union sudo_defs_val *sd_un)
{
debug_decl(cb_umask, SUDOERS_DEBUG_PLUGIN)
debug_decl(cb_umask, SUDOERS_DEBUG_PLUGIN);
/* Force umask if explicitly set in sudoers. */
force_umask = sd_un->mode != ACCESSPERMS;
@@ -1326,7 +1326,7 @@ void
sudoers_cleanup(void)
{
struct sudo_nss *nss;
debug_decl(sudoers_cleanup, SUDOERS_DEBUG_PLUGIN)
debug_decl(sudoers_cleanup, SUDOERS_DEBUG_PLUGIN);
if (snl != NULL) {
TAILQ_FOREACH(nss, snl, entries) {
@@ -1347,7 +1347,7 @@ create_admin_success_flag(void)
{
char flagfile[PATH_MAX];
int len, ret = -1;
debug_decl(create_admin_success_flag, SUDOERS_DEBUG_PLUGIN)
debug_decl(create_admin_success_flag, SUDOERS_DEBUG_PLUGIN);
/* Check whether the user is in the sudo or admin group. */
if (!user_in_group(sudo_user.pw, "sudo") &&
@@ -1383,7 +1383,7 @@ create_admin_success_flag(void)
static bool
tty_present(void)
{
debug_decl(tty_present, SUDOERS_DEBUG_PLUGIN)
debug_decl(tty_present, SUDOERS_DEBUG_PLUGIN);
if (user_ttypath == NULL) {
int fd = open(_PATH_TTY, O_RDWR);