From a07b7edebd607a13961db13a18db1cfd6877ffe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Sat, 11 Feb 2017 11:03:02 +0100 Subject: [PATCH] Loaded the fuse kernel module with no environment Avoided leaking the current environment when loading the fuse kernel module --- src/lowntfs-3g.c | 3 ++- src/ntfs-3g.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lowntfs-3g.c b/src/lowntfs-3g.c index e48c43f7..951d4702 100644 --- a/src/lowntfs-3g.c +++ b/src/lowntfs-3g.c @@ -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); diff --git a/src/ntfs-3g.c b/src/ntfs-3g.c index 9140f1ee..411815aa 100644 --- a/src/ntfs-3g.c +++ b/src/ntfs-3g.c @@ -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);