From: Bert Hubert Date: Wed, 3 Mar 2010 08:58:12 +0000 (+0000) Subject: add #include for FreeBSD (spotted by Ralf van der Enden), plus add some... X-Git-Tag: rec-3.2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f838ad8da1ce03b513efbabdf0056c020f5e3401;p=pdns add #include for FreeBSD (spotted by Ralf van der Enden), plus add some error checking to chown for the control socket git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@1536 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 13a33a3ec..c0c11cab6 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -18,6 +18,7 @@ #ifndef WIN32 # include +# include # include #else #include "ntservice.hh" @@ -668,8 +669,11 @@ void makeControlChannelSocket() if (!::arg().isEmpty("socket-owner")) sockowner=::arg().asUid("socket-owner"); - if (sockgroup > -1 || sockowner > -1) - chown(sockname.c_str(), sockowner, sockgroup); + if (sockgroup > -1 || sockowner > -1) { + if(chown(sockname.c_str(), sockowner, sockgroup) < 0) { + unixDie("Failed to chown control socket"); + } + } // do mode change if socket-mode is given if(!::arg().isEmpty("socket-mode")) {