Simplify pipePath fix

This commit is contained in:
Stuart D. Gathman 2019-05-08 12:10:06 -04:00
parent e404547283
commit 1883f3d376

View File

@ -1,6 +1,6 @@
diff -up ./client/cjdroute2.c.genconf ./client/cjdroute2.c
--- ./client/cjdroute2.c.genconf 2018-04-18 03:35:41.000000000 -0400
+++ ./client/cjdroute2.c 2019-05-03 15:01:41.178368417 -0400
+++ ./client/cjdroute2.c 2019-05-04 12:57:06.880045566 -0400
@@ -334,7 +334,7 @@ static int genconf(struct Random* rand,
" // and ETHInterface will be unable to hot-add new interfaces\n"
" // Use { \"setuser\": 0 } to disable.\n"
@ -19,15 +19,14 @@ diff -up ./client/cjdroute2.c.genconf ./client/cjdroute2.c
}
printf("\n"
" // Nofiles is a deprecated security feature which prevents cjdns from opening\n"
@@ -647,11 +647,13 @@ int main(int argc, char** argv)
@@ -647,11 +647,12 @@ int main(int argc, char** argv)
char corePipeName[64] = "client-core-";
Random_base32(rand, (uint8_t*)corePipeName+CString_strlen(corePipeName), 31);
String* pipePath = Dict_getStringC(&config, "pipe");
+ String path;
+ String* path = String_CONST(Pipe_PATH);
if (!pipePath) {
- pipePath = String_CONST(Pipe_PATH);
+ path = *String_CONST(Pipe_PATH);
+ pipePath = &path;
+ pipePath = path;
}
if (!Defined(win32) && access(pipePath->bytes, W_OK)) {
- Except_throw(eh, "Can't have writable permission to pipe directory.");