From: Francesco Chemolli <5175948+kinkie@users.noreply.github.com> Date: Tue, 13 Feb 2024 17:57:27 +0000 (+0000) Subject: Maintenance: automate header guards 1/3 (#1654) (#1669) X-Git-Tag: SQUID_6_8~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc9cd4833a05b718d152045c787e4e6881f30012;p=thirdparty%2Fsquid.git Maintenance: automate header guards 1/3 (#1654) (#1669) In preparation for merging the automated header-guards maintenance script, merge the manual changes required for that script to succeed. --- diff --git a/lib/rfcnb/byteorder.h b/lib/rfcnb/byteorder.h index 1c2597783d..c2998ea8d5 100644 --- a/lib/rfcnb/byteorder.h +++ b/lib/rfcnb/byteorder.h @@ -34,6 +34,9 @@ * int manipulation */ +#ifndef SQUID_LIB_RFCNB_BYTEORDER_H +#define SQUID_LIB_RFCNB_BYTEORDER_H + #undef CAREFUL_ALIGNMENT /* we know that the 386 can handle misalignment and has the "right" @@ -87,3 +90,5 @@ #define RSSVAL(buf,pos,val) SSVAL(buf,pos,SREV(val)) #define RSIVAL(buf,pos,val) SIVAL(buf,pos,IREV(val)) +#endif /* SQUID_LIB_RFCNB_BYTEORDER_H */ + diff --git a/lib/smblib/smbdes.h b/lib/smblib/smbdes.h index 94bb4434a0..ea8042e2cf 100644 --- a/lib/smblib/smbdes.h +++ b/lib/smblib/smbdes.h @@ -6,9 +6,13 @@ * Please see the COPYING and CONTRIBUTORS files for details. */ -/* smbdes.c */ +#ifndef SQUID_LIB_SMBLIB_SMBDES_H +#define SQUID_LIB_SMBLIB_SMBDES_H + void E_P16(unsigned char *p14, unsigned char *p16); void E_P24(unsigned char *p21, unsigned char *c8, unsigned char *p24); void cred_hash1(unsigned char *out, unsigned char *in, unsigned char *key); void cred_hash2(unsigned char *out, unsigned char *in, unsigned char *key); +#endif /* SQUID_LIB_SMBLIB_SMBDES_H */ + diff --git a/src/acl/AnnotateClient.h b/src/acl/AnnotateClient.h index ec4df279c3..35bb4fd3d4 100644 --- a/src/acl/AnnotateClient.h +++ b/src/acl/AnnotateClient.h @@ -6,8 +6,8 @@ * Please see the COPYING and CONTRIBUTORS files for details. */ -#ifndef SQUID_ACLANNOTATECLIENT -#define SQUID_ACLANNOTATECLIENT +#ifndef SQUID_SRC_ACL_ANNOTATECLIENT_H +#define SQUID_SRC_ACL_ANNOTATECLIENT_H #include "acl/Note.h" #include "Notes.h" @@ -20,5 +20,5 @@ public: int match(ACLData * &, ACLFilledChecklist *) override; }; -#endif /* SQUID_ACLANNOTATECLIENT */ +#endif /* SQUID_SRC_ACL_ANNOTATECLIENT_H */ diff --git a/src/acl/AnnotateTransaction.h b/src/acl/AnnotateTransaction.h index 08211e1039..69718011e9 100644 --- a/src/acl/AnnotateTransaction.h +++ b/src/acl/AnnotateTransaction.h @@ -6,8 +6,8 @@ * Please see the COPYING and CONTRIBUTORS files for details. */ -#ifndef SQUID_ACLANNOTATETRANSACTION -#define SQUID_ACLANNOTATETRANSACTION +#ifndef SQUID_SRC_ACL_ANNOTATETRANSACTION_H +#define SQUID_SRC_ACL_ANNOTATETRANSACTION_H #include "acl/Note.h" #include "Notes.h" @@ -20,5 +20,5 @@ public: bool requiresRequest() const override { return true; } }; -#endif /* SQUID_ACLANNOTATETRANSACTION */ +#endif /* SQUID_SRC_ACL_ANNOTATETRANSACTION_H */ diff --git a/src/acl/external/kerberos_ldap_group/support.h b/src/acl/external/kerberos_ldap_group/support.h index ffc4262373..d2b66a186f 100644 --- a/src/acl/external/kerberos_ldap_group/support.h +++ b/src/acl/external/kerberos_ldap_group/support.h @@ -30,6 +30,9 @@ * ----------------------------------------------------------------------------- */ +#ifndef SQUID_SRC_ACL_EXTERNAL_KERBEROS_LDAP_GROUP_SUPPORT_H +#define SQUID_SRC_ACL_EXTERNAL_KERBEROS_LDAP_GROUP_SUPPORT_H + #define KERBEROS_LDAP_GROUP_VERSION "1.4.0sq" #include "compat/krb5.h" @@ -165,3 +168,5 @@ void krb5_cleanup(void); #define PROGRAM "kerberos_ldap_group" +#endif /* SQUID_SRC_ACL_EXTERNAL_KERBEROS_LDAP_GROUP_SUPPORT_H */ + diff --git a/src/adaptation/ecap/Registry.h b/src/adaptation/ecap/Registry.h index fe5d5a7842..62172ae668 100644 --- a/src/adaptation/ecap/Registry.h +++ b/src/adaptation/ecap/Registry.h @@ -6,5 +6,10 @@ * Please see the COPYING and CONTRIBUTORS files for details. */ +#ifndef SQUID_SRC_ADAPTATION_ECAP_REGISTRY_H +#define SQUID_SRC_ADAPTATION_ECAP_REGISTRY_H + // TBD +#endif /* SQUID_SRC_ADAPTATION_ECAP_REGISTRY_H */ + diff --git a/src/auth/State.h b/src/auth/State.h index 4931832c19..6f42d93506 100644 --- a/src/auth/State.h +++ b/src/auth/State.h @@ -6,8 +6,8 @@ * Please see the COPYING and CONTRIBUTORS files for details. */ -#ifndef __AUTH_AUTHENTICATE_STATE_T__ -#define __AUTH_AUTHENTICATE_STATE_T__ +#ifndef SQUID_SRC_AUTH_STATE_H +#define SQUID_SRC_AUTH_STATE_H #if USE_AUTH @@ -43,5 +43,5 @@ public: } // namespace Auth #endif /* USE_AUTH */ -#endif /* __AUTH_AUTHENTICATE_STATE_T__ */ +#endif /* SQUID_SRC_AUTH_STATE_H */ diff --git a/src/auth/basic/NIS/nis_support.h b/src/auth/basic/NIS/nis_support.h index ae3f1a3fd8..4282b0ea3d 100644 --- a/src/auth/basic/NIS/nis_support.h +++ b/src/auth/basic/NIS/nis_support.h @@ -6,5 +6,10 @@ * Please see the COPYING and CONTRIBUTORS files for details. */ +#ifndef SQUID_SRC_AUTH_BASIC_NIS_NIS_SUPPORT_H +#define SQUID_SRC_AUTH_BASIC_NIS_NIS_SUPPORT_H + extern char * get_nis_password(char *user, char *nisdomain, char *nismap); +#endif /* SQUID_SRC_AUTH_BASIC_NIS_NIS_SUPPORT_H */ + diff --git a/src/auth/basic/RADIUS/radius-util.h b/src/auth/basic/RADIUS/radius-util.h index 8020d49513..37cea6e7eb 100644 --- a/src/auth/basic/RADIUS/radius-util.h +++ b/src/auth/basic/RADIUS/radius-util.h @@ -8,9 +8,14 @@ // 2008-05-14: rename to radius-util.* to avoid name clashes with squid util.* +#ifndef SQUID_SRC_AUTH_BASIC_RADIUS_RADIUS_UTIL_H +#define SQUID_SRC_AUTH_BASIC_RADIUS_RADIUS_UTIL_H + // uses the squid utilities #include "util.h" /* util.c */ uint32_t get_ipaddr (char *); +#endif /* SQUID_SRC_AUTH_BASIC_RADIUS_RADIUS_UTIL_H */ + diff --git a/src/auth/basic/RADIUS/radius.h b/src/auth/basic/RADIUS/radius.h index ccbebdf058..da7ccdeb7c 100644 --- a/src/auth/basic/RADIUS/radius.h +++ b/src/auth/basic/RADIUS/radius.h @@ -37,6 +37,9 @@ * @(#)radius.h 2.0 03-Aug-1996 */ +#ifndef SQUID_SRC_AUTH_BASIC_RADIUS_RADIUS_H +#define SQUID_SRC_AUTH_BASIC_RADIUS_RADIUS_H + #define AUTH_VECTOR_LEN 16 #define AUTH_PASS_LEN 16 #define AUTH_STRING_LEN 128 /* maximum of 254 */ @@ -200,3 +203,5 @@ typedef struct pw_auth_hdr { #define PW_STATUS_ACCOUNTING_ON 7 #define PW_STATUS_ACCOUNTING_OFF 8 +#endif /* SQUID_SRC_AUTH_BASIC_RADIUS_RADIUS_H */ + diff --git a/src/auth/digest/LDAP/ldap_backend.h b/src/auth/digest/LDAP/ldap_backend.h index a76dd3b2b5..959db56a4c 100644 --- a/src/auth/digest/LDAP/ldap_backend.h +++ b/src/auth/digest/LDAP/ldap_backend.h @@ -10,8 +10,13 @@ * AUTHOR: Flavio Pescuma. */ +#ifndef SQUID_SRC_AUTH_DIGEST_LDAP_LDAP_BACKEND_H +#define SQUID_SRC_AUTH_DIGEST_LDAP_LDAP_BACKEND_H + #include "auth/digest/LDAP/digest_common.h" extern int LDAPArguments(int argc, char **argv); extern void LDAPHHA1(RequestData * requestData); +#endif /* SQUID_SRC_AUTH_DIGEST_LDAP_LDAP_BACKEND_H */ + diff --git a/src/auth/digest/eDirectory/edir_ldapext.h b/src/auth/digest/eDirectory/edir_ldapext.h index 2a8051122a..aaea9cc882 100644 --- a/src/auth/digest/eDirectory/edir_ldapext.h +++ b/src/auth/digest/eDirectory/edir_ldapext.h @@ -6,5 +6,14 @@ * Please see the COPYING and CONTRIBUTORS files for details. */ +#ifndef SQUID_SRC_AUTH_DIGEST_EDIRECTORY_EDIR_LDAPEXT_H +#define SQUID_SRC_AUTH_DIGEST_EDIRECTORY_EDIR_LDAPEXT_H + +#if HAVE_LDAP_H +#include +#endif + int nds_get_password(LDAP *ld, char *object_dn, size_t * pwd_len, char *pwd); +#endif /* SQUID_SRC_AUTH_DIGEST_EDIRECTORY_EDIR_LDAPEXT_H */ + diff --git a/src/auth/digest/eDirectory/ldap_backend.h b/src/auth/digest/eDirectory/ldap_backend.h index 16e2b04a22..5b3d90133f 100644 --- a/src/auth/digest/eDirectory/ldap_backend.h +++ b/src/auth/digest/eDirectory/ldap_backend.h @@ -10,7 +10,12 @@ * AUTHOR: Flavio Pescuma. */ +#ifndef SQUID_SRC_AUTH_DIGEST_EDIRECTORY_LDAP_BACKEND_H +#define SQUID_SRC_AUTH_DIGEST_EDIRECTORY_LDAP_BACKEND_H + #include "auth/digest/eDirectory/digest_common.h" extern int LDAPArguments(int argc, char **argv); extern void LDAPHHA1(RequestData * requestData); +#endif /* SQUID_SRC_AUTH_DIGEST_EDIRECTORY_LDAP_BACKEND_H */ + diff --git a/src/auth/digest/file/text_backend.h b/src/auth/digest/file/text_backend.h index 16db88ffe7..0bbf687def 100644 --- a/src/auth/digest/file/text_backend.h +++ b/src/auth/digest/file/text_backend.h @@ -6,8 +6,13 @@ * Please see the COPYING and CONTRIBUTORS files for details. */ +#ifndef SQUID_SRC_AUTH_DIGEST_FILE_TEXT_BACKEND_H +#define SQUID_SRC_AUTH_DIGEST_FILE_TEXT_BACKEND_H + #include "auth/digest/file/digest_common.h" extern void TextArguments(int argc, char **argv); extern void TextHHA1(RequestData * requestData); +#endif /* SQUID_SRC_AUTH_DIGEST_FILE_TEXT_BACKEND_H */ + diff --git a/src/auth/negotiate/kerberos/negotiate_kerberos.h b/src/auth/negotiate/kerberos/negotiate_kerberos.h index 9f309c4ee6..6ea228b24b 100644 --- a/src/auth/negotiate/kerberos/negotiate_kerberos.h +++ b/src/auth/negotiate/kerberos/negotiate_kerberos.h @@ -35,6 +35,9 @@ * ----------------------------------------------------------------------------- */ +#ifndef SQUID_SRC_AUTH_NEGOTIATE_KERBEROS_NEGOTIATE_KERBEROS_H +#define SQUID_SRC_AUTH_NEGOTIATE_KERBEROS_NEGOTIATE_KERBEROS_H + #include #include #if HAVE_NETDB_H @@ -148,3 +151,5 @@ char *get_ad_groups(char *ad_groups, krb5_context context, krb5_pac pac); #endif int check_k5_err(krb5_context context, const char *msg, krb5_error_code code); +#endif /* SQUID_SRC_AUTH_NEGOTIATE_KERBEROS_NEGOTIATE_KERBEROS_H */ + diff --git a/src/dns/rfc3596.cc b/src/dns/rfc3596.cc index d489bdfb29..7573aac667 100644 --- a/src/dns/rfc3596.cc +++ b/src/dns/rfc3596.cc @@ -27,7 +27,7 @@ #include #endif -#ifndef SQUID_RFC1035_H +#if !defined(RFC1035_MAXHOSTNAMESZ) #error RFC3596 Library depends on RFC1035 #endif diff --git a/src/tests/STUB.h b/src/tests/STUB.h index ed2c0d67dd..12d79f3ece 100644 --- a/src/tests/STUB.h +++ b/src/tests/STUB.h @@ -6,7 +6,8 @@ * Please see the COPYING and CONTRIBUTORS files for details. */ -#ifndef STUB +#ifndef SQUID_SRC_TESTS_STUB_H +#define SQUID_SRC_TESTS_STUB_H /** \group STUB * @@ -53,5 +54,5 @@ /** Same as STUB_RETREF(). TODO: Remove */ #define STUB_RETSTATREF(x) STUB_RETREF(x) -#endif /* STUB */ +#endif /* SQUID_SRC_TESTS_STUB_H */ diff --git a/src/tests/TestSwapDir.h b/src/tests/TestSwapDir.h index 60009f35c2..e8e7bb3e71 100644 --- a/src/tests/TestSwapDir.h +++ b/src/tests/TestSwapDir.h @@ -6,8 +6,8 @@ * Please see the COPYING and CONTRIBUTORS files for details. */ -#ifndef TEST_TESTSWAPDIR -#define TEST_TESTSWAPDIR +#ifndef SQUID_SRC_TESTS_TESTSWAPDIR_H +#define SQUID_SRC_TESTS_TESTSWAPDIR_H #include "store/Disk.h" @@ -41,5 +41,5 @@ public: typedef RefCount TestSwapDirPointer; -#endif /* TEST_TESTSWAPDIR */ +#endif /* SQUID_SRC_TESTS_TESTSWAPDIR_H */