lib/util: remove extra safe_string.h file
authorMatthew DeVore <matvore@google.com>
Fri, 7 Aug 2020 20:27:39 +0000 (13:27 -0700)
committerJeremy Allison <jra@samba.org>
Fri, 28 Aug 2020 02:18:40 +0000 (02:18 +0000)
lib/util/safe_string.h is similar to source3/include/safe_string.h, but
the former has fewer checks. It is missing bcopy, strcasecmp, and
strncasecmp.

Add the missing elements to lib/util/safe_string.h remove the other
safe_string.h which is in the source3-specific path. To accomodate
existing uses of str(n?)casecmp, add #undef lines to source files where
they are used.

Signed-off-by: Matthew DeVore <matvore@google.com>
Reviewed-by: David Mulder <dmulder@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Aug 28 02:18:40 UTC 2020 on sn-devel-184

90 files changed:
auth/credentials/credentials_krb5.c
auth/gensec/gensec_start.c
dfs_server/dfs_server_ad.c
lib/ldb/include/ldb.h
lib/util/charset/tests/charset.c
lib/util/charset/util_str.c
lib/util/safe_string.h
lib/util/util_net.c
libcli/http/gensec/generic.c
libcli/http/http.c
libcli/http/http_auth.c
libcli/security/util_sid.c
librpc/rpc/dcerpc_util.c
librpc/rpc/dcesrv_core.c
source3/include/includes.h
source3/include/safe_string.h [deleted file]
source3/modules/vfs_vxfs.c
source4/auth/ntlm/auth_developer.c
source4/client/client.c
source4/dns_server/dlz_bind9.c
source4/dns_server/dnsserver_common.c
source4/dsdb/common/util.c
source4/dsdb/common/util_trusts.c
source4/dsdb/repl/drepl_partitions.c
source4/dsdb/samdb/cracknames.c
source4/dsdb/samdb/ldb_modules/acl.c
source4/dsdb/samdb/ldb_modules/count_attrs.c
source4/dsdb/samdb/ldb_modules/encrypted_secrets.c
source4/dsdb/samdb/ldb_modules/extended_dn_in.c
source4/dsdb/samdb/ldb_modules/extended_dn_out.c
source4/dsdb/samdb/ldb_modules/linked_attributes.c
source4/dsdb/samdb/ldb_modules/netlogon.c
source4/dsdb/samdb/ldb_modules/password_hash.c
source4/dsdb/samdb/ldb_modules/ranged_results.c
source4/dsdb/samdb/ldb_modules/repl_meta_data.c
source4/dsdb/samdb/ldb_modules/rootdse.c
source4/dsdb/samdb/ldb_modules/samldb.c
source4/dsdb/samdb/ldb_modules/schema_data.c
source4/dsdb/schema/schema_convert_to_ol.c
source4/dsdb/schema/schema_description.c
source4/dsdb/schema/schema_init.c
source4/dsdb/schema/schema_query.c
source4/dsdb/schema/schema_set.c
source4/dsdb/schema/schema_syntax.c
source4/kdc/db-glue.c
source4/ldap_server/ldap_server.c
source4/lib/com/dcom/main.c
source4/lib/registry/interface.c
source4/lib/registry/patchfile_preg.c
source4/lib/registry/regf.c
source4/lib/socket/socket_ip.c
source4/libcli/dgram/mailslot.c
source4/libcli/resolve/resolve.c
source4/librpc/rpc/dcerpc_connect.c
source4/librpc/rpc/dcerpc_smb.c
source4/nbt_server/wins/winsdb.c
source4/ntvfs/ipc/vfs_ipc.c
source4/ntvfs/ntvfs_generic.c
source4/ntvfs/posix/pvfs_shortname.c
source4/ntvfs/sysdep/sys_lease.c
source4/ntvfs/sysdep/sys_notify.c
source4/param/share_ldb.c
source4/rpc_server/backupkey/dcesrv_backupkey.c
source4/rpc_server/common/share_info.c
source4/rpc_server/dnsserver/dcerpc_dnsserver.c
source4/rpc_server/dnsserver/dnsdata.c
source4/rpc_server/dnsserver/dnsdb.c
source4/rpc_server/dnsserver/dnsutils.c
source4/rpc_server/drsuapi/writespn.c
source4/rpc_server/lsa/dcesrv_lsa.c
source4/rpc_server/netlogon/dcerpc_netlogon.c
source4/rpc_server/samr/dcesrv_samr.c
source4/rpc_server/srvsvc/dcesrv_srvsvc.c
source4/smb_server/smb/service.c
source4/smbd/service.c
source4/torture/basic/mangle_test.c
source4/torture/gpo/apply.c
source4/torture/krb5/kdc-canon-heimdal.c
source4/torture/ldap/basic.c
source4/torture/ldap/netlogon.c
source4/torture/libnetapi/libnetapi_group.c
source4/torture/libnetapi/libnetapi_user.c
source4/torture/raw/search.c
source4/torture/rpc/drsuapi_cracknames.c
source4/torture/rpc/forest_trust.c
source4/torture/rpc/netlogon.c
source4/torture/rpc/samr.c
source4/torture/smb2/mangle.c
source4/torture/unix/whoami.c
source4/utils/oLschema2ldif/lib.c

index 259b35b73b0a5dd5aad7886c7e249d23d04525d3..c321f7131302b5a0081b8149d54003ab5b5241b7 100644 (file)
@@ -38,6 +38,8 @@
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_AUTH
 
+#undef strncasecmp
+
 static void cli_credentials_invalidate_client_gss_creds(
                                        struct cli_credentials *cred,
                                        enum credentials_obtained obtained);
index d2d62d6652e6071c15ed5bf5b8616ac492546722..d34ef2d5e39ff0c6d210ea0a7abb905dd6389fcc 100644 (file)
@@ -37,6 +37,8 @@
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_AUTH
 
+#undef strcasecmp
+
 /* the list of currently registered GENSEC backends */
 static const struct gensec_security_ops **generic_security_ops;
 static int gensec_num_backends;
