]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Cleanup: restoreCapabilities() takes a bool parameter
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 5 Oct 2014 15:26:50 +0000 (08:26 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 5 Oct 2014 15:26:50 +0000 (08:26 -0700)
src/tests/stub_tools.cc
src/tools.cc

index 00d65ada9a4c802e2b59ee9ab7b0211eb808541c..683ea93ae71e1f44045e5f46725abdfedceb3fd9 100644 (file)
@@ -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
index 178102de762399a1e2c61e45b1eec290233c55be..f560451ea78d15a41d8c868fd5085c12cc1da0a7 100644 (file)
@@ -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