#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);
#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;
#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 ...
*/
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);
#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)
#ifdef strcasecmp
#undef strcasecmp
#endif
+#ifdef strncasecmp
+#undef strncasecmp
+#endif
+
/**
Case insensitive string compararison, handle specified for testing
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
#include "system/locale.h"
#include "system/filesys.h"
#include "lib/util/util_net.h"
+
#undef strcasecmp
+#undef strncasecmp
/*******************************************************************
Set an address to INADDR_ANY.
#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 {
#include "util/tevent_werror.h"
#include "lib/util/dlinklist.h"
+#undef strcasecmp
/**
* Determines if a response should have a body.
#include "auth/credentials/credentials.h"
#include "lib/util/data_blob.h"
+#undef strcasecmp
+#undef strncasecmp
+
/**
* Copy the request headers from src to dst
*/
#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/
#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)
#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);
/* String routines */
#include "srvstr.h"
-#include "safe_string.h"
+#include "lib/util/safe_string.h"
#ifndef SIGCLD
#define SIGCLD SIGCHLD
+++ /dev/null
-/*
- 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
#include "system/filesys.h"
#include "vfs_vxfs.h"
+#undef strcasecmp
+
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_VFS
#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,
#define DEFAULT_PAGER "more"
#endif
+#undef strncasecmp
+
struct smbclient_context {
char *remote_cur_dir;
struct smbcli_state *cli;
#include "dnsserver_common.h"
#include "lib/util/smb_strtox.h"
+#undef strcasecmp
+
struct b9_options {
const char *url;
const char *debug;
#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)) {
#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()
#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)
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_DRS_REPL
+#undef strcasecmp
+
/*
load the partitions list based on replicated NC attributes in our
NTDSDSA object
#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,
#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;
#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;
#define NUMBER_OF_KEYS 1
#define SECRETS_KEY_FILE "encrypted_secrets.key"
+#undef strcasecmp
struct es_data {
/*
#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
#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;
#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;
#include "libds/common/flag_mapping.h"
#include "lib/util/util_net.h"
+#undef strcasecmp
+
/*
fill in the cldap netlogon union for a given version
*/
#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.
*
#include "includes.h"
#include "ldb_module.h"
+#undef strncasecmp
+
struct rr_context {
struct ldb_module *module;
struct ldb_request *req;
#include "lib/util/tsort.h"
#include "lib/util/binsearch.h"
+#undef strcasecmp
+
#undef DBGC_CLASS
#define DBGC_CLASS DBGC_DRS_REPL
#include "cldap_server/cldap_server.h"
#include "lib/events/events.h"
+#undef strcasecmp
+
struct rootdse_private_data {
unsigned int num_controls;
char **controls;
#include "librpc/gen_ndr/irpc.h"
#include "lib/util/smb_strtox.h"
+#undef strcasecmp
+
struct samldb_ctx;
enum samldb_add_type {
SAMLDB_TYPE_USER,
#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,
#include "dsdb/samdb/samdb.h"
#include "system/locale.h"
+#undef strcasecmp
+
#define SEPERATOR "\n "
struct attr_map {
#include "dsdb/samdb/samdb.h"
#include "librpc/ndr/libndr.h"
+#undef strcasecmp
+
#define IF_NULL_FAIL_RET(x) do { \
if (!x) { \
return NULL; \
#include <ldb_module.h>
#include "../lib/util/asn1.h"
+#undef strcasecmp
struct dsdb_schema *dsdb_new_schema(TALLOC_CTX *mem_ctx)
{
#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,
#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
*/
#include "librpc/ndr/libndr.h"
#include "../lib/util/asn1.h"
+#undef strcasecmp
+
/**
* Initialize dsdb_syntax_ctx with default values
* for common cases.
#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))
#include "libds/common/roles.h"
#include "lib/util/time.h"
+#undef strcasecmp
+
static void ldapsrv_terminate_connection_done(struct tevent_req *subreq);
/*
#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)
#include "lib/registry/registry.h"
#include "system/filesys.h"
+#undef strcasecmp
/**
* @file
#include "librpc/gen_ndr/winreg.h"
#include "lib/util/sys_rw.h"
+#undef strcasecmp
+#undef strncasecmp
+
struct preg_data {
int fd;
TALLOC_CTX *ctx;
#include "lib/registry/registry.h"
#include "libcli/security/security.h"
+#undef strcasecmp
static struct hive_operations reg_backend_regf;
#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);
#include "libcli/dgram/libdgram.h"
#include "lib/socket/socket.h"
+#undef strcasecmp
+
/*
destroy a mailslot handler
*/
#include "lib/tsocket/tsocket.h"
#include "lib/util/util_net.h"
+#undef strcasecmp
+
struct resolve_state {
struct resolve_context *ctx;
struct resolve_method *method;
#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;
#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;
#include "param/param.h"
#include "lib/util/smb_strtox.h"
+#undef strcasecmp
+
uint64_t winsdb_get_maxVersion(struct winsdb_handle *h)
{
int ret;
#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 */
#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 *,
#include "vfs_posix.h"
#include "param/param.h"
+#undef strcasecmp
+
/*
this mangling scheme uses the following format
#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;
#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;
#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,
#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,
#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
*/
#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,
#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)
{
#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,
#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)
#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
#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,
#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
#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,
#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; \
#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.
#include "../lib/util/dlinklist.h"
#include "smbd/process_model.h"
+#undef strcasecmp
+
/*
a linked list of registered servers
*/
#include "torture/util.h"
#include "torture/basic/proto.h"
+#undef strcasecmp
+
static TDB_CONTEXT *tdb;
#define NAME_LENGTH 20
#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");
#include "auth/gensec/gensec.h"
#include "param/param.h"
+#undef strcasecmp
+
#define TEST_CANONICALIZE 0x0000001
#define TEST_ENTERPRISE 0x0000002
#define TEST_UPPER_REALM 0x0000004
#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)
#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");
#include <netapi.h>
#include "torture/libnetapi/proto.h"
+#undef strcasecmp
+
#define TORTURE_TEST_USER "testuser"
#define NETAPI_STATUS(tctx, x,y,fn) \
#include <netapi.h>
#include "torture/libnetapi/proto.h"
+#undef strcasecmp
+
#define TORTURE_TEST_USER "torture_testuser"
#define TORTURE_TEST_USER2 "torture_testuser2"
#include "lib/util/tsort.h"
#include "torture/raw/proto.h"
+#undef strncasecmp
#define BASEDIR "\\testsearch"
#include <ldb.h>
#include "libcli/security/security.h"
+#undef strcasecmp
+
struct DsCrackNamesPrivate {
struct DsPrivate base;
#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"
#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,
#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"
#include "torture/util.h"
#include "torture/smb2/proto.h"
+#undef strcasecmp
+
static TDB_CONTEXT *tdb;
#define NAME_LENGTH 20
#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
#include "ldb.h"
#include "../librpc/gen_ndr/ndr_misc.h"
+#undef strcasecmp
+
#include <gnutls/gnutls.h>
#include <gnutls/crypto.h>