1
0
mirror of https://github.com/samba-team/samba.git synced 2025-06-19 23:17:05 +03:00

lib/util: remove extra safe_string.h file

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
This commit is contained in:
Matthew DeVore 2020-08-07 13:27:39 -07:00 committed by Jeremy Allison
parent c2ac923c6a
commit 232054c09b
90 changed files with 195 additions and 67 deletions

View File

@ -38,6 +38,8 @@
#undef DBGC_CLASS #undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH #define DBGC_CLASS DBGC_AUTH
#undef strncasecmp
static void cli_credentials_invalidate_client_gss_creds( static void cli_credentials_invalidate_client_gss_creds(
struct cli_credentials *cred, struct cli_credentials *cred,
enum credentials_obtained obtained); enum credentials_obtained obtained);

View File

@ -37,6 +37,8 @@
#undef DBGC_CLASS #undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH #define DBGC_CLASS DBGC_AUTH
#undef strcasecmp
/* the list of currently registered GENSEC backends */ /* the list of currently registered GENSEC backends */
static const struct gensec_security_ops **generic_security_ops; static const struct gensec_security_ops **generic_security_ops;
static int gensec_num_backends; static int gensec_num_backends;

View File

@ -31,6 +31,8 @@
#define MAX_DFS_RESPONSE 56*1024 /* 56 Kb */ #define MAX_DFS_RESPONSE 56*1024 /* 56 Kb */
#undef strcasecmp
/* A DC set is a group of DC, they might have been grouped together /* 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 ... because they belong to the same site, or to site with same cost ...
*/ */

View 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. strcasecmp and toupper here is ok.
return 0 for match return 0 for match
*/ */
#undef strcasecmp
#define ldb_attr_cmp(a, b) strcasecmp(a, b) #define ldb_attr_cmp(a, b) strcasecmp(a, b)
char *ldb_attr_casefold(TALLOC_CTX *mem_ctx, const char *s); char *ldb_attr_casefold(TALLOC_CTX *mem_ctx, const char *s);
int ldb_attr_dn(const char *attr); int ldb_attr_dn(const char *attr);

View File

@ -21,6 +21,9 @@
#include "includes.h" #include "includes.h"
#include "torture/torture.h" #include "torture/torture.h"
#undef strcasecmp
#undef strncasecmp
struct torture_suite *torture_local_charset(TALLOC_CTX *mem_ctx); struct torture_suite *torture_local_charset(TALLOC_CTX *mem_ctx);
static bool test_toupper_m(struct torture_context *tctx) static bool test_toupper_m(struct torture_context *tctx)

View File

@ -28,6 +28,10 @@
#ifdef strcasecmp #ifdef strcasecmp
#undef strcasecmp #undef strcasecmp
#endif #endif
#ifdef strncasecmp
#undef strncasecmp
#endif
/** /**
Case insensitive string compararison, handle specified for testing Case insensitive string compararison, handle specified for testing

View File

@ -2,6 +2,7 @@
Unix SMB/CIFS implementation. Unix SMB/CIFS implementation.
Safe string handling routines. Safe string handling routines.
Copyright (C) Andrew Tridgell 1994-1998 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 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 it under the terms of the GNU General Public License as published by
@ -19,11 +20,16 @@
#ifndef _SAFE_STRING_H #ifndef _SAFE_STRING_H
#define _SAFE_STRING_H #define _SAFE_STRING_H
#ifndef _SPLINT_ /* http://www.splint.org */ #ifndef _SPLINT_ /* http://www.splint.org */
/* Some macros to ensure people don't use buffer overflow vulnerable string /* Some macros to ensure people don't use buffer overflow vulnerable string
functions. */ functions. */
#ifdef bcopy
#undef bcopy
#endif /* bcopy */
#define bcopy(src,dest,size) __ERROR__XX__NEVER_USE_BCOPY___;
#ifdef strcpy #ifdef strcpy
#undef strcpy #undef strcpy
#endif /* strcpy */ #endif /* strcpy */
@ -39,6 +45,20 @@
#endif /* sprintf */ #endif /* sprintf */
#define sprintf __ERROR__XX__NEVER_USE_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 /* !_SPLINT_ */
#endif #endif

View File

@ -28,7 +28,9 @@
#include "system/locale.h" #include "system/locale.h"
#include "system/filesys.h" #include "system/filesys.h"
#include "lib/util/util_net.h" #include "lib/util/util_net.h"
#undef strcasecmp #undef strcasecmp
#undef strncasecmp
/******************************************************************* /*******************************************************************
Set an address to INADDR_ANY. Set an address to INADDR_ANY.

View File

@ -27,6 +27,8 @@
#include "auth/gensec/gensec_internal.h" #include "auth/gensec/gensec_internal.h"
#include "lib/util/base64.h" #include "lib/util/base64.h"
#undef strncasecmp
_PUBLIC_ NTSTATUS gensec_http_generic_init(TALLOC_CTX *); _PUBLIC_ NTSTATUS gensec_http_generic_init(TALLOC_CTX *);
struct gensec_http_generic_state { struct gensec_http_generic_state {

View File

@ -26,6 +26,7 @@
#include "util/tevent_werror.h" #include "util/tevent_werror.h"
#include "lib/util/dlinklist.h" #include "lib/util/dlinklist.h"
#undef strcasecmp
/** /**
* Determines if a response should have a body. * Determines if a response should have a body.

View File

@ -29,6 +29,9 @@
#include "auth/credentials/credentials.h" #include "auth/credentials/credentials.h"
#include "lib/util/data_blob.h" #include "lib/util/data_blob.h"
#undef strcasecmp
#undef strncasecmp
/** /**
* Copy the request headers from src to dst * Copy the request headers from src to dst
*/ */

