--------------------- PatchSet 12161 Date: 2008/05/31 20:37:22 Author: hno Branch: SQUID_2_7 Tag: (none) Log: Bug #2350: Linux Capabilities version mismatch causing startup crash on newer kernels Members: src/tools.c:1.260.2.3->1.260.2.4 Index: squid/src/tools.c =================================================================== RCS file: /cvsroot/squid/squid/src/tools.c,v retrieving revision 1.260.2.3 retrieving revision 1.260.2.4 diff -u -r1.260.2.3 -r1.260.2.4 --- squid/src/tools.c 26 May 2008 22:48:11 -0000 1.260.2.3 +++ squid/src/tools.c 31 May 2008 20:37:22 -0000 1.260.2.4 @@ -1,6 +1,6 @@ /* - * $Id: tools.c,v 1.260.2.3 2008/05/26 22:48:11 hno Exp $ + * $Id: tools.c,v 1.260.2.4 2008/05/31 20:37:22 hno Exp $ * * DEBUG: section 21 Misc Functions * AUTHOR: Harvest Derived @@ -1358,15 +1358,18 @@ restoreCapabilities(int keep) { #if defined(_SQUID_LINUX_) && HAVE_SYS_CAPABILITY_H +#ifndef _LINUX_CAPABILITY_VERSION_1 +#define _LINUX_CAPABILITY_VERSION_1 _LINUX_CAPABILITY_VERSION +#endif cap_user_header_t head = xcalloc(1, sizeof(*head)); cap_user_data_t cap = xcalloc(1, sizeof(*cap)); - head->version = _LINUX_CAPABILITY_VERSION; + head->version = _LINUX_CAPABILITY_VERSION_1; if (capget(head, cap) != 0) { debug(50, 1) ("Can't get current capabilities\n"); goto nocap; } - if (head->version != _LINUX_CAPABILITY_VERSION) { + if (head->version != _LINUX_CAPABILITY_VERSION_1) { debug(50, 1) ("Invalid capability version %d (expected %d)\n", head->version, _LINUX_CAPABILITY_VERSION); goto nocap; }