Always define _PATH_SUDO_NOEXEC, _PATH_SUDO_SESH, _PATH_SUDO_PLUGIN_DIR,

even if only defined to NULL.  This means the accessors can always be
present.

Use RTLD_PRELOAD_VAR instead of _PATH_SUDO_NOEXEC to tell when
noexec is available.

Add ENABLE_SUDO_PLUGIN_API and use it instead of _PATH_SUDO_PLUGIN_DIR
to tell when the plugin API is available.

Add sudo_conf_clear_paths() to clear the path values so the
regress tests are not affected by compile-time settings.
This commit is contained in:
Todd C. Miller
2016-11-16 10:13:26 -07:00
parent 8820ff3efb
commit 6dff4ac7fd
12 changed files with 55 additions and 18 deletions

View File

@@ -37,7 +37,7 @@
/* We always use the same name for the sudoers plugin, regardless of the OS */
#define SUDOERS_PLUGIN "sudoers.so"
#ifdef _PATH_SUDO_PLUGIN_DIR
#ifdef ENABLE_SUDO_PLUGIN_API
static int
sudo_stat_plugin(struct plugin_info *info, char *fullpath,
size_t pathsize, struct stat *sb)
@@ -144,7 +144,7 @@ sudo_check_plugin(struct plugin_info *info, char *fullpath, size_t pathsize)
(void)strlcpy(fullpath, info->path, pathsize);
debug_return_bool(true);
}
#endif /* _PATH_SUDO_PLUGIN_DIR */
#endif /* ENABLE_SUDO_PLUGIN_API */
/*
* Load the plugin specified by "info".