From: Otto Moerbeek Date: Mon, 12 Jun 2023 08:41:02 +0000 (+0200) Subject: rec: uid_t and gid_t can be unsigned, so doing > on and -1 value is tricky X-Git-Tag: rec-4.10.0-alpha0^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F12904%2Fhead;p=thirdparty%2Fpdns.git rec: uid_t and gid_t can be unsigned, so doing > on and -1 value is tricky --- 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"); }