From 27c5f04d68003774b9a85eb7047c683cbb64f0df Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Sat, 16 May 2015 14:52:09 -0700 Subject: [PATCH] Add -U option to skip root check and permit run as non-privileged user. --- one.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/one.cpp b/one.cpp index 54145d037..d6da3a26d 100644 --- a/one.cpp +++ b/one.cpp @@ -881,6 +881,7 @@ static void printHelp(const char *cn,FILE *out) fprintf(out,"Available switches:"ZT_EOL_S); fprintf(out," -h - Display this help"ZT_EOL_S); fprintf(out," -v - Show version"ZT_EOL_S); + fprintf(out," -U - Run as unprivileged user (skip privilege check)"ZT_EOL_S); fprintf(out," -p - Port for UDP and TCP/HTTP (default: 9993)"ZT_EOL_S); //fprintf(out," -T - Override root topology, do not authenticate or update"ZT_EOL_S); #ifdef __UNIX_LIKE__ @@ -945,6 +946,7 @@ int main(int argc,char **argv) std::string overrideRootTopology; std::string homeDir; unsigned int port = ZT1_DEFAULT_PORT; + bool skipRootCheck = false; for(int i=1;i