no chroot in foreground

This commit is contained in:
Thomas von Dein
2015-04-27 20:13:38 +02:00
parent 0e7cf84fc3
commit 479f954986

3
net.c
View File

@@ -136,6 +136,9 @@ int drop_privileges(char *user, char *chrootdir) {
struct passwd *pw = getpwnam(user);
uid_t me = getuid();
if(!FORKED)
return 0;
if ((chdir("/")) < 0) {
perror("failed to chdir to /");
return 1;