mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-06 20:43:44 +02:00
Fix build on Linux if PR_CAP_AMBIENT is not defined, which is the case for some libc-dev installs.
This commit is contained in:
parent
3361b4030b
commit
b989c03416
1 changed files with 7 additions and 2 deletions
9
one.cpp
9
one.cpp
|
@ -882,7 +882,13 @@ static void _sighandlerQuit(int sig)
|
||||||
|
|
||||||
// Drop privileges on Linux, if supported by libc etc. and "zerotier-one" user exists on system
|
// Drop privileges on Linux, if supported by libc etc. and "zerotier-one" user exists on system
|
||||||
#ifdef __LINUX__
|
#ifdef __LINUX__
|
||||||
#ifdef PR_CAP_AMBIENT
|
#ifndef PR_CAP_AMBIENT
|
||||||
|
#define PR_CAP_AMBIENT 47
|
||||||
|
#define PR_CAP_AMBIENT_IS_SET 1
|
||||||
|
#define PR_CAP_AMBIENT_RAISE 2
|
||||||
|
#define PR_CAP_AMBIENT_LOWER 3
|
||||||
|
#define PR_CAP_AMBIENT_CLEAR_ALL 4
|
||||||
|
#endif
|
||||||
#define ZT_LINUX_USER "zerotier-one"
|
#define ZT_LINUX_USER "zerotier-one"
|
||||||
#define ZT_HAVE_DROP_PRIVILEGES 1
|
#define ZT_HAVE_DROP_PRIVILEGES 1
|
||||||
namespace {
|
namespace {
|
||||||
|
@ -1013,7 +1019,6 @@ static void dropPrivileges(const char *procName,const std::string &homeDir)
|
||||||
}
|
}
|
||||||
|
|
||||||
} // anonymous namespace
|
} // anonymous namespace
|
||||||
#endif // PR_CAP_AMBIENT
|
|
||||||
#endif // __LINUX__
|
#endif // __LINUX__
|
||||||
|
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
|
Loading…
Add table
Reference in a new issue