mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-22 01:49:11 +00:00
Only define _PATH_ENVIRONMENT on systems where we use /etc/environment.
This commit is contained in:
parent
0c67456923
commit
f2d267bfb4
@ -53,7 +53,8 @@
|
||||
# define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin"
|
||||
#endif /* _PATH_STDPATH */
|
||||
|
||||
#ifndef _PATH_ENVIRONMENT
|
||||
/* Use /etc/environment on AIX or Linux w/o PAM (where pam_env handles it). */
|
||||
#if defined(_AIX) || (defined(__linux__) && !defined(HAVE_PAM))
|
||||
# define _PATH_ENVIRONMENT "/etc/environment"
|
||||
#endif /* _PATH_ENVIRONMENT */
|
||||
|
||||
|
@ -911,7 +911,7 @@ rebuild_env(const struct sudoers_context *ctx)
|
||||
}
|
||||
}
|
||||
#endif /* HAVE_LOGIN_CAP_H */
|
||||
#if defined(_AIX) || (defined(__linux__) && !defined(HAVE_PAM))
|
||||
#ifdef _PATH_ENVIRONMENT
|
||||
/* Insert system-wide environment variables. */
|
||||
if (!read_env_file(ctx, _PATH_ENVIRONMENT, true, false))
|
||||
sudo_warn("%s", _PATH_ENVIRONMENT);
|
||||
|
@ -725,7 +725,7 @@ sudoers_check_cmnd(int argc, char * const argv[], char *env_add[],
|
||||
sudoers_ctx.runas.argc++;
|
||||
}
|
||||
|
||||
#if defined(_AIX) || (defined(__linux__) && !defined(HAVE_PAM))
|
||||
#ifdef _PATH_ENVIRONMENT
|
||||
/* Insert system-wide environment variables. */
|
||||
if (!read_env_file(&sudoers_ctx, _PATH_ENVIRONMENT, true, false))
|
||||
sudo_warn("%s", _PATH_ENVIRONMENT);
|
||||
|
Loading…
x
Reference in New Issue
Block a user