View File

@ -28,6 +28,9 @@
#include "../librpc/gen_ndr/netlogon.h" #include "../librpc/gen_ndr/netlogon.h"
#include "../libcli/security/security.h" #include "../libcli/security/security.h"
#undef strcasecmp
#undef strncasecmp
/* /*
* Some useful sids, more well known sids can be found at * Some useful sids, more well known sids can be found at
* http://support.microsoft.com/kb/243330/EN-US/ * http://support.microsoft.com/kb/243330/EN-US/

View File

@ -33,6 +33,8 @@
#include "lib/crypto/gnutls_helpers.h" #include "lib/crypto/gnutls_helpers.h"
#include <gnutls/crypto.h> #include <gnutls/crypto.h>
#undef strncasecmp
/* we need to be able to get/set the fragment length without doing a full /* we need to be able to get/set the fragment length without doing a full
decode */ decode */
void dcerpc_set_frag_length(DATA_BLOB *blob, uint16_t v) void dcerpc_set_frag_length(DATA_BLOB *blob, uint16_t v)

View File

@ -37,6 +37,8 @@
#undef DBGC_CLASS #undef DBGC_CLASS
#define DBGC_CLASS DBGC_RPC_SRV #define DBGC_CLASS DBGC_RPC_SRV
#undef strcasecmp
static NTSTATUS dcesrv_negotiate_contexts(struct dcesrv_call_state *call, static NTSTATUS dcesrv_negotiate_contexts(struct dcesrv_call_state *call,
const struct dcerpc_bind *b, const struct dcerpc_bind *b,
struct dcerpc_ack_ctx *ack_ctx_list); struct dcerpc_ack_ctx *ack_ctx_list);

View File

@ -297,7 +297,7 @@ typedef char fstring[FSTRING_LEN];
/* String routines */ /* String routines */
#include "srvstr.h" #include "srvstr.h"
#include "safe_string.h" #include "lib/util/safe_string.h"
#ifndef SIGCLD #ifndef SIGCLD
#define SIGCLD SIGCHLD #define SIGCLD SIGCHLD

View File

@ -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

View File

@ -28,6 +28,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "system/filesys.h" #include "system/filesys.h"
#include "vfs_vxfs.h" #include "vfs_vxfs.h"
#undef strcasecmp
#undef DBGC_CLASS #undef DBGC_CLASS
#define DBGC_CLASS DBGC_VFS #define DBGC_CLASS DBGC_VFS

View File

