From 0ef93581fef15c9b23cef80108ab4fbe10de0f6e Mon Sep 17 00:00:00 2001 From: Tangles Date: Sat, 22 Feb 2020 12:48:31 +1100 Subject: [PATCH] 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* --- dgamelaunch.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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) -- 2.47.3