diff options
author | hugbubby <hugbubby@github.com> | 2019-03-01 12:14:14 -0600 |
---|---|---|
committer | emersion <contact@emersion.fr> | 2019-03-02 00:49:02 +0100 |
commit | 37f0e1f1a2cc8e072c8e01e0769c62c536b8295b (patch) | |
tree | 6d52e897dd35a6094a71144d6ed5288d9418bb4d /sway/main.c | |
parent | ci: use scdoc-git because 1.9.1 is broken (diff) | |
download | sway-37f0e1f1a2cc8e072c8e01e0769c62c536b8295b.tar.gz sway-37f0e1f1a2cc8e072c8e01e0769c62c536b8295b.tar.zst sway-37f0e1f1a2cc8e072c8e01e0769c62c536b8295b.zip |
Minor fix of code duplication.
Removes 3~ lines of code that didn't need to be restated.
Diffstat (limited to 'sway/main.c')
-rw-r--r-- | sway/main.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/sway/main.c b/sway/main.c index 6754190f..22b72813 100644 --- a/sway/main.c +++ b/sway/main.c | |||
@@ -186,11 +186,7 @@ static void log_kernel(void) { | |||
186 | 186 | ||
187 | static bool drop_permissions(void) { | 187 | static bool drop_permissions(void) { |
188 | if (getuid() != geteuid() || getgid() != getegid()) { | 188 | if (getuid() != geteuid() || getgid() != getegid()) { |
189 | if (setgid(getgid()) != 0) { | 189 | if (setuid(getuid()) != 0 || setgid(getgid()) != 0) { |
190 | sway_log(SWAY_ERROR, "Unable to drop root, refusing to start"); | ||
191 | return false; | ||
192 | } | ||
193 | if (setuid(getuid()) != 0) { | ||
194 | sway_log(SWAY_ERROR, "Unable to drop root, refusing to start"); | 190 | sway_log(SWAY_ERROR, "Unable to drop root, refusing to start"); |
195 | return false; | 191 | return false; |
196 | } | 192 | } |