Amos Jeffries wrote:
On Sun, 04 Oct 2009 13:48:07 +0200, Alexander Huemer
<[email protected]> wrote:
hi,
i am using squid-3.0.19 on a gentoo linux x86 system, kernel 2.6.31.1,
libcap-2.17.
when starting squid i get the following message in the system log
Oct 03 21:46:23 [kernel] warning: `squid' uses 32-bit capabilities
(legacy support in use)
i believe this is because of the code in function restoreCapabilities,
located src/tools.cc, lines 1356-EOF.
is there a chance to patch that area so that it is aware of
_LINUX_CAPABILITY_VERSION_3 ?
that should make that warning go away. i believe that because of [1].
i also checked the latest beta of squid (3.1.0.13) where the code is
similar.
in case this should go on the dev mailing list, please tell me, i will
be happy to post again.
kind regards and thanks in advance
-alex
[1]: http://bugs.gentoo.org/220167
I'm going to dare and hope that the fix really is this simple :)
Requires a suitably new version of libcap2 (specifically 2.10+) is
available for linkage.
Without the right linkage at build Squid will continue to trigger kernel
messages.
Amos
--
Please be using
Current Stable Squid 2.7.STABLE7 or 3.0.STABLE19
Current Beta Squid 3.1.0.14
=== modified file 'src/tools.cc'
--- src/tools.cc 2009-08-28 01:44:26 +0000
+++ src/tools.cc 2009-10-05 11:38:00 +0000
@@ -1243,18 +1243,28 @@
#if defined(_SQUID_LINUX_)
#if HAVE_SYS_CAPABILITY_H
+/* if we dont have v1 fallback to the ancient ways */
#ifndef _LINUX_CAPABILITY_VERSION_1
#define _LINUX_CAPABILITY_VERSION_1 _LINUX_CAPABILITY_VERSION
#endif
+/* if we dont have v2 pretend the version we used for v1 is usable. */
+#ifndef _LINUX_CAPABILITY_VERSION_2
+#define _LINUX_CAPABILITY_VERSION_2 _LINUX_CAPABILITY_VERSION_1
+#endif
+/* if we dont have v3 pretend the version we used for v2 is usable. */
+#ifndef _LINUX_CAPABILITY_VERSION_3
+#define _LINUX_CAPABILITY_VERSION_3 _LINUX_CAPABILITY_VERSION_2
+#endif
+
cap_user_header_t head = (cap_user_header_t) xcalloc(1, sizeof(*head));
cap_user_data_t cap = (cap_user_data_t) xcalloc(1, sizeof(*cap));
- head->version = _LINUX_CAPABILITY_VERSION_1;
+ head->version = _LINUX_CAPABILITY_VERSION_3;
if (capget(head, cap) != 0) {
debugs(50, DBG_IMPORTANT, "Can't get current capabilities");
- } else if (head->version != _LINUX_CAPABILITY_VERSION_1) {
- debugs(50, DBG_IMPORTANT, "Invalid capability version " << head->version << " (expected " << _LINUX_CAPABILITY_VERSION_1 << ")");
+ } else if (head->version != _LINUX_CAPABILITY_VERSION_3) {
+ debugs(50, DBG_IMPORTANT, "Invalid capability version " << head->version << " (expected " << _LINUX_CAPABILITY_VERSION_3 << ")");
} else {
head->pid = 0;