index 84a19bd380551af2db88cc169079e150981dc253..7f4384f443e6623ac3c7839b424144c6db96e006 100644 (file)
@@ -31,6 +31,8 @@
 
 #define MAX_DFS_RESPONSE 56*1024 /* 56 Kb */
 
+#undef strcasecmp
+
 /* A DC set is a group of DC, they might have been grouped together
    because they belong to the same site, or to site with same cost ...
 */
index 7f53e6420e1c0bafd3313e522eefee77d99b5ba6..08e2096b9140eee4a0ac5093c4c5ccb9fc3b56cb 100644 (file)
@@ -1944,6 +1944,7 @@ int ldb_dn_update_components(struct ldb_dn *dn, const struct ldb_dn *ref_dn);
   strcasecmp and toupper here is ok.
   return 0 for match
 */
+#undef strcasecmp
 #define ldb_attr_cmp(a, b) strcasecmp(a, b)
 char *ldb_attr_casefold(TALLOC_CTX *mem_ctx, const char *s);
 int ldb_attr_dn(const char *attr);
index 71635c6fea37f18e9d6a1408165a16a793ea5ef0..547dc51e59d5c6571c020a8908be22678bfab2bd 100644 (file)
@@ -21,6 +21,9 @@
 #include "includes.h"
 #include "torture/torture.h"
 
+#undef strcasecmp
+#undef strncasecmp
+
 struct torture_suite *torture_local_charset(TALLOC_CTX *mem_ctx);
 
 static bool test_toupper_m(struct torture_context *tctx)
index 3f5b247bd92e1d63c62116a843f4d5d99448aa33..d1148c7387aacdeb461a0d7a9c251e204cec9aae 100644 (file)
 #ifdef strcasecmp
 #undef strcasecmp
 #endif
+#ifdef strncasecmp
+#undef strncasecmp
+#endif
+
 
 /**
  Case insensitive string compararison, handle specified for testing
index a6c052f8746d5c430164524c573fc83d0a6d152e..edff296f028581f061da34eaa55d443af9e23902 100644 (file)
@@ -2,6 +2,7 @@
    Unix SMB/CIFS implementation.
    Safe string handling routines.
    Copyright (C) Andrew Tridgell 1994-1998
+   Copyright (C) Andrew Bartlett <abartlet@samba.org> 2003
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
 #ifndef _SAFE_STRING_H
 #define _SAFE_STRING_H
-
 #ifndef _SPLINT_ /* http://www.splint.org */
+
 /* Some macros to ensure people don't use buffer overflow vulnerable string
    functions. */
 
+#ifdef bcopy
+#undef bcopy
+#endif /* bcopy */
+#define bcopy(src,dest,size) __ERROR__XX__NEVER_USE_BCOPY___;
+
 #ifdef strcpy
 #undef strcpy
 #endif /* strcpy */
 #endif /* sprintf */
 #define sprintf __ERROR__XX__NEVER_USE_SPRINTF__;
 
+/*
+ * strcasecmp/strncasecmp aren't an error, but it means you're not thinking about
+ * multibyte. Don't use them. JRA.
+ */
+#ifdef strcasecmp
+#undef strcasecmp
+#endif
+#define strcasecmp __ERROR__XX__NEVER_USE_STRCASECMP__;
+
+#ifdef strncasecmp
+#undef strncasecmp
+#endif
+#define strncasecmp __ERROR__XX__NEVER_USE_STRNCASECMP__;
+
 #endif /* !_SPLINT_ */
 
 #endif
index daaf9808b8f70fda9e0e9badbb4ec770b74bd426..8376f8876a4ba1143b1bc94bd5bff7b81a5a9988 100644 (file)
@@ -28,7 +28,9 @@
 #include "system/locale.h"
 #include "system/filesys.h"
 #include "lib/util/util_net.h"
+
 #undef strcasecmp
+#undef strncasecmp
 
 /*******************************************************************
  Set an address to INADDR_ANY.
index 5bafb839d65e4197ad2a831433baf306ab219133..2f09b9d5eac6094ec65f81066f2addbd687c114e 100644 (file)
@@ -27,6 +27,8 @@
 #include "auth/gensec/gensec_internal.h"
 #include "lib/util/base64.h"
 
+#undef strncasecmp
+
 _PUBLIC_ NTSTATUS gensec_http_generic_init(TALLOC_CTX *);
 
 struct gensec_http_generic_state {
index 6be053136c837c1b185ecf18a2caf4d3977667ae..d20fc25f9e2ac82171e10067dab6ae1f575d1959 100644 (file)
@@ -26,6 +26,7 @@
 #include "util/tevent_werror.h"
 #include "lib/util/dlinklist.h"
 
+#undef strcasecmp
 
 /**
  * Determines if a response should have a body.
index ece660584f649c85925c06611e11aec201424ad6..3dcf52c626e4ffc350bf1f182d1ef109434e15b8 100644 (file)
@@ -29,6 +29,9 @@
 #include "auth/credentials/credentials.h"
 #include "lib/util/data_blob.h"
 
+#undef strcasecmp
+#undef strncasecmp
+
 /**
  * Copy the request headers from src to dst
  */
index e47ed04c30f8b69af02a348b0e305803871e577d..634628f04d92eed7c01bd5595f2eaa5d44533e3e 100644 (file)
@@ -28,6 +28,9 @@
 #include "../librpc/gen_ndr/netlogon.h"
 #include "../libcli/security/security.h"
 
+#undef strcasecmp
+#undef strncasecmp
+
 /*
  * Some useful sids, more well known sids can be found at
  * http://support.microsoft.com/kb/243330/EN-US/
index 3d622b2be499732eeccc7ebef68ef7273de8e855..42e8e6110193857d19e01087c41cf0b64a1e53f8 100644 (file)
@@ -33,6 +33,8 @@
 #include "lib/crypto/gnutls_helpers.h"
 #include <gnutls/crypto.h>
 
+#undef strncasecmp
+
 /* we need to be able to get/set the fragment length without doing a full
    decode */
 void dcerpc_set_frag_length(DATA_BLOB *blob, uint16_t v)
