Loaded the fuse kernel module with no environment

Avoided leaking the current environment when loading the fuse kernel
module
This commit is contained in:
Jean-Pierre André 2017-02-11 11:03:02 +01:00
parent 7a0cf11e1c
commit a07b7edebd
2 changed files with 4 additions and 2 deletions

View File

@ -4125,13 +4125,14 @@ static fuse_fstype load_fuse_module(void)
struct stat st;
pid_t pid;
const char *cmd = "/sbin/modprobe";
char *env = (char*)NULL;
struct timespec req = { 0, 100000000 }; /* 100 msec */
fuse_fstype fstype;
if (!stat(cmd, &st) && !geteuid()) {
pid = fork();
if (!pid) {
execl(cmd, cmd, "fuse", NULL);
execle(cmd, cmd, "fuse", (char*)NULL, &env);
_exit(1);
} else if (pid != -1)
waitpid(pid, NULL, 0);

View File

@ -3920,13 +3920,14 @@ static fuse_fstype load_fuse_module(void)
struct stat st;
pid_t pid;
const char *cmd = "/sbin/modprobe";
char *env = (char*)NULL;
struct timespec req = { 0, 100000000 }; /* 100 msec */
fuse_fstype fstype;
if (!stat(cmd, &st) && !geteuid()) {
pid = fork();
if (!pid) {
execl(cmd, cmd, "fuse", NULL);
execle(cmd, cmd, "fuse", (char*)NULL, &env);
_exit(1);
} else if (pid != -1)
waitpid(pid, NULL, 0);