void
IPIntercept::StopTransparency(const char *str) {
- debugs(89, DBG_IMPORTANT, "Stopping full transparency: " << str);
- transparent_active = 0;
+ if(transparent_active) {
+ debugs(89, DBG_IMPORTANT, "Stopping full transparency: " << str);
+ transparent_active = 0;
+ }
}
void
IPIntercept::StopInterception(const char *str) {
- debugs(89, DBG_IMPORTANT, "Stopping IP interception: " << str);
- intercept_active = 0;
+ if(intercept_active) {
+ debugs(89, DBG_IMPORTANT, "Stopping IP interception: " << str);
+ intercept_active = 0;
+ }
}
int
#if HAVE_PRCTL && defined(PR_SET_KEEPCAPS) && HAVE_SYS_CAPABILITY_H
if (prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0)) {
- /* Silent failure unless transparency is required. Maybe not started as root */
- if (IPInterceptor.TransparentActive()) {
- debugs(1, 1, "Error - full transparency support requires capability setting which has failed. Continuing without transparency support");
- IPInterceptor.StopTransparency();
- }
+ IPInterceptor.StopTransparency("capability setting has failed.");
}
#endif
}
cap->permitted &= cap->effective;
if (capset(head, cap) != 0) {
- /* Silent failure unless transparency is required */
- if(IPInterceptor.TransparentActive()) {
- IPInterceptor.StopTransparency("Error enabling needed capabilities.");
- }
+ IPInterceptor.StopTransparency("Error enabling needed capabilities.");
}
nocap:
xfree(head);
xfree(cap);
-#else /* not defined(_SQUID_LINUX_) && HAVE_SYS_CAPABILITY_H */
-
- if (IPInterceptor.TransparentActive()) {
- IPInterceptor.StopTransparency("Missing needed capability support.");
- }
+#else /* not defined(_SQUID_LINUX_) && HAVE_SYS_CAPABILITY_H */
+ IPInterceptor.StopTransparency("Missing needed capability support.");
#endif
}