Separate sudo.conf parsing from plugin loading and move the parse

functions into the common lib so that visudo, etc. can use them.
This commit is contained in:
Todd C. Miller
2011-12-20 08:50:07 -05:00
parent fb3c9f2ca5
commit 1c3965f534
7 changed files with 27 additions and 212 deletions

View File

@@ -209,7 +209,7 @@ main(int argc, char *argv[], char *envp[])
user_info = get_user_info(&user_details);
/* Read sudo.conf. */
sudo_read_conf();
sudo_conf_read();
/* Parse command line arguments. */
sudo_mode = parse_args(argc, argv, &nargc, &nargv, &settings, &env_add);
@@ -884,13 +884,13 @@ disable_execute(struct command_details *details)
*/
# if defined(__darwin__) || defined(__APPLE__)
nenvp[env_len++] = "DYLD_FORCE_FLAT_NAMESPACE=";
cp = fmt_string("DYLD_INSERT_LIBRARIES", noexec_path);
cp = fmt_string("DYLD_INSERT_LIBRARIES", sudo_conf_noexec_path());
# elif defined(__osf__) || defined(__sgi)
easprintf(&cp, "_RLD_LIST=%s:DEFAULT", noexec_path);
easprintf(&cp, "_RLD_LIST=%s:DEFAULT", sudo_conf_noexec_path());
# elif defined(_AIX)
cp = fmt_string("LDR_PRELOAD", noexec_path);
cp = fmt_string("LDR_PRELOAD", sudo_conf_noexec_path());
# else
cp = fmt_string("LD_PRELOAD", noexec_path);
cp = fmt_string("LD_PRELOAD", sudo_conf_noexec_path());
# endif
if (cp == NULL)
error(1, NULL);