index 88838121f2fb5ac31a62b80fb0d078a1c00ea310..a12bf1340773d85e565652c4e77a265161d0511d 100644 (file)
@@ -37,6 +37,8 @@
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_RPC_SRV
 
+#undef strcasecmp
+
 static NTSTATUS dcesrv_negotiate_contexts(struct dcesrv_call_state *call,
                                const struct dcerpc_bind *b,
                                struct dcerpc_ack_ctx *ack_ctx_list);
index 8fa65cc312231d145615e59c389c074ece816069..33bca3363b783a1ed9c143fcb04fc6e5a6280930 100644 (file)
@@ -297,7 +297,7 @@ typedef char fstring[FSTRING_LEN];
 /* String routines */
 
 #include "srvstr.h"
-#include "safe_string.h"
+#include "lib/util/safe_string.h"
 
 #ifndef SIGCLD
 #define SIGCLD SIGCHLD
diff --git a/source3/include/safe_string.h b/source3/include/safe_string.h
deleted file mode 100644 (file)
index 4609e3a..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/* 
-   Unix SMB/CIFS implementation.
-   Safe string handling routines.
-   Copyright (C) Andrew Tridgell 1994-1998
-   Copyright (C) Andrew Bartlett <abartlet@samba.org> 2003
-   
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-   
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-   
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef _SAFE_STRING_H
-#define _SAFE_STRING_H
-
-#ifndef _SPLINT_ /* http://www.splint.org */
-
-/* Some macros to ensure people don't use buffer overflow vulnerable string
-   functions. */
-
-#ifdef bcopy
-#undef bcopy
-#endif /* bcopy */
-#define bcopy(src,dest,size) __ERROR__XX__NEVER_USE_BCOPY___;
-
-#ifdef strcpy
-#undef strcpy
-#endif /* strcpy */
-#define strcpy(dest,src) __ERROR__XX__NEVER_USE_STRCPY___;
-
-#ifdef strcat
-#undef strcat
-#endif /* strcat */
-#define strcat(dest,src) __ERROR__XX__NEVER_USE_STRCAT___;
-
-#ifdef sprintf
-#undef sprintf
-#endif /* sprintf */
-#define sprintf __ERROR__XX__NEVER_USE_SPRINTF__;
-
-/*
- * strcasecmp/strncasecmp aren't an error, but it means you're not thinking about
- * multibyte. Don't use them. JRA.
- */
-#ifdef strcasecmp
-#undef strcasecmp
-#endif
-#define strcasecmp __ERROR__XX__NEVER_USE_STRCASECMP__;
-
-#ifdef strncasecmp
-#undef strncasecmp
-#endif
-#define strncasecmp __ERROR__XX__NEVER_USE_STRNCASECMP__;
-
-#endif /* !_SPLINT_ */
-
-#endif
index fbc68d6bec54e3cda523a9753a2e5aff6d31e622..5c1aa5fb7ac621e4eab62993cb96fdf92e718d0a 100644 (file)
@@ -28,6 +28,8 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #include "system/filesys.h"
 #include "vfs_vxfs.h"
 
+#undef strcasecmp
+
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_VFS
 
index b655283975b10effb0b31ec759ad374063b09c45..209786b63b2ff4b72cafa106cf453fa66b8ca832 100644 (file)
@@ -27,6 +27,8 @@
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_AUTH
 
