mirror of
https://codeberg.org/scip/udpxd.git
synced 2025-12-17 03:50:57 +01:00
no chroot in foreground
This commit is contained in:
3
net.c
3
net.c
@@ -136,6 +136,9 @@ int drop_privileges(char *user, char *chrootdir) {
|
|||||||
struct passwd *pw = getpwnam(user);
|
struct passwd *pw = getpwnam(user);
|
||||||
uid_t me = getuid();
|
uid_t me = getuid();
|
||||||
|
|
||||||
|
if(!FORKED)
|
||||||
|
return 0;
|
||||||
|
|
||||||
if ((chdir("/")) < 0) {
|
if ((chdir("/")) < 0) {
|
||||||
perror("failed to chdir to /");
|
perror("failed to chdir to /");
|
||||||
return 1;
|
return 1;
|
||||||
|
|||||||
Reference in New Issue
Block a user