fix(worker): default logdir to /tmp when -l not given

logdir was NULL without -l flag, causing stat(NULL)/mkdir(NULL) → EFAULT.
Set default to /tmp after argument parsing, before directory creation.
This commit is contained in:
Rongsong Shen 2026-08-10 10:58:15 +00:00
parent b3124767bb
commit e959ee61fc
Signed by: rshen
SSH key fingerprint: SHA256:8Vf2pZ3h6rJa7EhGK+WaAQ9Mta/apZvteW6g9U/WKKk

View file

@ -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) {