mirror of
https://git.code.sf.net/p/ntfs-3g/ntfs-3g.git
synced 2024-11-23 18:14:24 +08:00
Loaded the fuse kernel module with no environment
Avoided leaking the current environment when loading the fuse kernel module
This commit is contained in:
parent
7a0cf11e1c
commit
a07b7edebd
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user