]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: uid_t and gid_t can be unsigned, so doing > on and -1 value is tricky 12904/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 12 Jun 2023 08:41:02 +0000 (10:41 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 12 Jun 2023 08:41:02 +0000 (10:41 +0200)
pdns/recursordist/rec-main.cc

index 416609fa70a9ea4927d0662be7f8bcf5cef1821a..8c9fefe1c32c72a8637d7e8993beef8ce310a068 100644 (file)
@@ -682,7 +682,7 @@ static void makeControlChannelSocket(int processNum = -1)
     sockowner = ::arg().asUid("socket-owner");
   }
 
-  if (sockgroup > -1 || sockowner > -1) {
+  if (sockgroup != static_cast<gid_t>(-1) || sockowner != static_cast<uid_t>(-1)) {
     if (chown(sockname.c_str(), sockowner, sockgroup) < 0) {
       unixDie("Failed to chown control socket");
     }