Minor fix of code duplication.

Removes 3~ lines of code that didn't need to be restated.
This commit is contained in:
hugbubby 2019-03-01 12:14:14 -06:00 committed by Drew DeVault
parent 9593c72616
commit e0cdcad9a7
1 changed files with 1 additions and 5 deletions

View File

@ -186,11 +186,7 @@ static void log_kernel(void) {
static bool drop_permissions(void) {
if (getuid() != geteuid() || getgid() != getegid()) {
if (setgid(getgid()) != 0) {
sway_log(SWAY_ERROR, "Unable to drop root, refusing to start");
return false;
}
if (setuid(getuid()) != 0) {
if (setuid(getuid()) != 0 || setgid(getgid()) != 0) {
sway_log(SWAY_ERROR, "Unable to drop root, refusing to start");
return false;
}