You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
118 lines
3.7 KiB
118 lines
3.7 KiB
Index: make-bsd.mk |
|
--- make-bsd.mk.orig 2021-10-28 20:46:58.000000000 +0200 |
|
+++ make-bsd.mk 2021-10-29 22:31:44.421860000 +0200 |
|
@@ -21,10 +21,10 @@ |
|
# C25519 in particular is almost UNUSABLE in heavy testing without it. |
|
node/Salsa20.o node/SHA512.o node/C25519.o node/Poly1305.o: CFLAGS = -Wall -O2 -g -pthread $(INCLUDES) $(DEFS) |
|
else |
|
- CFLAGS?=-O3 -fstack-protector |
|
- CFLAGS+=-Wall -fPIE -fvisibility=hidden -fstack-protector -pthread $(INCLUDES) -DNDEBUG $(DEFS) |
|
- LDFLAGS+=-pie -Wl,-z,relro,-z,now |
|
- STRIP=strip --strip-all |
|
+ CFLAGS?=-O2 |
|
+ CFLAGS+=-fvisibility=hidden -pthread $(INCLUDES) -DNDEBUG $(DEFS) |
|
+ LDFLAGS+= |
|
+ STRIP=true |
|
endif |
|
|
|
ifeq ($(ZT_TRACE),1) |
|
Index: make-linux.mk |
|
--- make-linux.mk.orig 2021-10-29 22:31:44.422241000 +0200 |
|
+++ make-linux.mk 2021-10-29 22:36:13.584666000 +0200 |
|
@@ -68,11 +68,11 @@ |
|
# C25519 in particular is almost UNUSABLE in -O0 even on a 3ghz box! |
|
node/Salsa20.o node/SHA512.o node/C25519.o node/Poly1305.o: CXXFLAGS=-Wall -O2 -g -pthread $(INCLUDES) $(DEFS) |
|
else |
|
- CFLAGS?=-O3 -fstack-protector -fPIE |
|
- override CFLAGS+=-Wall -Wno-deprecated -pthread $(INCLUDES) -DNDEBUG $(DEFS) |
|
- CXXFLAGS?=-O3 -fstack-protector -fPIE |
|
- override CXXFLAGS+=-Wall -Wno-deprecated -std=c++11 -pthread $(INCLUDES) -DNDEBUG $(DEFS) |
|
- LDFLAGS=-pie -Wl,-z,relro,-z,now |
|
+ CFLAGS?=-O2 |
|
+ override CFLAGS+=-pthread $(INCLUDES) -DNDEBUG $(DEFS) |
|
+ CXXFLAGS?=-O2 |
|
+ override CXXFLAGS+=-std=c++11 -pthread $(INCLUDES) -DNDEBUG $(DEFS) |
|
+ LDFLAGS= |
|
endif |
|
|
|
ifeq ($(ZT_QNAP), 1) |
|
Index: osdep/OSUtils.cpp |
|
--- osdep/OSUtils.cpp.orig 2021-10-28 20:46:58.000000000 +0200 |
|
+++ osdep/OSUtils.cpp 2021-10-29 22:31:44.422724000 +0200 |
|
@@ -368,75 +368,7 @@ |
|
|
|
std::string OSUtils::platformDefaultHomePath() |
|
{ |
|
-#ifdef __QNAP__ |
|
- char *cmd = "/sbin/getcfg zerotier Install_Path -f /etc/config/qpkg.conf"; |
|
- char buf[128]; |
|
- FILE *fp; |
|
- if ((fp = popen(cmd, "r")) == NULL) { |
|
- printf("Error opening pipe!\n"); |
|
- return NULL; |
|
- } |
|
- while (fgets(buf, 128, fp) != NULL) { } |
|
- if(pclose(fp)) { |
|
- printf("Command not found or exited with error status\n"); |
|
- return NULL; |
|
- } |
|
- std::string homeDir = std::string(buf); |
|
- homeDir.erase(std::remove(homeDir.begin(), homeDir.end(), '\n'), homeDir.end()); |
|
- return homeDir; |
|
-#endif |
|
-#ifdef __UBIQUITI__ |
|
- // Only persistent location after firmware upgrades |
|
- return std::string("/config/zerotier-one"); |
|
-#endif |
|
- |
|
- // Check for user-defined environment variable before using defaults |
|
-#ifdef __WINDOWS__ |
|
- DWORD bufferSize = 65535; |
|
- std::string userDefinedPath; |
|
- bufferSize = GetEnvironmentVariable("ZEROTIER_HOME", &userDefinedPath[0], bufferSize); |
|
- if (bufferSize) { |
|
- return userDefinedPath; |
|
- } |
|
-#else |
|
- if(const char* userDefinedPath = getenv("ZEROTIER_HOME")) { |
|
- return std::string(userDefinedPath); |
|
- } |
|
-#endif |
|
- |
|
- // Finally, resort to using default paths if no user-defined path was provided |
|
-#ifdef __UNIX_LIKE__ |
|
- |
|
-#ifdef __APPLE__ |
|
- // /Library/... on Apple |
|
- return std::string("/Library/Application Support/ZeroTier/One"); |
|
-#else |
|
- |
|
-#ifdef __BSD__ |
|
- // BSD likes /var/db instead of /var/lib |
|
- return std::string("/var/db/zerotier-one"); |
|
-#else |
|
- // Use /var/lib for Linux and other *nix |
|
- return std::string("/var/lib/zerotier-one"); |
|
-#endif |
|
- |
|
-#endif |
|
- |
|
-#else // not __UNIX_LIKE__ |
|
- |
|
-#ifdef __WINDOWS__ |
|
- // Look up app data folder on Windows, e.g. C:\ProgramData\... |
|
- char buf[16384]; |
|
- if (SUCCEEDED(SHGetFolderPathA(NULL,CSIDL_COMMON_APPDATA,NULL,0,buf))) |
|
- return (std::string(buf) + "\\ZeroTier\\One"); |
|
- else return std::string("C:\\ZeroTier\\One"); |
|
-#else |
|
- |
|
- return (std::string(ZT_PATH_SEPARATOR_S) + "ZeroTier" + ZT_PATH_SEPARATOR_S + "One"); // UNKNOWN PLATFORM |
|
- |
|
-#endif |
|
- |
|
-#endif // __UNIX_LIKE__ or not... |
|
+ return std::string("@l_prefix@/var/zerotier/db"); |
|
} |
|
|
|
#ifndef OMIT_JSON_SUPPORT
|
|
|