From: Amos Jeffries Date: Sun, 5 Oct 2014 15:26:50 +0000 (-0700) Subject: Cleanup: restoreCapabilities() takes a bool parameter X-Git-Tag: SQUID_3_5_0_1~17 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ff2afd7f596daf34e8c006043362e02cd442ecaa;p=thirdparty%2Fsquid.git Cleanup: restoreCapabilities() takes a bool parameter --- diff --git a/src/tests/stub_tools.cc b/src/tests/stub_tools.cc index 00d65ada9a..683ea93ae7 100644 --- a/src/tests/stub_tools.cc +++ b/src/tests/stub_tools.cc @@ -75,4 +75,4 @@ int getMyPort(void) STUB_RETVAL(0) void setUmask(mode_t mask) STUB void strwordquote(MemBuf * mb, const char *str) STUB void keepCapabilities(void) STUB -void restoreCapabilities(int keep) STUB +void restoreCapabilities(bool keep) STUB diff --git a/src/tools.cc b/src/tools.cc index 178102de76..f560451ea7 100644 --- a/src/tools.cc +++ b/src/tools.cc @@ -58,7 +58,7 @@ and report the trace back to squid-bugs@squid-cache.org.\n\ Thanks!\n" static void mail_warranty(void); -static void restoreCapabilities(int keep); +static void restoreCapabilities(bool keep); int DebugSignal = -1; SBuf service_name(APP_SHORTNAME); @@ -593,7 +593,7 @@ leave_suid(void) #endif - restoreCapabilities(1); + restoreCapabilities(true); #if HAVE_PRCTL && defined(PR_SET_DUMPABLE) /* Set Linux DUMPABLE flag */ @@ -641,7 +641,7 @@ no_suid(void) if (setuid(uid) < 0) debugs(50, DBG_IMPORTANT, "ERROR: no_suid: setuid(" << uid << "): " << xstrerror()); - restoreCapabilities(0); + restoreCapabilities(false); #if HAVE_PRCTL && defined(PR_SET_DUMPABLE) /* Set Linux DUMPABLE flag */ @@ -1210,7 +1210,7 @@ keepCapabilities(void) } static void -restoreCapabilities(int keep) +restoreCapabilities(bool keep) { /* NP: keep these two if-endif separate. Non-Linux work perfectly well without Linux syscap support. */ #if USE_LIBCAP