+#undef strncasecmp
+
 _PUBLIC_ NTSTATUS auth4_developer_init(TALLOC_CTX *);
 
 static NTSTATUS name_to_ntstatus_want_check(struct auth_method_context *ctx,
index 27e2097515646a188e5dc8c88d59d55caa73b11a..549e5343f8461223aee224d673952832c6f9078d 100644 (file)
@@ -58,6 +58,8 @@
 #define DEFAULT_PAGER "more"
 #endif
 
+#undef strncasecmp
+
 struct smbclient_context {
        char *remote_cur_dir;
        struct smbcli_state *cli;
index 990f4dc2edacaed0355dd1f519c3d6c9a10f4de8..687313b0a78e94c08ee1f720d08eda11dde81313 100644 (file)
@@ -41,6 +41,8 @@
 #include "dnsserver_common.h"
 #include "lib/util/smb_strtox.h"
 
+#undef strcasecmp
+
 struct b9_options {
        const char *url;
        const char *debug;
index 8635d075be8060c21a789c60a5020e4ae740b69b..bcb0d087faf665b9e43b5ee9302fc1d0e32f77e6 100644 (file)
@@ -37,6 +37,8 @@
 #undef DBGC_CLASS
 #define DBGC_CLASS DBGC_DNS
 
+#undef strncasecmp
+
 uint8_t werr_to_dns_err(WERROR werr)
 {
        if (W_ERROR_EQUAL(WERR_OK, werr)) {
index a4d90135b4106f546833beaa240e7a1892788e3c..77b77de887b77e3bb164149dbab1730864240a65 100644 (file)
@@ -51,6 +51,8 @@
 #include "libcli/util/ntstatus.h"
 #include "lib/util/smb_strtox.h"
 
+#undef strncasecmp
+
 /*
  * This included to allow us to handle DSDB_FLAG_REPLICATED_UPDATE in
  * dsdb_request_add_controls()
index b4571dca95700f04d5b46cc2e6006a2e6f1ddf58..0f4d5584192edc4357370b3402607892ad7ef7d4 100644 (file)
@@ -35,6 +35,8 @@
 #include "lib/crypto/md4.h"
 #include "libcli/ldap/ldap_ndr.h"
 
+#undef strcasecmp
+
 NTSTATUS dsdb_trust_forest_info_from_lsa(TALLOC_CTX *mem_ctx,
                                const struct lsa_ForestTrustInformation *lfti,
                                struct ForestTrustInfo **_fti)
index a3ffd350ab0e016b3c2a8edf73865b82ebe5a82d..57b82131225d3850616949838ff9c065d0e91c47 100644 (file)
@@ -37,6 +37,8 @@
 #undef DBGC_CLASS
 #define DBGC_CLASS            DBGC_DRS_REPL
 
+#undef strcasecmp
+
 /*
   load the partitions list based on replicated NC attributes in our
   NTDSDSA object
index b4bd9d8f9c9a11e9b943185027c3ad129ffaf7e9..544a5f6a88c82cf8ad2f234988478ee15939d628 100644 (file)
@@ -37,6 +37,8 @@
 #include "dsdb/common/util.h"
 #include "param/param.h"
 
+#undef strcasecmp
+
 static WERROR DsCrackNameOneFilter(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ctx,
                                   struct smb_krb5_context *smb_krb5_context,
                                   uint32_t format_flags, enum drsuapi_DsNameFormat format_offered,
index b1bbf93600601c9dc041544422b382d3bc7aa116..802969d50d5f7b10b8ba8b89a030c8047cee908c 100644 (file)
@@ -43,6 +43,9 @@
 #include "system/kerberos.h"
 #include "auth/kerberos/kerberos.h"
 
+#undef strcasecmp
+#undef strncasecmp
+
 struct extended_access_check_attribute {
        const char *oa_name;
        const uint32_t requires_rights;
index aa9e2807e050c16c99a490e3742b17276bf58cde..c72898a7862504741c31e5aece15f655a32c5a5c 100644 (file)
@@ -38,6 +38,8 @@
 #define NULL_REQ_PSEUDO_N -2LL;
 #define STAR_REQ_PSEUDO_N -4LL;
 
+#undef strcasecmp
+
 struct count_attrs_private {
        struct tdb_wrap *requested;
        struct tdb_wrap *duplicates;
index d3ce7e31642121bf21fe2f9778914c507ade3bff..8c59418c3c1122b1bb888f39afc2482621739bc8 100644 (file)
@@ -50,6 +50,7 @@ static const size_t num_secret_attributes = ARRAY_SIZE(secret_attributes);
 #define NUMBER_OF_KEYS 1
 #define SECRETS_KEY_FILE "encrypted_secrets.key"
 
+#undef strcasecmp
 
 struct es_data {
        /*
index b7ca636598f6842ea403cd348d986f409b6db2e0..5c5521d0b21d3845453952b008ef0ce557357cae 100644 (file)
@@ -37,6 +37,8 @@
 #include "dsdb/samdb/ldb_modules/util.h"
 #include "lib/ldb-samba/ldb_matching_rules.h"
 
+#undef strncasecmp
+
 /*
   TODO: if relax is not set then we need to reject the fancy RMD_* and
   DELETED extended DN codes
index 2b680a325327264e1d14b58447cf1f4c104d1d3c..53cbe345070abe3d8a2fee42ad6d56aaea02fa31 100644 (file)
@@ -42,6 +42,9 @@
 #include "dsdb/samdb/samdb.h"
 #include "dsdb/samdb/ldb_modules/util.h"
 
+#undef strcasecmp
+#undef strncasecmp
+
 struct extended_dn_out_private {
        bool dereference;
        bool normalise;
index d8ccd38537d1c109f68d4b9211420b1a934a1761..5ef075f20371ee182a5ac09b3523f066474487b3 100644 (file)
@@ -53,6 +53,7 @@
 #include "librpc/gen_ndr/ndr_misc.h"
 #include "dsdb/samdb/ldb_modules/util.h"
 
+#undef strcasecmp
 
 struct la_private_transaction {
        struct la_context *la_list;
index 1e74d1b962789f414dde93646de771fedfb2b1ae..e5ca65f3b36622723aeadfcb88eae946af4caa28 100644 (file)
@@ -39,6 +39,8 @@
 #include "libds/common/flag_mapping.h"
 #include "lib/util/util_net.h"
 
+#undef strcasecmp
+
 /*
   fill in the cldap netlogon union for a given version
 */
index bfdfa51595a5f9e62f95978353e03983b4d5b9d3..5a05bf2952e2be2531fedd611f49e809a1eab866 100644 (file)
@@ -65,6 +65,8 @@
 #define MINIMUM_GPGME_VERSION "1.2.0"
 #endif
 
+#undef strncasecmp
+
 /* If we have decided there is a reason to work on this request, then
  * setup all the password hash types correctly.
  *
index 984387999979a869ac86ea9afa7861869365f11a..b010abb8ab499820e1b57e38ba8793d744bbd859 100644 (file)
@@ -32,6 +32,8 @@
 #include "includes.h"
 #include "ldb_module.h"
 
+#undef strncasecmp
+
 struct rr_context {
        struct ldb_module *module;
        struct ldb_request *req;
index 58c04da5f53f4d7696e1c1904c70c240b3766812..fbeab0b182543fc552279b5b9e23111078cb40e0 100644 (file)
@@ -52,6 +52,8 @@
 #include "lib/util/tsort.h"
 #include "lib/util/binsearch.h"
 
+#undef strcasecmp
+
 #undef DBGC_CLASS
 #define DBGC_CLASS            DBGC_DRS_REPL
 
index 55340fa4f1e642adccd60ef2adec6f81e949bddc..4607300bf3a010f5f1ad66e84a77eaa9ea9412ee 100644 (file)
@@ -38,6 +38,8 @@
 #include "cldap_server/cldap_server.h"
 #include "lib/events/events.h"
 
+#undef strcasecmp
+
 struct rootdse_private_data {
        unsigned int num_controls;
        char **controls;
index 2a43807272c488b98fa5b5f2c01fff8572864d49..71338340c81df006a6b8c0d5c53c029812f6e3ba 100644 (file)
@@ -47,6 +47,8 @@
 #include "librpc/gen_ndr/irpc.h"
 #include "lib/util/smb_strtox.h"
 
+#undef strcasecmp
+
 struct samldb_ctx;
 enum samldb_add_type {
        SAMLDB_TYPE_USER,
index 127a6be9f643abbe4d1bbcb0091419fdc8973515..697ce218bcdc6c48adb9b73f429bc51ccba59bc5 100644 (file)
@@ -30,6 +30,8 @@
 #include "param/param.h"
 #include "dsdb/samdb/ldb_modules/util.h"
 
+#undef strcasecmp
+
 static int generate_objectClasses(struct ldb_context *ldb, struct ldb_message *msg,
                                  const struct dsdb_schema *schema);
 static int generate_attributeTypes(struct ldb_context *ldb, struct ldb_message *msg,
index 71a417ed8437c7d14e865a7b3a99a2481d251520..ebb886da677f0487fb39df73b9a606b4994be895 100644 (file)
@@ -23,6 +23,8 @@
 #include "dsdb/samdb/samdb.h"
 #include "system/locale.h"
 
+#undef strcasecmp
+
 #define SEPERATOR "\n  "
 
 struct attr_map {
index 7d51e813873e054caadc9a6ab05b5960a77c6970..36a3ff2f3bb03e9c6420840aec6f77d6cb401247 100644 (file)
@@ -22,6 +22,8 @@
 #include "dsdb/samdb/samdb.h"
 #include "librpc/ndr/libndr.h"
 
+#undef strcasecmp
+
 #define IF_NULL_FAIL_RET(x) do {     \
                if (!x) {               \
                        return NULL;    \
index e79e3e7dfc6b373a946e4285f0482d6b31a4187a..a3b00497b6bdb99c5b3d530f7bde189a223669d2 100644 (file)
@@ -32,6 +32,7 @@
 #include <ldb_module.h>
 #include "../lib/util/asn1.h"
 
+#undef strcasecmp
 
 struct dsdb_schema *dsdb_new_schema(TALLOC_CTX *mem_ctx)
 {
index 4042aa6966b780baee322e18b09c4bfad70b7964..fc34764881c476492ee64ce1ed22840b4983c3b8 100644 (file)
@@ -27,6 +27,9 @@
 #include "lib/util/tsort.h"
 #include "util/dlinklist.h"
 
+#undef strcasecmp
+#undef strncasecmp
+
 static const char **dsdb_full_attribute_list_internal(TALLOC_CTX *mem_ctx, 
                                                      const struct dsdb_schema *schema, 
                                                      const char **class_list,
index 2ee2596570e40a72e0502f900e2f3f537d87c08c..f4934917c7c32940dc5bf7435a8766df550f4b48 100644 (file)
@@ -30,6 +30,8 @@
 #include "librpc/gen_ndr/ndr_misc.h"
 #include "lib/util/tsort.h"
 
+#undef strcasecmp
+
 /* change this when we change something in our schema code that
  * requires a re-index of the database
  */
index 60a26a2620bee5f6330034bdb50b67f42001e430..fcf9ca4ce3cf3c5d4fb1ada6e54728ece2f257d6 100644 (file)
@@ -32,6 +32,8 @@
 #include "librpc/ndr/libndr.h"
 #include "../lib/util/asn1.h"
 
+#undef strcasecmp
+
 /**
  * Initialize dsdb_syntax_ctx with default values
  * for common cases.
index 5fd0f431cdfefb4b06bf2e7d2f6109076830722f..a560a1cd84b7e3ee7537b75a5da127d5f5f153d3 100644 (file)
@@ -38,6 +38,8 @@
 #include "librpc/gen_ndr/ndr_irpc_c.h"
 #include "lib/messaging/irpc.h"
 
+#undef strcasecmp
+#undef strncasecmp
 
 #define SAMBA_KVNO_GET_KRBTGT(kvno) \
        ((uint16_t)(((uint32_t)kvno) >> 16))
index 5cd72d3e2583fe89de7abc7d2e41a822f319e6c2..c2d53eacd3f81c4a774f5b1fb46a20c589106b32 100644 (file)
@@ -49,6 +49,8 @@
 #include "libds/common/roles.h"
 #include "lib/util/time.h"
 
+#undef strcasecmp
+
 static void ldapsrv_terminate_connection_done(struct tevent_req *subreq);
 
 /*
index 088d7fe2967aca65b3627a358b63015cfb09feb8..0e9eff147c59c2b2b01c39139ee84400d83c4de4 100644 (file)
@@ -32,6 +32,8 @@
 #include "auth/credentials/credentials.h"
 #include "libcli/composite/composite.h"
 
+#undef strncasecmp
+
 #define DCOM_NEGOTIATED_PROTOCOLS { EPM_PROTOCOL_TCP, EPM_PROTOCOL_SMB, EPM_PROTOCOL_NCALRPC }
 
 static NTSTATUS dcerpc_binding_from_STRINGBINDING(TALLOC_CTX *mem_ctx, struct dcerpc_binding **b_out, struct STRINGBINDING *bd)
index 38f4d9007d8ae3b5cd7f54f3c7a4eedceda02e19..2900c10419a641b950be7e35a0066b0bb0d2d95a 100644 (file)
@@ -22,6 +22,7 @@
 #include "lib/registry/registry.h"
 #include "system/filesys.h"
 
+#undef strcasecmp
 
 /**
  * @file
index 1897e2c55f5258bcd9c161c7c0986dc7c30ce35b..50bd141213741a18338b4b639ec155bc4ad24b96 100644 (file)
@@ -25,6 +25,9 @@
 #include "librpc/gen_ndr/winreg.h"
 #include "lib/util/sys_rw.h"
 
+#undef strcasecmp
+#undef strncasecmp
+
 struct preg_data {
        int fd;
        TALLOC_CTX *ctx;
index 763b0ce431935b9618b069adee8e9129178bd47b..1e0b14324af64abd712cc6bfc0faf0033d063bda 100644 (file)
@@ -26,6 +26,7 @@
 #include "lib/registry/registry.h"
 #include "libcli/security/security.h"
 
+#undef strcasecmp
 
 static struct hive_operations reg_backend_regf;
 
index 762ec3d48c4789e3cf9a022496b17698a22b4317..62dbf1d2213431fbbbe63b13d8bff033a214c718 100644 (file)
@@ -27,6 +27,8 @@
 #include "system/network.h"
 #include "lib/util/util_net.h"
 
+#undef strcasecmp
+
 _PUBLIC_ const struct socket_ops *socket_ipv4_ops(enum socket_type type);
 _PUBLIC_ const struct socket_ops *socket_ipv6_ops(enum socket_type type);
 
index bae26e06c8c3468b68cceb7219f0c06c7a712458..a24800c515f6d980cd2ea7aa0b26624e424b11a3 100644 (file)
@@ -37,6 +37,8 @@
 #include "libcli/dgram/libdgram.h"
 #include "lib/socket/socket.h"
 
+#undef strcasecmp
+
 /*
   destroy a mailslot handler
 */
index 139030090be14051f818fee69fb51f948f55abfd..db2606b5a32d65b5089a4f5243392cbab21d7477 100644 (file)
@@ -30,6 +30,8 @@
 #include "lib/tsocket/tsocket.h"
 #include "lib/util/util_net.h"
 
+#undef strcasecmp
+
 struct resolve_state {
        struct resolve_context *ctx;
        struct resolve_method *method;
index ad355fc3c4d104e87a6b3a28dc3544f137de1018..9a7b9aeb8d1eea41259a351756306c945e7139cc 100644 (file)
@@ -38,6 +38,8 @@
 #include "libcli/http/http.h"
 #include "lib/util/util_net.h"
 
+#undef strcasecmp
+
 struct dcerpc_pipe_connect {
        struct dcecli_connection *conn;
        struct dcerpc_binding *binding;
index b20b154a1cb8c007246e29a82ace9e2ce607968c..8719ff9821ee287c740be8b66d0e1aeeee2bfd52 100644 (file)
@@ -33,6 +33,8 @@
 #include "librpc/rpc/dcerpc_proto.h"
 #include "libcli/composite/composite.h"
 
+#undef strncasecmp
+
 /* transport private information used by SMB pipe transport */
 struct smb_private {
        DATA_BLOB session_key;
index 414a31f493195d21eb8e2ab1da4a22008ee2e4e9..e4a7c2042ed5889c2a479704a27b8e47f979be3c 100644 (file)
@@ -33,6 +33,8 @@
 #include "param/param.h"
 #include "lib/util/smb_strtox.h"
 
+#undef strcasecmp
+
 uint64_t winsdb_get_maxVersion(struct winsdb_handle *h)
 {
        int ret;
index 37660ca0a1cfe796192fd1599ba65b39c5007607..967c80d299591f9b4837947725c3956f5d413ac4 100644 (file)
@@ -43,6 +43,8 @@
 #include "system/locale.h"
 #include "system/filesys.h"
 
+#undef strncasecmp
+
 /* this is the private structure used to keep the state of an open
    ipc$ connection. It needs to keep information about all open
    pipes */
index 6b868df743a4a1ea6b33fead6b58171f0574b555..a492f7e97fb8247cad9cf5b8867016123b28a5ce 100644 (file)
@@ -35,6 +35,8 @@
 #include "libcli/smb2/smb2.h"
 #include "libcli/smb2/smb2_calls.h"
 
+#undef strcasecmp
+
 /* a second stage function converts from the out parameters of the generic
    call onto the out parameters of the specific call made */
 typedef NTSTATUS (*second_stage_t)(struct ntvfs_module_context *,
index bdd86f20973a2a8545db648352f53e88110de6d2..46a235429aa0a673a47059a6e5195833d0d6ced3 100644 (file)
@@ -24,6 +24,8 @@
 #include "vfs_posix.h"
 #include "param/param.h"
 
+#undef strcasecmp
+
 /*
   this mangling scheme uses the following format
 
index b6e6ffc9af6bc71201d50fe539d9fd5324b3f4c6..1ef72f15cd1fbb360687239e209af1b5bf8bb9c4 100644 (file)
@@ -29,6 +29,8 @@
 #include "param/param.h"
 #include "lib/util/samba_modules.h"
 
+#undef strcasecmp
+
 /* list of registered backends */
 static struct sys_lease_ops *backends;
 static uint32_t num_backends;
index 7e00032959a11e8dd06c9d5963d3aaf03d1c51b9..6991461ece750d60b9ad5b14acccd44949ee89d6 100644 (file)
@@ -30,6 +30,8 @@
 #include "param/param.h"
 #include "lib/util/samba_modules.h"
 
+#undef strcasecmp
+
 /* list of registered backends */
 static struct sys_notify_backend *backends;
 static uint32_t num_backends;
index f8b1a3f5d977eb8b1d1f6bfe3d8ddb9bd5de0192..30d7f205cd14321d48e78c571616aebffb8f6516 100644 (file)
@@ -27,6 +27,8 @@
 #include "param/share.h"
 #include "param/param.h"
 
+#undef strcasecmp
+
 NTSTATUS share_ldb_init(TALLOC_CTX *);
 
 static NTSTATUS sldb_init(TALLOC_CTX *mem_ctx, const struct share_ops *ops, 
index 36f5e5823ebdc4526ba1d4d7aeba3c9d3a60dc04..181f95a59182a00ad5f3f9dfa98b2e8ba35e1b16 100644 (file)
@@ -44,6 +44,8 @@
 
 #include "lib/crypto/gnutls_helpers.h"
 
+#undef strncasecmp
+
 #define DCESRV_INTERFACE_BACKUPKEY_BIND(context, iface) \
        dcesrv_interface_backupkey_bind(context, iface)
 static NTSTATUS dcesrv_interface_backupkey_bind(struct dcesrv_connection_context *context,
index 34330b92ca10fe65dbc196b339b5a66ef09acbaf..d7ed5ee42415da0a15171db2eed4e50d582d4651 100644 (file)
@@ -25,6 +25,8 @@
 #include "rpc_server/dcerpc_server.h"
 #include "rpc_server/common/share.h"
 
+#undef strcasecmp
+
 /* 
     Here are common server info functions used by some dcerpc server interfaces
 */
index 88efc01f15435a2b4e186c5abf287e6a7719aefb..a5948c7969b95f511ff7b4bad60001862088edb0 100644 (file)
@@ -28,6 +28,8 @@
 #include "dns_server/dnsserver_common.h"
 #include "dnsserver.h"
 
+#undef strcasecmp
+
 #define DCESRV_INTERFACE_DNSSERVER_BIND(context, iface) \
        dcesrv_interface_dnsserver_bind(context, iface)
 static NTSTATUS dcesrv_interface_dnsserver_bind(struct dcesrv_connection_context *context,
index 47d6f5d5c8836e069b36bef235faa09d0fd207a8..31d0233cf52792ef6d8267ab44b17694ba9d98b7 100644 (file)
@@ -26,6 +26,7 @@
 #include "librpc/gen_ndr/ndr_dnsp.h"
 #include "librpc/gen_ndr/ndr_dnsserver.h"
 
+#undef strcasecmp
 
 struct IP4_ARRAY *ip4_array_copy(TALLOC_CTX *mem_ctx, struct IP4_ARRAY *ip4)
 {
index 798c869efe5c7eff8bcc38a7ecef3552125b331b..5ac11aea27049b5664ac21df7f701e267ec12267 100644 (file)
@@ -29,6 +29,8 @@
 #include "libcli/security/security.h"
 #include "dsdb/common/util.h"
 
+#undef strcasecmp
+
 /* There are only 2 fixed partitions for DNS */
 struct dnsserver_partition *dnsserver_db_enumerate_partitions(TALLOC_CTX *mem_ctx,
                                                        struct dnsserver_serverinfo *serverinfo,
index 880e120c39a7f07a3aa8cfc44f349838cc84827b..94407be0dcf9f306b73be18c8ed20c7ba2d00c84 100644 (file)
@@ -28,6 +28,8 @@
 #include "lib/util/util_net.h"
 #include "dnsserver_common.h"
 
+#undef strcasecmp
+
 static struct DNS_ADDR_ARRAY *fill_dns_addr_array(TALLOC_CTX *mem_ctx,
                                           struct loadparm_context *lp_ctx,
                                           bool listen_only)
index c6faea39e9f9a6e7645f040a7d5a9f630c21fd8f..9e4b533365a18ea278236c2e62d261c72037164c 100644 (file)
@@ -35,6 +35,8 @@
 #undef DBGC_CLASS
 #define DBGC_CLASS            DBGC_DRS_REPL
 
+#undef strcasecmp
+
 /*
   check that the SPN update should be allowed as an override
   via sam_ctx_system
index acd37131d7989464c97af912ff14d823bf407ea4..ebe259ff81e673222ecfc21cf1781ec56f111a3a 100644 (file)
@@ -39,6 +39,8 @@
 #include <gnutls/gnutls.h>
 #include <gnutls/crypto.h>
 
+#undef strcasecmp
+
 #define DCESRV_INTERFACE_LSARPC_BIND(context, iface) \
        dcesrv_interface_lsarpc_bind(context, iface)
 static NTSTATUS dcesrv_interface_lsarpc_bind(struct dcesrv_connection_context *context,
index 0ab55afeab0d1a7728a600b1cddc07fcd753039b..0351e2d286ce6ce929531f9decb658f961d472f8 100644 (file)
@@ -48,6 +48,8 @@
 #define DCESRV_INTERFACE_NETLOGON_BIND(context, iface) \
        dcesrv_interface_netlogon_bind(context, iface)
 
+#undef strcasecmp
+
 /*
  * This #define allows the netlogon interface to accept invalid
  * association groups, because association groups are to coordinate
index 70f914bf14c728b1e69eea73ad97d7ef4525edef..cda887d45eeef6dd84d013de4a462733fafed120 100644 (file)
@@ -41,6 +41,8 @@
 #include "lib/util/tsort.h"
 #include "libds/common/flag_mapping.h"
 
+#undef strcasecmp
+
 #define DCESRV_INTERFACE_SAMR_BIND(context, iface) \
        dcesrv_interface_samr_bind(context, iface)
 static NTSTATUS dcesrv_interface_samr_bind(struct dcesrv_connection_context *context,
index 7294c90a3289c05178e30a69b8a8dde97019687b..c41fbc7573f33e54e7a04adab062e2307a7a72dc 100644 (file)
@@ -31,6 +31,9 @@
 #include "rpc_server/srvsvc/proto.h"
 #include "param/param.h"
 
+#undef strcasecmp
+#undef strncasecmp
+
 #define SRVSVC_CHECK_ADMIN_ACCESS do { \
        struct auth_session_info *si = dcesrv_call_session_info(dce_call); \
        struct security_token *t = si->security_token; \
index e25be1c382d75eae851d1d06c350e805493f92a4..c23b470e472e2319a01b8ca5e1d8e57078aff1aa 100644 (file)
@@ -23,6 +23,8 @@
 #include "ntvfs/ntvfs.h"
 #include "param/param.h"
 
+#undef strcasecmp
+
 /****************************************************************************
   Make a connection, given the snum to connect to, and the vuser of the
   connecting user if appropriate.
index 7c8d2cfe3a4d53d475ea4e357fe43e23bf5efe2e..e939c85e6898cdee42ab490553b0f158c9a8ddd4 100644 (file)
@@ -24,6 +24,8 @@
 #include "../lib/util/dlinklist.h"
 #include "smbd/process_model.h"
 
+#undef strcasecmp
+
 /*
   a linked list of registered servers
 */
index df12b3ce821cad80669cf6b4aa8a209d63e27ff6..0c3ccd54bf94e02e4db3212e553e52c3c256e236 100644 (file)
@@ -26,6 +26,8 @@
 #include "torture/util.h"
 #include "torture/basic/proto.h"
 
+#undef strcasecmp
+
 static TDB_CONTEXT *tdb;
 
 #define NAME_LENGTH 20
index c4a6499f4cc8cf7c126972b9368e69b80711a226..560408f7a85e7b2eeb9dc89a88a6c8b429d3dc4d 100644 (file)
@@ -30,6 +30,8 @@
 #include "lib/util/samba_util.h"
 #include "util/tevent_ntstatus.h"
 
+#undef strncasecmp
+
 struct torture_suite *gpo_apply_suite(TALLOC_CTX *ctx)
 {
        struct torture_suite *suite = torture_suite_create(ctx, "apply");
index 9e0808b134ced4adaeef6c41c901063d574183d2..cd47182c0ef32eceaf1bc57dc6425a18ae82fc6a 100644 (file)
@@ -34,6 +34,8 @@
 #include "auth/gensec/gensec.h"
 #include "param/param.h"
 
+#undef strcasecmp
+
 #define TEST_CANONICALIZE     0x0000001
 #define TEST_ENTERPRISE       0x0000002
 #define TEST_UPPER_REALM      0x0000004
index 825ee835c65737ea0936cc1e1dcc7904c254a952..ea3b5ddfc7ff06ab730a50ca09cee85ddb7f7e4f 100644 (file)
@@ -29,6 +29,7 @@
 #include "torture/torture.h"
 #include "torture/ldap/proto.h"
 
+#undef strcasecmp
 
 static bool test_bind_sasl(struct torture_context *tctx,
                           struct ldap_connection *conn, struct cli_credentials *creds)
index d23ce60910166a042b0c69459c081d699ab26812..c2dd8349fc695c6d2ca3c3791af7b161d48b2976 100644 (file)
@@ -33,6 +33,8 @@
 #include "torture/torture.h"
 #include "torture/ldap/proto.h"
 
+#undef strcasecmp
+
 #define CHECK_STATUS(status, correct) torture_assert_ntstatus_equal(tctx, status, correct, "incorrect status")
 
 #define CHECK_VAL(v, correct) torture_assert_int_equal(tctx, (v), (correct), "incorrect value");
index d27a99b5bfc2d1eec3add097e21fc46e9d587dea..f4b446d89d83f11e463ee178ec81188f23c1f432 100644 (file)
@@ -22,6 +22,8 @@
 #include <netapi.h>
 #include "torture/libnetapi/proto.h"
 
+#undef strcasecmp
+
 #define TORTURE_TEST_USER "testuser"
 
 #define NETAPI_STATUS(tctx, x,y,fn) \
index 134b4e8b9c0b77d1baae837be66c4b8ee5bc12fc..1411d7ef41b090f9e44f80bceffde01610e4c639 100644 (file)
@@ -22,6 +22,8 @@
 #include <netapi.h>
 #include "torture/libnetapi/proto.h"
 
+#undef strcasecmp
+
 #define TORTURE_TEST_USER "torture_testuser"
 #define TORTURE_TEST_USER2 "torture_testuser2"
 
index c7bb88a6d538a2032e289d24c4f47718a61044a9..14af01bffad49fb625d9ad2ddc60346a19b2c313 100644 (file)
@@ -26,6 +26,7 @@
 #include "lib/util/tsort.h"
 #include "torture/raw/proto.h"
 
+#undef strncasecmp
 
 #define BASEDIR "\\testsearch"
 
index a0daa60874841b866c46a537141ed85b7aeaca7d..f23c33fed7fd46d34515922fc1c75f41896cdb47 100644 (file)
@@ -27,6 +27,8 @@
 #include <ldb.h>
 #include "libcli/security/security.h"
 
+#undef strcasecmp
+
 struct DsCrackNamesPrivate {
        struct DsPrivate base;
 
index 118f0d27c53efeb6a45e81df26013a2bb639795b..ceb1a7ecbd9d9d2b83166e2318d53b47b83cf8b0 100644 (file)
@@ -34,6 +34,8 @@
 #include <gnutls/gnutls.h>
 #include <gnutls/crypto.h>
 
+#undef strcasecmp
+
 #define TEST_DOM "torturedom"
 #define TEST_DOM_DNS "torturedom.samba.example.com"
 #define TEST_DOM_SID "S-1-5-21-97398-379795-10000"
index 65188d2dc8569d17122b79b7629b8f540a075b9b..87c6ed548cbf97591e0fa4cfdf1c4684fc0eacc6 100644 (file)
@@ -38,6 +38,8 @@
 #include "lib/replace/system/network.h"
 #include "dsdb/samdb/samdb.h"
 
+#undef strcasecmp
+
 #define TEST_MACHINE_NAME "torturetest"
 
 static bool test_netr_broken_binding_handle(struct torture_context *tctx,
index e02d66adaf33cef9b00d986ce7a627faec9fe42b..5863a6d1ee6da45933f3f75c9789209c73ada356 100644 (file)
@@ -44,6 +44,8 @@
 #include "source3/rpc_client/init_samr.h"
 #include "lib/crypto/gnutls_helpers.h"
 
+#undef strcasecmp
+
 #define TEST_ACCOUNT_NAME "samrtorturetest"
 #define TEST_ACCOUNT_NAME_PWD "samrpwdlastset"
 #define TEST_ALIASNAME "samrtorturetestalias"
index f489f25654c6db34a11ae08daf132dad511af425..bf140643de241700de1f91fdc9be9e66a69c705e 100644 (file)
@@ -28,6 +28,8 @@
 #include "torture/util.h"
 #include "torture/smb2/proto.h"
 
+#undef strcasecmp
+
 static TDB_CONTEXT *tdb;
 
 #define NAME_LENGTH 20
index efcf910d30001576aa170fecc7be5a43770583fd..e76b0b7921c2623b53df16032976e915f3fd44e5 100644 (file)
@@ -32,6 +32,7 @@
 #include "dsdb/samdb/samdb.h"
 #include "../libcli/security/security.h"
 
+#undef strcasecmp
 
 /* Size (in bytes) of the required fields in the SMBwhoami response. */
 #define WHOAMI_REQUIRED_SIZE   40
index ad73bab5325d95817cfaea138977a7eb2890c7ad..9bed198aba1a1fb9642469c3aea895bebfc9813e 100644 (file)
@@ -36,6 +36,8 @@
 #include "ldb.h"
 #include "../librpc/gen_ndr/ndr_misc.h"
 
+#undef strcasecmp
+
 #include <gnutls/gnutls.h>
 #include <gnutls/crypto.h>