2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-30 22:05:46 +00:00

Add support for multiple Debug lines per program. Callers may

register arbitrary debug facilities or use built-in defaults.  We
now use separate Debug statements for plugins and programs.
This commit is contained in:
Todd C. Miller
2014-10-22 13:23:05 -06:00
parent a7e724b75d
commit 866cfc4fc3
100 changed files with 1509 additions and 949 deletions

View File

@@ -52,7 +52,7 @@ sudo_stat_plugin(struct plugin_info *info, char *fullpath,
size_t pathsize, struct stat *sb)
{
int status = -1;
debug_decl(sudo_stat_plugin, SUDO_DEBUG_PLUGIN)
debug_decl(sudo_stat_plugin, SUDO_DEBUG_PLUGIN, sudo_debug_instance)
if (info->path[0] == '/') {
if (strlcpy(fullpath, info->path, pathsize) >= pathsize) {
@@ -136,7 +136,7 @@ sudo_check_plugin(struct plugin_info *info, char *fullpath, size_t pathsize)
{
struct stat sb;
int rval = false;
debug_decl(sudo_check_plugin, SUDO_DEBUG_PLUGIN)
debug_decl(sudo_check_plugin, SUDO_DEBUG_PLUGIN, sudo_debug_instance)
if (sudo_stat_plugin(info, fullpath, pathsize, &sb) != 0) {
sudo_warnx(U_("error in %s, line %d while loading plugin `%s'"),
@@ -165,7 +165,7 @@ done:
static bool
sudo_check_plugin(struct plugin_info *info, char *fullpath, size_t pathsize)
{
debug_decl(sudo_check_plugin, SUDO_DEBUG_PLUGIN)
debug_decl(sudo_check_plugin, SUDO_DEBUG_PLUGIN, sudo_debug_instance)
(void)strlcpy(fullpath, info->path, pathsize);
debug_return_bool(true);
}
@@ -183,7 +183,7 @@ sudo_load_plugin(struct plugin_container *policy_plugin,
char path[PATH_MAX];
bool rval = false;
void *handle;
debug_decl(sudo_load_plugin, SUDO_DEBUG_PLUGIN)
debug_decl(sudo_load_plugin, SUDO_DEBUG_PLUGIN, sudo_debug_instance)
/* Sanity check plugin and fill in path */
if (!sudo_check_plugin(info, path, sizeof(path)))
@@ -284,7 +284,7 @@ sudo_load_plugins(struct plugin_container *policy_plugin,
struct plugin_info_list *plugins;
struct plugin_info *info;
bool rval = false;
debug_decl(sudo_load_plugins, SUDO_DEBUG_PLUGIN)
debug_decl(sudo_load_plugins, SUDO_DEBUG_PLUGIN, sudo_debug_instance)
/* Walk the plugin list from sudo.conf, if any. */
plugins = sudo_conf_plugins();