diff options
author | Adam Ierymenko <adam.ierymenko@zerotier.com> | 2014-10-30 00:12:45 -0700 |
---|---|---|
committer | Adam Ierymenko <adam.ierymenko@zerotier.com> | 2014-10-30 00:12:45 -0700 |
commit | 8f29f19e9817b1c897e7da9f33964d1269238e09 (patch) | |
tree | b9a2810fefab33a4c976faa83be19015ff2aff0b /ZeroTierUI/mainwindow.cpp | |
parent | 5ca20da7afacb6a79c448c5bfb1e2bcd057f0f70 (diff) | |
download | infinitytier-8f29f19e9817b1c897e7da9f33964d1269238e09.tar.gz infinitytier-8f29f19e9817b1c897e7da9f33964d1269238e09.zip |
Fix for UI client.
Diffstat (limited to 'ZeroTierUI/mainwindow.cpp')
-rw-r--r-- | ZeroTierUI/mainwindow.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ZeroTierUI/mainwindow.cpp b/ZeroTierUI/mainwindow.cpp index 3b91a6ff..02162076 100644 --- a/ZeroTierUI/mainwindow.cpp +++ b/ZeroTierUI/mainwindow.cpp @@ -64,6 +64,7 @@ #include "../node/Utils.hpp" #include "../node/Identity.hpp" +#include "../node/Defaults.hpp" // Globally visible ZeroTier::NodeControlClient *zeroTierClient = (ZeroTier::NodeControlClient *)0; @@ -209,10 +210,12 @@ void MainWindow::timerEvent(QTimerEvent *event) // event can be null since code try { std::string buf; - if (ZeroTier::Utils::readFile("/Library/Application Support/ZeroTier/One/identity.public",buf)) { + if (ZeroTier::Utils::readFile((ZeroTier::ZT_DEFAULTS.defaultHomePath + ZT_PATH_SEPARATOR_S + "identity.public").c_str(),buf)) { ZeroTier::Identity id; if (id.fromString(buf)) { std::string authToken(ZeroTier::NodeControlClient::getAuthToken(ZeroTier::NodeControlClient::authTokenDefaultUserPath(),false)); + if (!authToken.length()) + authToken = ZeroTier::NodeControlClient::getAuthToken((ZeroTier::ZT_DEFAULTS.defaultHomePath + ZT_PATH_SEPARATOR_S + "authtoken.secret").c_str(),false); zeroTierClient = new ZeroTier::NodeControlClient((std::string(ZT_IPC_ENDPOINT_BASE) + id.address().toString()).c_str(),authToken.c_str(),&handleZTMessage,this); const char *err = zeroTierClient->error(); if (err) { |