Move preload_dso() to its own file and rename to sudo_preload_dso().

It now takes an intercept fd as an optional argument instead of a
list of extra variables to add.  This lets us check whether it is
already set to the expected value (and add it if not).
sudo_intercept.so now uses sudo_preload_dso() to make sure that
LD_PRELOAD and SUDO_INTERCEPT_FD are set properly before executing.
This commit is contained in:
Todd C. Miller
2021-08-09 15:50:25 -06:00
parent 60e76e3e35
commit 9c3df47da9
7 changed files with 290 additions and 169 deletions

View File

@@ -117,4 +117,7 @@ bool utmp_login(const char *from_line, const char *to_line, int ttyfd,
const char *user);
bool utmp_logout(const char *line, int status);
/* exec_preload.c */
char **sudo_preload_dso(char *envp[], const char *dso_file, int intercept_fd);
#endif /* SUDO_EXEC_H */