From 110868ec4ebe60521d5a4ced63feca6a1cf0aa2a Mon Sep 17 00:00:00 2001
From: Dirk Engling <erdgeist@erdgeist.org>
Date: Mon, 23 Aug 2021 18:12:23 +0200
Subject: Fix return code check inversion introduced in last commit

---
 opentracker.c | 12 ++----------
 1 file changed, 2 insertions(+), 10 deletions(-)

diff --git a/opentracker.c b/opentracker.c
index 2bb66fa..a5ba7d3 100644
--- a/opentracker.c
+++ b/opentracker.c
@@ -559,20 +559,12 @@ int drop_privileges ( const char * const serveruser, const char * const serverdi
     /* If we can't find server user, revert to nobody's default uid */
     if( !pws ) {
       fprintf( stderr, "Warning: Could not get password entry for %s. Reverting to uid -2.\n", serveruser );
-      if (!setegid( (gid_t)-2 ) ||
-          !setgid( (gid_t)-2 ) ||
-          !setuid( (uid_t)-2 ) ||
-          !seteuid( (uid_t)-2 )) {
+      if (setegid( (gid_t)-2 ) || setgid( (gid_t)-2 ) || setuid( (uid_t)-2 ) || seteuid( (uid_t)-2 ))
         panic("Could not set uid to value -2");
-      }
     }
     else {
-      if (!setegid( pws->pw_gid ) ||
-          !setgid( pws->pw_gid ) ||
-          !setuid( pws->pw_uid ) ||
-          !seteuid( pws->pw_uid )) {
+      if (setegid( pws->pw_gid ) || setgid( pws->pw_gid ) || setuid( pws->pw_uid ) || seteuid( pws->pw_uid ))
         panic("Could not set uid to specified value");
-      }
     }
 
     if( geteuid() == 0 || getegid() == 0 )
-- 
cgit v1.2.3