mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-16 18:03:22 +00:00
24 lines
792 B
Diff
24 lines
792 B
Diff
|
diff --git a/src/main/main.c b/src/main/main.c
|
||
|
index eec3c3e4..4169112b 100644
|
||
|
--- a/src/main/main.c
|
||
|
+++ b/src/main/main.c
|
||
|
@@ -337,10 +337,14 @@ main(int argc, char **argv)
|
||
|
char dirnamebuf[POOLMAXPATHLEN + 1];
|
||
|
char *dirp;
|
||
|
|
||
|
- strlcpy(dirnamebuf, conf_file, sizeof(dirnamebuf));
|
||
|
- dirp = dirname(dirnamebuf);
|
||
|
- snprintf(pool_passwd, sizeof(pool_passwd), "%s/%s",
|
||
|
- dirp, pool_config->pool_passwd);
|
||
|
+ if (pool_config->pool_passwd[0] != '/') {
|
||
|
+ strlcpy(dirnamebuf, conf_file, sizeof(dirnamebuf));
|
||
|
+ dirp = dirname(dirnamebuf);
|
||
|
+ snprintf(pool_passwd, sizeof(pool_passwd), "%s/%s",
|
||
|
+ dirp, pool_config->pool_passwd);
|
||
|
+ } else
|
||
|
+ strlcpy(pool_passwd, pool_config->pool_passwd,
|
||
|
+ sizeof(pool_passwd));
|
||
|
pool_init_pool_passwd(pool_passwd, POOL_PASSWD_R);
|
||
|
}
|
||
|
|