@ -27,6 +27,8 @@
#undef DBGC_CLASS #undef DBGC_CLASS
#define DBGC_CLASS DBGC_AUTH #define DBGC_CLASS DBGC_AUTH
#undef strncasecmp
_PUBLIC_ NTSTATUS auth4_developer_init(TALLOC_CTX *); _PUBLIC_ NTSTATUS auth4_developer_init(TALLOC_CTX *);
static NTSTATUS name_to_ntstatus_want_check(struct auth_method_context *ctx, static NTSTATUS name_to_ntstatus_want_check(struct auth_method_context *ctx,

View File

@ -58,6 +58,8 @@
#define DEFAULT_PAGER "more" #define DEFAULT_PAGER "more"
#endif #endif
#undef strncasecmp
struct smbclient_context { struct smbclient_context {
char *remote_cur_dir; char *remote_cur_dir;
struct smbcli_state *cli; struct smbcli_state *cli;

View File

@ -41,6 +41,8 @@
#include "dnsserver_common.h" #include "dnsserver_common.h"
#include "lib/util/smb_strtox.h" #include "lib/util/smb_strtox.h"
#undef strcasecmp
struct b9_options { struct b9_options {
const char *url; const char *url;
const char *debug; const char *debug;

View File

@ -37,6 +37,8 @@
#undef DBGC_CLASS #undef DBGC_CLASS
#define DBGC_CLASS DBGC_DNS #define DBGC_CLASS DBGC_DNS
#undef strncasecmp
uint8_t werr_to_dns_err(WERROR werr) uint8_t werr_to_dns_err(WERROR werr)
{ {
if (W_ERROR_EQUAL(WERR_OK, werr)) { if (W_ERROR_EQUAL(WERR_OK, werr)) {

View File

@ -51,6 +51,8 @@
#include "libcli/util/ntstatus.h" #include "libcli/util/ntstatus.h"
#include "lib/util/smb_strtox.h" #include "lib/util/smb_strtox.h"
#undef strncasecmp
/* /*
* This included to allow us to handle DSDB_FLAG_REPLICATED_UPDATE in * This included to allow us to handle DSDB_FLAG_REPLICATED_UPDATE in
* dsdb_request_add_controls() * dsdb_request_add_controls()

View File

@ -35,6 +35,8 @@
#include "lib/crypto/md4.h" #include "lib/crypto/md4.h"
#include "libcli/ldap/ldap_ndr.h" #include "libcli/ldap/ldap_ndr.h"
#undef strcasecmp
NTSTATUS dsdb_trust_forest_info_from_lsa(TALLOC_CTX *mem_ctx, NTSTATUS dsdb_trust_forest_info_from_lsa(TALLOC_CTX *mem_ctx,
const struct lsa_ForestTrustInformation *lfti, const struct lsa_ForestTrustInformation *lfti,
struct ForestTrustInfo **_fti) struct ForestTrustInfo **_fti)

View File

@ -37,6 +37,8 @@
#undef DBGC_CLASS #undef DBGC_CLASS
#define DBGC_CLASS DBGC_DRS_REPL #define DBGC_CLASS DBGC_DRS_REPL
#undef strcasecmp
/* /*
load the partitions list based on replicated NC attributes in our load the partitions list based on replicated NC attributes in our
NTDSDSA object NTDSDSA object

View File

@ -37,6 +37,8 @@
#include "dsdb/common/util.h" #include "dsdb/common/util.h"
#include "param/param.h" #include "param/param.h"
#undef strcasecmp
static WERROR DsCrackNameOneFilter(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ctx, static WERROR DsCrackNameOneFilter(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ctx,
struct smb_krb5_context *smb_krb5_context, struct smb_krb5_context *smb_krb5_context,
uint32_t format_flags, enum drsuapi_DsNameFormat format_offered, uint32_t format_flags, enum drsuapi_DsNameFormat format_offered,

View File

@ -43,6 +43,9 @@
#include "system/kerberos.h" #include "system/kerberos.h"
#include "auth/kerberos/kerberos.h" #include "auth/kerberos/kerberos.h"
#undef strcasecmp
#undef strncasecmp
struct extended_access_check_attribute { struct extended_access_check_attribute {
const char *oa_name; const char *oa_name;
const uint32_t requires_rights; const uint32_t requires_rights;

View File

@ -38,6 +38,8 @@
#define NULL_REQ_PSEUDO_N -2LL; #define NULL_REQ_PSEUDO_N -2LL;
#define STAR_REQ_PSEUDO_N -4LL; #define STAR_REQ_PSEUDO_N -4LL;
#undef strcasecmp
struct count_attrs_private { struct count_attrs_private {
struct tdb_wrap *requested; struct tdb_wrap *requested;
struct tdb_wrap *duplicates; struct tdb_wrap *duplicates;

View File

@ -50,6 +50,7 @@ static const size_t num_secret_attributes = ARRAY_SIZE(secret_attributes);
#define NUMBER_OF_KEYS 1 #define NUMBER_OF_KEYS 1
#define SECRETS_KEY_FILE "encrypted_secrets.key" #define SECRETS_KEY_FILE "encrypted_secrets.key"
#undef strcasecmp
struct es_data { struct es_data {
/* /*

View File

@ -37,6 +37,8 @@
#include "dsdb/samdb/ldb_modules/util.h" #include "dsdb/samdb/ldb_modules/util.h"
#include "lib/ldb-samba/ldb_matching_rules.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 TODO: if relax is not set then we need to reject the fancy RMD_* and
DELETED extended DN codes DELETED extended DN codes

View File

@ -42,6 +42,9 @@
#include "dsdb/samdb/samdb.h" #include "dsdb/samdb/samdb.h"
#include "dsdb/samdb/ldb_modules/util.h" #include "dsdb/samdb/ldb_modules/util.h"
#undef strcasecmp
#undef strncasecmp
struct extended_dn_out_private { struct extended_dn_out_private {
bool dereference; bool dereference;
bool normalise; bool normalise;

View File

@ -53,6 +53,7 @@
#include "librpc/gen_ndr/ndr_misc.h" #include "librpc/gen_ndr/ndr_misc.h"
#include "dsdb/samdb/ldb_modules/util.h" #include "dsdb/samdb/ldb_modules/util.h"
#undef strcasecmp
struct la_private_transaction { struct la_private_transaction {
struct la_context *la_list; struct la_context *la_list;

View File

@ -39,6 +39,8 @@
#include "libds/common/flag_mapping.h" #include "libds/common/flag_mapping.h"
#include "lib/util/util_net.h" #include "lib/util/util_net.h"
#undef strcasecmp
/* /*
fill in the cldap netlogon union for a given version fill in the cldap netlogon union for a given version
*/ */

View File

@ -65,6 +65,8 @@
#define MINIMUM_GPGME_VERSION "1.2.0" #define MINIMUM_GPGME_VERSION "1.2.0"
#endif #endif
#undef strncasecmp
/* If we have decided there is a reason to work on this request, then /* If we have decided there is a reason to work on this request, then
* setup all the password hash types correctly. * setup all the password hash types correctly.
* *

View File

@ -32,6 +32,8 @@
#include "includes.h" #include "includes.h"
#include "ldb_module.h" #include "ldb_module.h"
#undef strncasecmp
struct rr_context { struct rr_context {
struct ldb_module *module; struct ldb_module *module;
struct ldb_request *req; struct ldb_request *req;

View File

@ -52,6 +52,8 @@
#include "lib/util/tsort.h" #include "lib/util/tsort.h"
#include "lib/util/binsearch.h" #include "lib/util/binsearch.h"
#undef strcasecmp
#undef DBGC_CLASS #undef DBGC_CLASS
#define DBGC_CLASS DBGC_DRS_REPL #define DBGC_CLASS DBGC_DRS_REPL

View File

@ -38,6 +38,8 @@
#include "cldap_server/cldap_server.h" #include "cldap_server/cldap_server.h"
#include "lib/events/events.h" #include "lib/events/events.h"
#undef strcasecmp
struct rootdse_private_data { struct rootdse_private_data {
unsigned int num_controls; unsigned int num_controls;
char **controls; char **controls;

View File

@ -47,6 +47,8 @@
#include "librpc/gen_ndr/irpc.h" #include "librpc/gen_ndr/irpc.h"
#include "lib/util/smb_strtox.h" #include "lib/util/smb_strtox.h"
#undef strcasecmp
struct samldb_ctx; struct samldb_ctx;
enum samldb_add_type { enum samldb_add_type {
SAMLDB_TYPE_USER, SAMLDB_TYPE_USER,

View File

@ -30,6 +30,8 @@
#include "param/param.h" #include "param/param.h"
#include "dsdb/samdb/ldb_modules/util.h" #include "dsdb/samdb/ldb_modules/util.h"
#undef strcasecmp
static int generate_objectClasses(struct ldb_context *ldb, struct ldb_message *msg, static int generate_objectClasses(struct ldb_context *ldb, struct ldb_message *msg,
const struct dsdb_schema *schema); const struct dsdb_schema *schema);
static int generate_attributeTypes(struct ldb_context *ldb, struct ldb_message *msg, static int generate_attributeTypes(struct ldb_context *ldb, struct ldb_message *msg,

View File

@ -23,6 +23,8 @@
#include "dsdb/samdb/samdb.h" #include "dsdb/samdb/samdb.h"
#include "system/locale.h" #include "system/locale.h"
#undef strcasecmp
#define SEPERATOR "\n " #define SEPERATOR "\n "
struct attr_map { struct attr_map {

View File

@ -22,6 +22,8 @@
#include "dsdb/samdb/samdb.h" #include "dsdb/samdb/samdb.h"
#include "librpc/ndr/libndr.h" #include "librpc/ndr/libndr.h"
#undef strcasecmp
#define IF_NULL_FAIL_RET(x) do { \ #define IF_NULL_FAIL_RET(x) do { \
if (!x) { \ if (!x) { \
return NULL; \ return NULL; \

View File

@ -32,6 +32,7 @@
#include <ldb_module.h> #include <ldb_module.h>
#include "../lib/util/asn1.h" #include "../lib/util/asn1.h"
#undef strcasecmp
struct dsdb_schema *dsdb_new_schema(TALLOC_CTX *mem_ctx) struct dsdb_schema *dsdb_new_schema(TALLOC_CTX *mem_ctx)
{ {

View File

@ -27,6 +27,9 @@
#include "lib/util/tsort.h" #include "lib/util/tsort.h"
#include "util/dlinklist.h" #include "util/dlinklist.h"
#undef strcasecmp
#undef strncasecmp
static const char **dsdb_full_attribute_list_internal(TALLOC_CTX *mem_ctx, static const char **dsdb_full_attribute_list_internal(TALLOC_CTX *mem_ctx,
const struct dsdb_schema *schema, const struct dsdb_schema *schema,
const char **class_list, const char **class_list,

View File

@ -30,6 +30,8 @@
#include "librpc/gen_ndr/ndr_misc.h" #include "librpc/gen_ndr/ndr_misc.h"
#include "lib/util/tsort.h" #include "lib/util/tsort.h"
#undef strcasecmp
/* change this when we change something in our schema code that /* change this when we change something in our schema code that
* requires a re-index of the database * requires a re-index of the database
*/ */

View File

@ -32,6 +32,8 @@
#include "librpc/ndr/libndr.h" #include "librpc/ndr/libndr.h"
#include "../lib/util/asn1.h" #include "../lib/util/asn1.h"
#undef strcasecmp
/** /**
* Initialize dsdb_syntax_ctx with default values * Initialize dsdb_syntax_ctx with default values
* for common cases. * for common cases.

View File

@ -38,6 +38,8 @@
#include "librpc/gen_ndr/ndr_irpc_c.h" #include "librpc/gen_ndr/ndr_irpc_c.h"
#include "lib/messaging/irpc.h" #include "lib/messaging/irpc.h"
#undef strcasecmp
#undef strncasecmp
#define SAMBA_KVNO_GET_KRBTGT(kvno) \ #define SAMBA_KVNO_GET_KRBTGT(kvno) \
((uint16_t)(((uint32_t)kvno) >> 16)) ((uint16_t)(((uint32_t)kvno) >> 16))

View File

@ -49,6 +49,8 @@
#include "libds/common/roles.h" #include "libds/common/roles.h"
#include "lib/util/time.h" #include "lib/util/time.h"
#undef strcasecmp
static void ldapsrv_terminate_connection_done(struct tevent_req *subreq); static void ldapsrv_terminate_connection_done(struct tevent_req *subreq);
/* /*

View File

@ -32,6 +32,8 @@
#include "auth/credentials/credentials.h" #include "auth/credentials/credentials.h"
#include "libcli/composite/composite.h" #include "libcli/composite/composite.h"
#undef strncasecmp
#define DCOM_NEGOTIATED_PROTOCOLS { EPM_PROTOCOL_TCP, EPM_PROTOCOL_SMB, EPM_PROTOCOL_NCALRPC } #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) static NTSTATUS dcerpc_binding_from_STRINGBINDING(TALLOC_CTX *mem_ctx, struct dcerpc_binding **b_out, struct STRINGBINDING *bd)

View File

@ -22,6 +22,7 @@
#include "lib/registry/registry.h" #include "lib/registry/registry.h"
#include "system/filesys.h" #include "system/filesys.h"
#undef strcasecmp
/** /**
* @file * @file

View File

@ -25,6 +25,9 @@
#include "librpc/gen_ndr/winreg.h" #include "librpc/gen_ndr/winreg.h"
#include "lib/util/sys_rw.h" #include "lib/util/sys_rw.h"
#undef strcasecmp
#undef strncasecmp
struct preg_data { struct preg_data {
int fd; int fd;
TALLOC_CTX *ctx; TALLOC_CTX *ctx;

View File

@ -26,6 +26,7 @@
#include "lib/registry/registry.h" #include "lib/registry/registry.h"
#include "libcli/security/security.h" #include "libcli/security/security.h"
#undef strcasecmp
static struct hive_operations reg_backend_regf; static struct hive_operations reg_backend_regf;

View File

@ -27,6 +27,8 @@
#include "system/network.h" #include "system/network.h"
#include "lib/util/util_net.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_ipv4_ops(enum socket_type type);
_PUBLIC_ const struct socket_ops *socket_ipv6_ops(enum socket_type type); _PUBLIC_ const struct socket_ops *socket_ipv6_ops(enum socket_type type);

View File

@ -37,6 +37,8 @@
#include "libcli/dgram/libdgram.h" #include "libcli/dgram/libdgram.h"
#include "lib/socket/socket.h" #include "lib/socket/socket.h"
#undef strcasecmp
/* /*
destroy a mailslot handler destroy a mailslot handler
*/ */

View File

@ -30,6 +30,8 @@
#include "lib/tsocket/tsocket.h" #include "lib/tsocket/tsocket.h"
#include "lib/util/util_net.h" #include "lib/util/util_net.h"
#undef strcasecmp
struct resolve_state { struct resolve_state {
struct resolve_context *ctx; struct resolve_context *ctx;
struct resolve_method *method; struct resolve_method *method;

View File

@ -38,6 +38,8 @@
#include "libcli/http/http.h" #include "libcli/http/http.h"
#include "lib/util/util_net.h" #include "lib/util/util_net.h"
#undef strcasecmp
struct dcerpc_pipe_connect { struct dcerpc_pipe_connect {
struct dcecli_connection *conn; struct dcecli_connection *conn;
struct dcerpc_binding *binding; struct dcerpc_binding *binding;

View File

@ -33,6 +33,8 @@
#include "librpc/rpc/dcerpc_proto.h" #include "librpc/rpc/dcerpc_proto.h"
#include "libcli/composite/composite.h" #include "libcli/composite/composite.h"
#undef strncasecmp
/* transport private information used by SMB pipe transport */ /* transport private information used by SMB pipe transport */
struct smb_private { struct smb_private {
DATA_BLOB session_key; DATA_BLOB session_key;

View File

@ -33,6 +33,8 @@
#include "param/param.h" #include "param/param.h"
#include "lib/util/smb_strtox.h" #include "lib/util/smb_strtox.h"
#undef strcasecmp
uint64_t winsdb_get_maxVersion(struct winsdb_handle *h) uint64_t winsdb_get_maxVersion(struct winsdb_handle *h)
{ {
int ret; int ret;

View File

@ -43,6 +43,8 @@
#include "system/locale.h" #include "system/locale.h"
#include "system/filesys.h" #include "system/filesys.h"
#undef strncasecmp
/* this is the private structure used to keep the state of an open /* this is the private structure used to keep the state of an open
ipc$ connection. It needs to keep information about all open ipc$ connection. It needs to keep information about all open
pipes */ pipes */

View File

@ -35,6 +35,8 @@
#include "libcli/smb2/smb2.h" #include "libcli/smb2/smb2.h"
#include "libcli/smb2/smb2_calls.h" #include "libcli/smb2/smb2_calls.h"
#undef strcasecmp
/* a second stage function converts from the out parameters of the generic /* a second stage function converts from the out parameters of the generic
call onto the out parameters of the specific call made */ call onto the out parameters of the specific call made */
typedef NTSTATUS (*second_stage_t)(struct ntvfs_module_context *, typedef NTSTATUS (*second_stage_t)(struct ntvfs_module_context *,

View File

@ -24,6 +24,8 @@
#include "vfs_posix.h" #include "vfs_posix.h"
#include "param/param.h" #include "param/param.h"
#undef strcasecmp
/* /*
this mangling scheme uses the following format this mangling scheme uses the following format

View File

@ -29,6 +29,8 @@
#include "param/param.h" #include "param/param.h"
#include "lib/util/samba_modules.h" #include "lib/util/samba_modules.h"
#undef strcasecmp
/* list of registered backends */ /* list of registered backends */
static struct sys_lease_ops *backends; static struct sys_lease_ops *backends;
static uint32_t num_backends; static uint32_t num_backends;

View File

@ -30,6 +30,8 @@
#include "param/param.h" #include "param/param.h"
#include "lib/util/samba_modules.h" #include "lib/util/samba_modules.h"
#undef strcasecmp
/* list of registered backends */ /* list of registered backends */
static struct sys_notify_backend *backends; static struct sys_notify_backend *backends;
static uint32_t num_backends; static uint32_t num_backends;

View File

@ -27,6 +27,8 @@
#include "param/share.h" #include "param/share.h"
#include "param/param.h" #include "param/param.h"
#undef strcasecmp
NTSTATUS share_ldb_init(TALLOC_CTX *); NTSTATUS share_ldb_init(TALLOC_CTX *);
static NTSTATUS sldb_init(TALLOC_CTX *mem_ctx, const struct share_ops *ops, static NTSTATUS sldb_init(TALLOC_CTX *mem_ctx, const struct share_ops *ops,

View File

@ -44,6 +44,8 @@
#include "lib/crypto/gnutls_helpers.h" #include "lib/crypto/gnutls_helpers.h"
#undef strncasecmp
#define DCESRV_INTERFACE_BACKUPKEY_BIND(context, iface) \ #define DCESRV_INTERFACE_BACKUPKEY_BIND(context, iface) \
dcesrv_interface_backupkey_bind(context, iface) dcesrv_interface_backupkey_bind(context, iface)
static NTSTATUS dcesrv_interface_backupkey_bind(struct dcesrv_connection_context *context, static NTSTATUS dcesrv_interface_backupkey_bind(struct dcesrv_connection_context *context,

View File

@ -25,6 +25,8 @@
#include "rpc_server/dcerpc_server.h" #include "rpc_server/dcerpc_server.h"
#include "rpc_server/common/share.h" #include "rpc_server/common/share.h"
#undef strcasecmp
/* /*
Here are common server info functions used by some dcerpc server interfaces Here are common server info functions used by some dcerpc server interfaces
*/ */

View File

@ -28,6 +28,8 @@
#include "dns_server/dnsserver_common.h" #include "dns_server/dnsserver_common.h"
#include "dnsserver.h" #include "dnsserver.h"
#undef strcasecmp
#define DCESRV_INTERFACE_DNSSERVER_BIND(context, iface) \ #define DCESRV_INTERFACE_DNSSERVER_BIND(context, iface) \
dcesrv_interface_dnsserver_bind(context, iface) dcesrv_interface_dnsserver_bind(context, iface)
static NTSTATUS dcesrv_interface_dnsserver_bind(struct dcesrv_connection_context *context, static NTSTATUS dcesrv_interface_dnsserver_bind(struct dcesrv_connection_context *context,

View File

@ -26,6 +26,7 @@
#include "librpc/gen_ndr/ndr_dnsp.h" #include "librpc/gen_ndr/ndr_dnsp.h"
#include "librpc/gen_ndr/ndr_dnsserver.h" #include "librpc/gen_ndr/ndr_dnsserver.h"
#undef strcasecmp
struct IP4_ARRAY *ip4_array_copy(TALLOC_CTX *mem_ctx, struct IP4_ARRAY *ip4) struct IP4_ARRAY *ip4_array_copy(TALLOC_CTX *mem_ctx, struct IP4_ARRAY *ip4)
{ {

View File

@ -29,6 +29,8 @@
#include "libcli/security/security.h" #include "libcli/security/security.h"
#include "dsdb/common/util.h" #include "dsdb/common/util.h"
#undef strcasecmp
/* There are only 2 fixed partitions for DNS */ /* There are only 2 fixed partitions for DNS */
struct dnsserver_partition *dnsserver_db_enumerate_partitions(TALLOC_CTX *mem_ctx, struct dnsserver_partition *dnsserver_db_enumerate_partitions(TALLOC_CTX *mem_ctx,
struct dnsserver_serverinfo *serverinfo, struct dnsserver_serverinfo *serverinfo,

View File

@ -28,6 +28,8 @@
#include "lib/util/util_net.h" #include "lib/util/util_net.h"
#include "dnsserver_common.h" #include "dnsserver_common.h"
#undef strcasecmp
static struct DNS_ADDR_ARRAY *fill_dns_addr_array(TALLOC_CTX *mem_ctx, static struct DNS_ADDR_ARRAY *fill_dns_addr_array(TALLOC_CTX *mem_ctx,
struct loadparm_context *lp_ctx, struct loadparm_context *lp_ctx,
bool listen_only) bool listen_only)

View File

@ -35,6 +35,8 @@
#undef DBGC_CLASS #undef DBGC_CLASS
#define DBGC_CLASS DBGC_DRS_REPL #define DBGC_CLASS DBGC_DRS_REPL
#undef strcasecmp
/* /*
check that the SPN update should be allowed as an override check that the SPN update should be allowed as an override
via sam_ctx_system via sam_ctx_system

View File

@ -39,6 +39,8 @@
#include <gnutls/gnutls.h> #include <gnutls/gnutls.h>
#include <gnutls/crypto.h> #include <gnutls/crypto.h>
#undef strcasecmp
#define DCESRV_INTERFACE_LSARPC_BIND(context, iface) \ #define DCESRV_INTERFACE_LSARPC_BIND(context, iface) \
dcesrv_interface_lsarpc_bind(context, iface) dcesrv_interface_lsarpc_bind(context, iface)
static NTSTATUS dcesrv_interface_lsarpc_bind(struct dcesrv_connection_context *context, static NTSTATUS dcesrv_interface_lsarpc_bind(struct dcesrv_connection_context *context,

View File

@ -48,6 +48,8 @@
#define DCESRV_INTERFACE_NETLOGON_BIND(context, iface) \ #define DCESRV_INTERFACE_NETLOGON_BIND(context, iface) \
dcesrv_interface_netlogon_bind(context, iface) dcesrv_interface_netlogon_bind(context, iface)
#undef strcasecmp
/* /*
* This #define allows the netlogon interface to accept invalid * This #define allows the netlogon interface to accept invalid
* association groups, because association groups are to coordinate * association groups, because association groups are to coordinate

View File

@ -41,6 +41,8 @@
#include "lib/util/tsort.h" #include "lib/util/tsort.h"
#include "libds/common/flag_mapping.h" #include "libds/common/flag_mapping.h"
#undef strcasecmp
#define DCESRV_INTERFACE_SAMR_BIND(context, iface) \ #define DCESRV_INTERFACE_SAMR_BIND(context, iface) \
dcesrv_interface_samr_bind(context, iface) dcesrv_interface_samr_bind(context, iface)
static NTSTATUS dcesrv_interface_samr_bind(struct dcesrv_connection_context *context, static NTSTATUS dcesrv_interface_samr_bind(struct dcesrv_connection_context *context,

View File

@ -31,6 +31,9 @@
#include "rpc_server/srvsvc/proto.h" #include "rpc_server/srvsvc/proto.h"
#include "param/param.h" #include "param/param.h"
#undef strcasecmp
#undef strncasecmp
#define SRVSVC_CHECK_ADMIN_ACCESS do { \ #define SRVSVC_CHECK_ADMIN_ACCESS do { \
struct auth_session_info *si = dcesrv_call_session_info(dce_call); \ struct auth_session_info *si = dcesrv_call_session_info(dce_call); \
struct security_token *t = si->security_token; \ struct security_token *t = si->security_token; \

View File

@ -23,6 +23,8 @@
#include "ntvfs/ntvfs.h" #include "ntvfs/ntvfs.h"
#include "param/param.h" #include "param/param.h"
#undef strcasecmp
/**************************************************************************** /****************************************************************************
Make a connection, given the snum to connect to, and the vuser of the Make a connection, given the snum to connect to, and the vuser of the
connecting user if appropriate. connecting user if appropriate.

View File

@ -24,6 +24,8 @@
#include "../lib/util/dlinklist.h" #include "../lib/util/dlinklist.h"
#include "smbd/process_model.h" #include "smbd/process_model.h"
#undef strcasecmp
/* /*
a linked list of registered servers a linked list of registered servers
*/ */

View File

@ -26,6 +26,8 @@
#include "torture/util.h" #include "torture/util.h"
#include "torture/basic/proto.h" #include "torture/basic/proto.h"
#undef strcasecmp
static TDB_CONTEXT *tdb; static TDB_CONTEXT *tdb;
#define NAME_LENGTH 20 #define NAME_LENGTH 20

View File

@ -30,6 +30,8 @@
#include "lib/util/samba_util.h" #include "lib/util/samba_util.h"
#include "util/tevent_ntstatus.h" #include "util/tevent_ntstatus.h"
#undef strncasecmp
struct torture_suite *gpo_apply_suite(TALLOC_CTX *ctx) struct torture_suite *gpo_apply_suite(TALLOC_CTX *ctx)
{ {
struct torture_suite *suite = torture_suite_create(ctx, "apply"); struct torture_suite *suite = torture_suite_create(ctx, "apply");

View File

@ -34,6 +34,8 @@
#include "auth/gensec/gensec.h" #include "auth/gensec/gensec.h"
#include "param/param.h" #include "param/param.h"
#undef strcasecmp
#define TEST_CANONICALIZE 0x0000001 #define TEST_CANONICALIZE 0x0000001
#define TEST_ENTERPRISE 0x0000002 #define TEST_ENTERPRISE 0x0000002
#define TEST_UPPER_REALM 0x0000004 #define TEST_UPPER_REALM 0x0000004

View File

@ -29,6 +29,7 @@
#include "torture/torture.h" #include "torture/torture.h"
#include "torture/ldap/proto.h" #include "torture/ldap/proto.h"
#undef strcasecmp
static bool test_bind_sasl(struct torture_context *tctx, static bool test_bind_sasl(struct torture_context *tctx,
struct ldap_connection *conn, struct cli_credentials *creds) struct ldap_connection *conn, struct cli_credentials *creds)

View File

@ -33,6 +33,8 @@
#include "torture/torture.h" #include "torture/torture.h"
#include "torture/ldap/proto.h" #include "torture/ldap/proto.h"
#undef strcasecmp
#define CHECK_STATUS(status, correct) torture_assert_ntstatus_equal(tctx, status, correct, "incorrect status") #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"); #define CHECK_VAL(v, correct) torture_assert_int_equal(tctx, (v), (correct), "incorrect value");

View File

@ -22,6 +22,8 @@
#include <netapi.h> #include <netapi.h>
#include "torture/libnetapi/proto.h" #include "torture/libnetapi/proto.h"
#undef strcasecmp
#define TORTURE_TEST_USER "testuser" #define TORTURE_TEST_USER "testuser"
#define NETAPI_STATUS(tctx, x,y,fn) \ #define NETAPI_STATUS(tctx, x,y,fn) \

View File

@ -22,6 +22,8 @@
#include <netapi.h> #include <netapi.h>
#include "torture/libnetapi/proto.h" #include "torture/libnetapi/proto.h"
#undef strcasecmp
#define TORTURE_TEST_USER "torture_testuser" #define TORTURE_TEST_USER "torture_testuser"
#define TORTURE_TEST_USER2 "torture_testuser2" #define TORTURE_TEST_USER2 "torture_testuser2"

View File

@ -26,6 +26,7 @@
#include "lib/util/tsort.h" #include "lib/util/tsort.h"
#include "torture/raw/proto.h" #include "torture/raw/proto.h"
#undef strncasecmp
#define BASEDIR "\\testsearch" #define BASEDIR "\\testsearch"

View File

@ -27,6 +27,8 @@
#include <ldb.h> #include <ldb.h>
#include "libcli/security/security.h" #include "libcli/security/security.h"
#undef strcasecmp
struct DsCrackNamesPrivate { struct DsCrackNamesPrivate {
struct DsPrivate base; struct DsPrivate base;

View File

@ -34,6 +34,8 @@
#include <gnutls/gnutls.h> #include <gnutls/gnutls.h>
#include <gnutls/crypto.h> #include <gnutls/crypto.h>
#undef strcasecmp
#define TEST_DOM "torturedom" #define TEST_DOM "torturedom"
#define TEST_DOM_DNS "torturedom.samba.example.com" #define TEST_DOM_DNS "torturedom.samba.example.com"
#define TEST_DOM_SID "S-1-5-21-97398-379795-10000" #define TEST_DOM_SID "S-1-5-21-97398-379795-10000"

View File

@ -38,6 +38,8 @@
#include "lib/replace/system/network.h" #include "lib/replace/system/network.h"
#include "dsdb/samdb/samdb.h" #include "dsdb/samdb/samdb.h"
#undef strcasecmp
#define TEST_MACHINE_NAME "torturetest" #define TEST_MACHINE_NAME "torturetest"
static bool test_netr_broken_binding_handle(struct torture_context *tctx, static bool test_netr_broken_binding_handle(struct torture_context *tctx,

View File

@ -44,6 +44,8 @@
#include "source3/rpc_client/init_samr.h" #include "source3/rpc_client/init_samr.h"
#include "lib/crypto/gnutls_helpers.h" #include "lib/crypto/gnutls_helpers.h"
#undef strcasecmp
#define TEST_ACCOUNT_NAME "samrtorturetest" #define TEST_ACCOUNT_NAME "samrtorturetest"
#define TEST_ACCOUNT_NAME_PWD "samrpwdlastset" #define TEST_ACCOUNT_NAME_PWD "samrpwdlastset"
#define TEST_ALIASNAME "samrtorturetestalias" #define TEST_ALIASNAME "samrtorturetestalias"

View File

@ -28,6 +28,8 @@
#include "torture/util.h" #include "torture/util.h"
#include "torture/smb2/proto.h" #include "torture/smb2/proto.h"
#undef strcasecmp
static TDB_CONTEXT *tdb; static TDB_CONTEXT *tdb;
#define NAME_LENGTH 20 #define NAME_LENGTH 20

View File

@ -32,6 +32,7 @@
#include "dsdb/samdb/samdb.h" #include "dsdb/samdb/samdb.h"
#include "../libcli/security/security.h" #include "../libcli/security/security.h"
#undef strcasecmp
/* Size (in bytes) of the required fields in the SMBwhoami response. */ /* Size (in bytes) of the required fields in the SMBwhoami response. */
#define WHOAMI_REQUIRED_SIZE 40 #define WHOAMI_REQUIRED_SIZE 40

View File

@ -36,6 +36,8 @@
#include "ldb.h" #include "ldb.h"
#include "../librpc/gen_ndr/ndr_misc.h" #include "../librpc/gen_ndr/ndr_misc.h"
#undef strcasecmp
#include <gnutls/gnutls.h> #include <gnutls/gnutls.h>
#include <gnutls/crypto.h> #include <gnutls/crypto.h>