From: Amos Jeffries Date: Tue, 14 Sep 2010 03:19:52 +0000 (-0600) Subject: Additional tools may use malloc/calloc/free X-Git-Tag: take1~261 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3d9b21dbdff0f1b27f3d973de81cef81b6845a25;p=thirdparty%2Fsquid.git Additional tools may use malloc/calloc/free --- diff --git a/compat/GnuRegex.c b/compat/GnuRegex.c index e55d98b957..86cdc2962f 100644 --- a/compat/GnuRegex.c +++ b/compat/GnuRegex.c @@ -32,7 +32,6 @@ #define _GNU_SOURCE 1 #endif -#define SQUID_NO_ALLOC_PROTECT 1 #include "config.h" #if USE_GNUREGEX /* only if squid needs it. Usually not */ diff --git a/compat/os/dragonfly.h b/compat/os/dragonfly.h index 5c767fc554..a9071c0ee2 100644 --- a/compat/os/dragonfly.h +++ b/compat/os/dragonfly.h @@ -20,11 +20,5 @@ #undef HAVE_MALLOC_H #endif -/* Exclude CPPUnit tests from the allocator restrictions. */ -/* BSD implementation uses these still */ -#if defined(SQUID_UNIT_TEST) -#define SQUID_NO_ALLOC_PROTECT 1 -#endif - #endif /* _SQUID_DRAGONFLY_ */ #endif /* SQUID_OS_DRAGONFLY_H */ diff --git a/compat/os/freebsd.h b/compat/os/freebsd.h index 43db27dc19..f63b6b3d7c 100644 --- a/compat/os/freebsd.h +++ b/compat/os/freebsd.h @@ -27,12 +27,6 @@ #define _etext etext -/* Exclude CPPUnit tests from the allocator restrictions. */ -/* BSD implementation uses these still */ -#if defined(SQUID_UNIT_TEST) -#define SQUID_NO_ALLOC_PROTECT 1 -#endif - /* * This OS has at least one version that defines these as private * kernel macros commented as being 'non-standard'. diff --git a/compat/os/netbsd.h b/compat/os/netbsd.h index 0b9045282e..e47f158f6b 100644 --- a/compat/os/netbsd.h +++ b/compat/os/netbsd.h @@ -13,12 +13,6 @@ *--------------------------------------------------------------------------* ****************************************************************************/ -/* Exclude CPPUnit tests from the allocator restrictions. */ -/* BSD implementation uses these still */ -#if defined(SQUID_UNIT_TEST) -#define SQUID_NO_ALLOC_PROTECT 1 -#endif - /* NetBSD does not provide sys_errlist global for strerror */ #define NEED_SYS_ERRLIST 1 diff --git a/compat/os/openbsd.h b/compat/os/openbsd.h index 4e51a279b6..ed336b802b 100644 --- a/compat/os/openbsd.h +++ b/compat/os/openbsd.h @@ -20,12 +20,6 @@ #undef HAVE_MALLOC_H #endif -/* Exclude CPPUnit tests from the allocator restrictions. */ -/* BSD implementation uses these still */ -#if defined(SQUID_UNIT_TEST) -#define SQUID_NO_ALLOC_PROTECT 1 -#endif - /* * This OS has at least one version that defines these as private * kernel macros commented as being 'non-standard'. diff --git a/compat/unsafe.h b/compat/unsafe.h index 88af1fed17..284607212d 100644 --- a/compat/unsafe.h +++ b/compat/unsafe.h @@ -9,18 +9,6 @@ * Trap unintentional use of functions unsafe for use within squid. */ -#if !SQUID_NO_ALLOC_PROTECT -#ifndef free -#define free(x) ERROR_free_UNSAFE_IN_SQUID(x) -#endif -#ifndef malloc -#define malloc ERROR_malloc_UNSAFE_IN_SQUID -#endif -#ifndef calloc -#define calloc ERROR_calloc_UNSAFE_IN_SQUID -#endif -#endif /* !SQUID_NO_ALLOC_PROTECT */ - #if !SQUID_NO_STRING_BUFFER_PROTECT #ifndef sprintf #define sprintf ERROR_sprintf_UNSAFE_IN_SQUID diff --git a/helpers/basic_auth/LDAP/basic_ldap_auth.cc b/helpers/basic_auth/LDAP/basic_ldap_auth.cc index 061aee8e3d..68e8cc5423 100644 --- a/helpers/basic_auth/LDAP/basic_ldap_auth.cc +++ b/helpers/basic_auth/LDAP/basic_ldap_auth.cc @@ -82,7 +82,6 @@ * - Allow full filter specifications in -f */ -#define SQUID_NO_ALLOC_PROTECT 1 #include "config.h" #define LDAP_DEPRECATED 1 diff --git a/helpers/basic_auth/MSNT/smblib.c b/helpers/basic_auth/MSNT/smblib.c index 518a924a65..3c5c18a2ae 100644 --- a/helpers/basic_auth/MSNT/smblib.c +++ b/helpers/basic_auth/MSNT/smblib.c @@ -22,7 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#define SQUID_NO_ALLOC_PROTECT 1 #include "util.h" #include "smblib-priv.h" diff --git a/helpers/basic_auth/MSNT/std-includes.h b/helpers/basic_auth/MSNT/std-includes.h index 619b45854b..3336dc820a 100644 --- a/helpers/basic_auth/MSNT/std-includes.h +++ b/helpers/basic_auth/MSNT/std-includes.h @@ -24,7 +24,6 @@ */ /* the types are provided by squid's configure preocess */ -#define SQUID_NO_ALLOC_PROTECT 1 #include "config.h" #define BOOL int16_t diff --git a/helpers/basic_auth/MSNT/usersfile.c b/helpers/basic_auth/MSNT/usersfile.c index 7cbdcabd8f..282c5cb871 100644 --- a/helpers/basic_auth/MSNT/usersfile.c +++ b/helpers/basic_auth/MSNT/usersfile.c @@ -8,7 +8,6 @@ * The code originated from denyusers.c. */ -#define SQUID_NO_ALLOC_PROTECT 1 #include "config.h" #include "util.h" diff --git a/helpers/basic_auth/PAM/basic_pam_auth.cc b/helpers/basic_auth/PAM/basic_pam_auth.cc index 5b52cdfdab..9130d03e73 100644 --- a/helpers/basic_auth/PAM/basic_pam_auth.cc +++ b/helpers/basic_auth/PAM/basic_pam_auth.cc @@ -65,7 +65,6 @@ * * Compile this program with: gcc -o basic_pam_auth basic_pam_auth.cc -lpam -ldl */ -#define SQUID_NO_ALLOC_PROTECT 1 #include "config.h" #include "helpers/defines.h" #include "rfc1738.h" diff --git a/helpers/basic_auth/SMB/basic_smb_auth.cc b/helpers/basic_auth/SMB/basic_smb_auth.cc index d7a93a5944..1f84f7f386 100644 --- a/helpers/basic_auth/SMB/basic_smb_auth.cc +++ b/helpers/basic_auth/SMB/basic_smb_auth.cc @@ -40,7 +40,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. */ -#define SQUID_NO_ALLOC_PROTECT 1 #include "config.h" #include "helpers/defines.h" #include "rfc1738.h" diff --git a/helpers/digest_auth/LDAP/ldap_backend.cc b/helpers/digest_auth/LDAP/ldap_backend.cc index 25abcb16ea..74fca3263a 100644 --- a/helpers/digest_auth/LDAP/ldap_backend.cc +++ b/helpers/digest_auth/LDAP/ldap_backend.cc @@ -5,7 +5,6 @@ * ldap_backend.c * AUTHOR: Flavio Pescuma, MARA Systems AB */ -#define SQUID_NO_ALLOC_PROTECT 1 #include "config.h" #include "util.h" diff --git a/helpers/digest_auth/eDirectory/edir_ldapext.cc b/helpers/digest_auth/eDirectory/edir_ldapext.cc index 7e26850d1e..d688fbcf58 100644 --- a/helpers/digest_auth/eDirectory/edir_ldapext.cc +++ b/helpers/digest_auth/eDirectory/edir_ldapext.cc @@ -22,7 +22,6 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ -#define SQUID_NO_ALLOC_PROTECT 1 #include "config.h" #include "digest_common.h" diff --git a/helpers/digest_auth/eDirectory/ldap_backend.cc b/helpers/digest_auth/eDirectory/ldap_backend.cc index 6d69aa9af0..109928dca0 100644 --- a/helpers/digest_auth/eDirectory/ldap_backend.cc +++ b/helpers/digest_auth/eDirectory/ldap_backend.cc @@ -5,7 +5,6 @@ * ldap_backend.c * AUTHOR: Flavio Pescuma, MARA Systems AB */ -#define SQUID_NO_ALLOC_PROTECT 1 #include "config.h" #define LDAP_DEPRECATED 1 diff --git a/helpers/digest_auth/file/text_backend.cc b/helpers/digest_auth/file/text_backend.cc index 95f7326bc1..a5b46ec3fe 100644 --- a/helpers/digest_auth/file/text_backend.cc +++ b/helpers/digest_auth/file/text_backend.cc @@ -28,7 +28,6 @@ * * Copyright (c) 2003 Robert Collins */ -#define SQUID_NO_ALLOC_PROTECT 1 #include "config.h" #include "text_backend.h" diff --git a/helpers/external_acl/LDAP_group/ext_ldap_group_acl.cc b/helpers/external_acl/LDAP_group/ext_ldap_group_acl.cc index 1436314468..f8b2ea14b5 100644 --- a/helpers/external_acl/LDAP_group/ext_ldap_group_acl.cc +++ b/helpers/external_acl/LDAP_group/ext_ldap_group_acl.cc @@ -34,7 +34,6 @@ * as published by the Free Software Foundation; either version 2, * or (at your option) any later version. */ -#define SQUID_NO_ALLOC_PROTECT 1 #include "config.h" #include "helpers/defines.h" #include "rfc1738.h" diff --git a/helpers/external_acl/file_userip/ext_file_userip_acl.cc b/helpers/external_acl/file_userip/ext_file_userip_acl.cc index 8bee48c503..656cb5d537 100644 --- a/helpers/external_acl/file_userip/ext_file_userip_acl.cc +++ b/helpers/external_acl/file_userip/ext_file_userip_acl.cc @@ -18,7 +18,6 @@ * Author: Rodrigo Campos (rodrigo@geekbunker.org) * */ -#define SQUID_NO_ALLOC_PROTECT 1 #include "config.h" #include "helpers/defines.h" #include "rfc1738.h" @@ -65,7 +64,7 @@ int dict_lookup(struct ip_user_dict *, char *, char *); /** This function parses the dictionary file and loads it * in memory. All IP addresses are processed with a bitwise AND * with their netmasks before they are stored. - * If there´s no netmask (no /) in the in the lhs , a mask + * If there?s no netmask (no /) in the in the lhs , a mask * 255.255.255.255 is assumed. * It returns a pointer to the first entry of the linked list */ @@ -149,7 +148,7 @@ dict_lookup(struct ip_user_dict *first_entry, char *username, if ((inet_addr (address) & (unsigned long) current_entry-> netmask) == current_entry->address) { - /* If the username contains an @ we assume it´s a group and + /* If the username contains an @ we assume it?s a group and call the corresponding function */ if ((strchr (current_entry->username, '@')) == NULL) { if ((match_user (current_entry->username, username)) == 1) diff --git a/helpers/ntlm_auth/smb_lm/ntlm_smb_lm_auth.cc b/helpers/ntlm_auth/smb_lm/ntlm_smb_lm_auth.cc index bef750d266..2d32af3088 100644 --- a/helpers/ntlm_auth/smb_lm/ntlm_smb_lm_auth.cc +++ b/helpers/ntlm_auth/smb_lm/ntlm_smb_lm_auth.cc @@ -13,7 +13,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. * */ -#define SQUID_NO_ALLOC_PROTECT 1 #include "config.h" #include "compat/debug.h" #include "libntlmauth/ntlmauth.h" diff --git a/lib/Profiler.c b/lib/Profiler.c index d85070e4e6..32b82ad7ad 100644 --- a/lib/Profiler.c +++ b/lib/Profiler.c @@ -113,7 +113,6 @@ * */ -#define SQUID_NO_ALLOC_PROTECT 1 #include "config.h" /* This include needs to be BELOW config, as it may undef USE_XPROF_STATS */ diff --git a/lib/util.c b/lib/util.c index 0e75acec50..0e017f5ae9 100644 --- a/lib/util.c +++ b/lib/util.c @@ -34,9 +34,6 @@ #define _etext etext -/* NP: this file is where the memory allocators are defined. */ -#define SQUID_NO_ALLOC_PROTECT 1 - #include "config.h" #include "profiling.h" diff --git a/libntlmauth/rfcnb-session.c b/libntlmauth/rfcnb-session.c index ba352c8b6b..38e569c4fe 100644 --- a/libntlmauth/rfcnb-session.c +++ b/libntlmauth/rfcnb-session.c @@ -22,7 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#define SQUID_NO_ALLOC_PROTECT 1 #include "config.h" #include "libntlmauth/rfcnb-priv.h" diff --git a/libntlmauth/rfcnb-util.c b/libntlmauth/rfcnb-util.c index 7eeb4a816d..5af572c917 100644 --- a/libntlmauth/rfcnb-util.c +++ b/libntlmauth/rfcnb-util.c @@ -22,7 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#define SQUID_NO_ALLOC_PROTECT 1 #include "config.h" #include "libntlmauth/rfcnb-priv.h" diff --git a/libntlmauth/smblib-util.c b/libntlmauth/smblib-util.c index ef7822d525..deaaf1d36b 100644 --- a/libntlmauth/smblib-util.c +++ b/libntlmauth/smblib-util.c @@ -22,7 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#define SQUID_NO_ALLOC_PROTECT 1 #include "config.h" #include "libntlmauth/rfcnb.h" #include "libntlmauth/smblib-priv.h" diff --git a/libntlmauth/smblib.c b/libntlmauth/smblib.c index d196a5fbb6..4a6da58036 100644 --- a/libntlmauth/smblib.c +++ b/libntlmauth/smblib.c @@ -23,7 +23,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#define SQUID_NO_ALLOC_PROTECT 1 #include "config.h" #include "libntlmauth/rfcnb.h"