commit 22b4547217ce327a408d607b845fd955be9f0446 from: Stefan Sperling via: Thomas Adam date: Fri Mar 21 13:22:46 2025 UTC we can now greatly simplify the conditional which guards reading of gotd.conf commit - e49ea032f80f15db7a7534b3ad0f5bfd0aae321c commit + 22b4547217ce327a408d607b845fd955be9f0446 blob - fdbcd0891fe736f8ee82c9dc8e62d367feb3032d blob + 58119451870b16726cef889fe7076e96df4bac7b --- gotd/gotd.c +++ gotd/gotd.c @@ -3033,11 +3033,7 @@ main(int argc, char **argv) } } - if (proc_id != GOTD_PROC_LISTEN && proc_id != GOTD_PROC_AUTH && - proc_id != GOTD_PROC_REPO_WRITE && - proc_id != GOTD_PROC_REPO_READ && - proc_id != GOTD_PROC_SESSION_WRITE && proc_id != GOTD_PROC_NOTIFY && - proc_id != GOTD_PROC_SESSION_READ) { + if (proc_id == GOTD_PROC_GOTD) { if (gotd_parse_config(confpath, proc_id, secrets, &gotd) != 0) return 1; @@ -3083,13 +3079,11 @@ main(int argc, char **argv) return 0; } - if (proc_id == GOTD_PROC_GOTD) { - gotd_socket = unix_socket_listen(gotd.unix_socket_path, - pw->pw_uid, pw->pw_gid); - if (gotd_socket == -1) { - fatal("cannot listen on unix socket %s", - gotd.unix_socket_path); - } + gotd_socket = unix_socket_listen(gotd.unix_socket_path, + pw->pw_uid, pw->pw_gid); + if (gotd_socket == -1) { + fatal("cannot listen on unix socket %s", + gotd.unix_socket_path); } if (gethostname(hostname, sizeof(hostname)) == -1)