diff options
-rw-r--r-- | utils/mount/network.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/utils/mount/network.c b/utils/mount/network.c index 7240ca7..0d12613 100644 --- a/utils/mount/network.c +++ b/utils/mount/network.c @@ -795,6 +795,7 @@ int start_statd(void) if (S_ISREG(stb.st_mode) && (stb.st_mode & S_IXUSR)) { int cnt = STATD_TIMEOUT * 10; int status = 0; + char * const envp[1] = { NULL }; const struct timespec ts = { .tv_sec = 0, .tv_nsec = 100000000, @@ -802,7 +803,9 @@ int start_statd(void) pid_t pid = fork(); switch (pid) { case 0: /* child */ - execl(START_STATD, START_STATD, NULL); + setgid(0); + setuid(0); + execle(START_STATD, START_STATD, NULL, envp); exit(1); case -1: /* error */ nfs_error(_("%s: fork failed: %s"), |