Add debug_decl/debug_return (almost) everywhere.

Remove old sudo_debug() and convert users to sudo_debug_printf().
This commit is contained in:
Todd C. Miller
2011-10-22 14:40:21 -04:00
parent 9923464d96
commit 839919566e
72 changed files with 1745 additions and 968 deletions

View File

@@ -63,6 +63,7 @@ find_path(char *infile, char **outfile, struct stat *sbp, char *path,
char *result = NULL; /* result of path/file lookup */
int checkdot = 0; /* check current dir? */
int len; /* length parameter */
debug_decl(find_path, SUDO_DEBUG_UTIL)
if (strlen(infile) >= PATH_MAX)
errorx(1, _("%s: %s"), infile, strerror(ENAMETOOLONG));
@@ -75,13 +76,13 @@ find_path(char *infile, char **outfile, struct stat *sbp, char *path,
strlcpy(command, infile, sizeof(command)); /* paranoia */
if (sudo_goodpath(command, sbp)) {
*outfile = command;
return FOUND;
debug_return_int(FOUND);
} else
return NOT_FOUND;
debug_return_int(NOT_FOUND);
}
if (path == NULL)
return NOT_FOUND;
debug_return_int(NOT_FOUND);
path = estrdup(path);
origpath = path;
@@ -122,12 +123,12 @@ find_path(char *infile, char **outfile, struct stat *sbp, char *path,
errorx(1, _("%s: %s"), infile, strerror(ENAMETOOLONG));
result = sudo_goodpath(command, sbp);
if (result && ignore_dot)
return NOT_FOUND_DOT;
debug_return_int(NOT_FOUND_DOT);
}
if (result) {
*outfile = result;
return FOUND;
debug_return_int(FOUND);
} else
return NOT_FOUND;
debug_return_int(NOT_FOUND);
}