diff options
| author | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-04-15 19:14:12 -0700 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@gmail.com> | 2015-04-15 19:14:12 -0700 |
| commit | 21a7e774bba4832848687dbd8d2e0a1df33650ce (patch) | |
| tree | f7258ed063b0fca601e33f7f49417f42f95b9600 /one.cpp | |
| parent | c301d8e43859066155801b44b9953d38e3e36d03 (diff) | |
| download | infinitytier-21a7e774bba4832848687dbd8d2e0a1df33650ce.tar.gz infinitytier-21a7e774bba4832848687dbd8d2e0a1df33650ce.zip | |
Wire API auth token stuff.
Diffstat (limited to 'one.cpp')
| -rw-r--r-- | one.cpp | 18 |
1 files changed, 0 insertions, 18 deletions
@@ -68,7 +68,6 @@ #include "controller/SqliteNetworkController.hpp" #endif -#define ZT1_AUTHTOKEN_SECRET_PATH "authtoken.secret" #define ZT1_PID_PATH "zerotier-one.pid" #define ZT1_CONTROLLER_DB_PATH "controller.db" @@ -643,23 +642,6 @@ int main(int argc,char **argv) } } - std::string authToken; - { - std::string authTokenPath(homeDir + ZT_PATH_SEPARATOR_S + ZT1_AUTHTOKEN_SECRET_PATH); - if (!OSUtils::readFile(authTokenPath.c_str(),authToken)) { - unsigned char foo[24]; - Utils::getSecureRandom(foo,sizeof(foo)); - authToken = ""; - for(unsigned int i=0;i<sizeof(foo);++i) - authToken.push_back("abcdefghijklmnopqrstuvwxyz0123456789"[(unsigned long)foo[i] % 36]); - if (!OSUtils::writeFile(authTokenPath.c_str(),authToken)) { - fprintf(stderr,"%s: cannot create authtoken.secret"ZT_EOL_S,argv[0]); - return 1; - } else OSUtils::lockDownFile(authTokenPath.c_str(),false); - } - } - authToken = Utils::trim(authToken); - #ifdef __UNIX_LIKE__ if (getuid() != 0) { fprintf(stderr,"%s: must be run as root (uid 0)"ZT_EOL_S,argv[0]); |
