From c9e3eebbe2023715a8dadd5333472ac0ff2db104 Mon Sep 17 00:00:00 2001 From: Wen Sun Date: Thu, 23 Nov 2023 20:49:09 +0900 Subject: [PATCH] [ss-manager] Fall back to /tmp if workdir is / --- src/manager.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/manager.c b/src/manager.c index 8a229d09..0c881f0e 100644 --- a/src/manager.c +++ b/src/manager.c @@ -1123,7 +1123,8 @@ main(int argc, char **argv) if (workdir == NULL || strlen(workdir) == 0) { workdir = pw->pw_dir; // If home dir is still not defined or set to nologin/nonexistent, fall back to /tmp - if (workdir == NULL || strlen(workdir) == 0 || strstr(workdir, "nologin") || strstr(workdir, "nonexistent")) { + if (workdir == NULL || strlen(workdir) == 0 || strstr(workdir, "nologin") || + strstr(workdir, "nonexistent") || strcmp(workdir, "/") == 0) { workdir = "/tmp"; }