From: Tangles Date: Sat, 22 Feb 2020 01:48:31 +0000 (+1100) Subject: ACTUALLY try to use the dglroot dir as home if we are doing the chroot X-Git-Tag: v1.6.1-roc-dev~18 X-Git-Url: https://skyeroc.xyz/gitweb/?a=commitdiff_plain;h=0ef93581fef15c9b23cef80108ab4fbe10de0f6e;p=dgamelaunch ACTUALLY try to use the dglroot dir as home if we are doing the chroot ...and fallback to / if it FAILS (not if it succeeds) *facepalm* --- diff --git a/dgamelaunch.c b/dgamelaunch.c index 80178f6..48b4806 100644 --- a/dgamelaunch.c +++ b/dgamelaunch.c @@ -3126,12 +3126,12 @@ main (int argc, char** argv) if (chdir (globalconfig.dglroot)) { perror("warning: cannot chdir to dglroot directory, using / instead"); + if (chdir ("/")) + { + perror ("cannot chdir to root directory"); + graceful_exit (3); + } } - else if (chdir ("/")) - { - perror ("cannot chdir to root directory"); - graceful_exit (3); - } /* shed privs. this is done immediately after chroot. */ if (setgroups (1, &globalconfig.shed_gid) == -1)