[ss-manager] Fall back to /tmp if workdir is /

This commit is contained in:
Wen Sun
2023-11-23 20:49:09 +09:00
parent d83ace0f0d
commit c9e3eebbe2
+2 -1
View File
@@ -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";
}