diff options
author | Drew DeVault <[email protected]> | 2018-09-03 10:59:18 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2018-09-03 10:59:18 -0400 |
commit | e4afd33d478c14fd82e585eefe36b5576d78c5bb (patch) | |
tree | dd7397f8494a9ef8493674d550bafbc0333a8376 /sway/main.c | |
parent | 7d353813d502d50439a7d50b55304fc835f3c7fd (diff) | |
parent | 073dcb3a8650ee45bb98701fccd6530d9dd1a3f4 (diff) |
Merge pull request #2542 from sghctoma/fix-freebsd-build
FreeBSD fixes
Diffstat (limited to 'sway/main.c')
-rw-r--r-- | sway/main.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sway/main.c b/sway/main.c index 7ed10c86..2f05dc38 100644 --- a/sway/main.c +++ b/sway/main.c @@ -366,13 +366,15 @@ int main(int argc, char **argv) { return 1; } -#ifdef __linux__ +#if defined(__linux__) || defined(__FreeBSD__) if (getuid() != geteuid() || getgid() != getegid()) { +#ifdef __linux__ // Retain capabilities after setuid() if (prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0)) { wlr_log(WLR_ERROR, "Cannot keep caps after setuid()"); exit(EXIT_FAILURE); } +#endif suid = true; } #endif @@ -382,7 +384,7 @@ int main(int argc, char **argv) { detect_proprietary(); detect_raspi(); -#ifdef __linux__ +#if defined(__linux__) || defined(__FreeBSD__) drop_permissions(suid); #endif // handle SIGTERM signals |