From 282b9213333164cda741e81138cc568455592832 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 28 Sep 2015 15:34:16 -0600 Subject: [PATCH] Also wrap popen(3). --- src/sudo_noexec.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/sudo_noexec.c b/src/sudo_noexec.c index d36671f29..ab002a82d 100644 --- a/src/sudo_noexec.c +++ b/src/sudo_noexec.c @@ -20,6 +20,8 @@ #include #include +#include +#include #include #ifdef HAVE_SPAWN_H #include @@ -97,10 +99,10 @@ INTERPOSE(fn) DUMMY_VA(execl, const char *, const char *) DUMMY_VA(execle, const char *, const char *) DUMMY_VA(execlp, const char *, const char *) -DUMMY1(system, const char *) DUMMY2(execv, const char *, char * const *) DUMMY2(execvp, const char *, char * const *) DUMMY3(execve, const char *, char * const *, char * const *) +DUMMY1(system, const char *) /* * Private versions of the above. @@ -207,3 +209,12 @@ DUMMY6(_posix_spawnp, pid_t *, const char *, const posix_spawn_file_actions_t *, #ifdef HAVE_POSIX___SPAWNP DUMMY6(__posix_spawnp, pid_t *, const char *, const posix_spawn_file_actions_t *, const posix_spawnattr_t *, char * const *, char * const *) #endif + +/* popen(3) returns FILE *, not int so we can't use a wrapper. */ +__dso_public FILE * +FN_NAME(popen)(const char *c, const char *t) +{ + errno = EACCES; + return NULL; +} +INTERPOSE(popen) -- 2.40.0