From 0679c76778fb45a90fa7cdd695761f9e74c9362a Mon Sep 17 00:00:00 2001 From: Owen Rafferty Date: Tue, 5 Apr 2022 14:57:02 -0500 Subject: [PATCH] style --- dwl.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/dwl.c b/dwl.c index adecab9..57965ab 100644 --- a/dwl.c +++ b/dwl.c @@ -1122,16 +1122,13 @@ drop_permissions(void) { if (getuid() != geteuid() || getgid() != getegid()) { /* Set the gid and uid in the correct order. */ - if (setgid(getgid()) != 0) { + if (setgid(getgid()) != 0) die("Unable to drop root group, refusing to start"); - } - if (setuid(getuid()) != 0) { + if (setuid(getuid()) != 0) die("Unable to drop root user, refusing to start"); - } } - if (setgid(0) != -1 || setuid(0) != -1) { + if (setgid(0) != -1 || setuid(0) != -1) die("Unable to drop root, refusing to start"); - } } void