From d0d3a8a8dce8868a474d62aac2fe213ae6c9ed74 Mon Sep 17 00:00:00 2001 From: Otto Moerbeek Date: Mon, 12 Jun 2023 10:41:02 +0200 Subject: [PATCH] rec: uid_t and gid_t can be unsigned, so doing > on and -1 value is tricky --- pdns/recursordist/rec-main.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdns/recursordist/rec-main.cc b/pdns/recursordist/rec-main.cc index 416609fa70..8c9fefe1c3 100644 --- a/pdns/recursordist/rec-main.cc +++ b/pdns/recursordist/rec-main.cc @@ -682,7 +682,7 @@ static void makeControlChannelSocket(int processNum = -1) sockowner = ::arg().asUid("socket-owner"); } - if (sockgroup > -1 || sockowner > -1) { + if (sockgroup != static_cast(-1) || sockowner != static_cast(-1)) { if (chown(sockname.c_str(), sockowner, sockgroup) < 0) { unixDie("Failed to chown control socket"); } -- 2.47.2