From e959ee61fcbcb5c182768caba7079ff1baccb916 Mon Sep 17 00:00:00 2001 From: Rongsong Shen Date: Mon, 10 Aug 2026 10:58:15 +0000 Subject: [PATCH] fix(worker): default logdir to /tmp when -l not given MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit logdir was NULL without -l flag, causing stat(NULL)/mkdir(NULL) → EFAULT. Set default to /tmp after argument parsing, before directory creation. --- src/worker/src/main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/worker/src/main.c b/src/worker/src/main.c index 36559e3a..4beaaf42 100644 --- a/src/worker/src/main.c +++ b/src/worker/src/main.c @@ -376,6 +376,10 @@ int main(int argc, char* argv[]) * without requiring root privileges. */ check_user(); + if (logdir == NULL) { + logdir = strdup("/tmp"); + } + /* P2.5-5: populate and validate xce_cluster_config_t when --peers given */ if (peers_str) { if (xce_parse_peers(peers_str, &cluster_cfg) != 0) {