mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-06 20:43:44 +02:00
Fix chown on /var/lib/zerotier-one
This commit is contained in:
parent
360c84e035
commit
8e76363ccf
1 changed files with 2 additions and 2 deletions
|
@ -102,6 +102,8 @@ void dropPrivileges(std::string homeDir) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
createOwnedHomedir(homeDir, targetUser);
|
||||||
|
|
||||||
if (prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_IS_SET, CAP_NET_RAW, 0, 0) < 0) {
|
if (prctl(PR_CAP_AMBIENT, PR_CAP_AMBIENT_IS_SET, CAP_NET_RAW, 0, 0) < 0) {
|
||||||
// Kernel has no support for ambient capabilities.
|
// Kernel has no support for ambient capabilities.
|
||||||
notDropping(homeDir);
|
notDropping(homeDir);
|
||||||
|
@ -113,8 +115,6 @@ void dropPrivileges(std::string homeDir) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
createOwnedHomedir(homeDir, targetUser);
|
|
||||||
|
|
||||||
if (setCapabilities((1 << CAP_NET_ADMIN) | (1 << CAP_NET_RAW) | (1 << CAP_SETUID) | (1 << CAP_SETGID)) < 0) {
|
if (setCapabilities((1 << CAP_NET_ADMIN) | (1 << CAP_NET_RAW) | (1 << CAP_SETUID) | (1 << CAP_SETGID)) < 0) {
|
||||||
fprintf(stderr, "ERROR: failed to set capabilities (not running as real root?)\n");
|
fprintf(stderr, "ERROR: failed to set capabilities (not running as real root?)\n");
|
||||||
exit(1);
|
exit(1);
|
||||||
|
|
Loading…
Add table
Reference in a new issue