[SCM] Samba Shared Repository - branch master updated - release-4-0-0alpha8-237-g880c286

Volker Lendecke vlendec at samba.org
Sun Jul 5 21:50:47 GMT 2009


The branch, master has been updated
       via  880c286bc92db809553c5af2c4a26fe34d6a58dc (commit)
       via  e77e21e0f14acf670b1fdc2411425223f03ed645 (commit)
       via  58fbf7420c184c95f8b9761a32392227848794cd (commit)
       via  f8cfe19d85534d30f97a4992179633ca68bc838b (commit)
       via  30dd96e8193254f05c1aa05a70a68b65c4d036b6 (commit)
       via  f2998feb8e6444a93b9efab5c9dc1b29f62a4baa (commit)
       via  ee5236e2d2dbae185be63abdc19009104c8fb50d (commit)
      from  43887c8d718087beb5a963a7962608b141e132fe (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 880c286bc92db809553c5af2c4a26fe34d6a58dc
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Jul 5 10:23:56 2009 +0200

    Use null_ndr_syntax_id instead of zeroing null_interface manually

commit e77e21e0f14acf670b1fdc2411425223f03ed645
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Jul 5 10:21:39 2009 +0200

    Add const to init_rpc_hdr_ba

commit 58fbf7420c184c95f8b9761a32392227848794cd
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Jul 5 10:13:03 2009 +0200

    Remove "typedef struct ndr_syntax_id RPC_IFACE;"

commit f8cfe19d85534d30f97a4992179633ca68bc838b
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Jul 5 10:21:06 2009 +0200

    Introduce null_ndr_syntax_id

commit 30dd96e8193254f05c1aa05a70a68b65c4d036b6
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Jul 5 09:43:23 2009 +0200

    Make check_bind_req static to rpc_server/srv_pipe.c

commit f2998feb8e6444a93b9efab5c9dc1b29f62a4baa
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Jul 5 16:20:05 2009 +0200

    Actually increase PASSDB_INTERFACE_VERSION to 18 :-)

commit ee5236e2d2dbae185be63abdc19009104c8fb50d
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Jul 5 23:15:34 2009 +0200

    Fix some nonempty blank lines

-----------------------------------------------------------------------

Summary of changes:
 source3/include/passdb.h        |    2 +-
 source3/include/proto.h         |    8 +-
 source3/include/rpc_dce.h       |    9 +--
 source3/librpc/ndr/util.c       |    3 +
 source3/rpc_client/cli_pipe.c   |   17 ++--
 source3/rpc_parse/parse_rpc.c   |   14 ++--
 source3/rpc_server/srv_pipe.c   |   14 ++--
 source4/dsdb/samdb/cracknames.c |  154 +++++++++++++++++++--------------------
 8 files changed, 110 insertions(+), 111 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/include/passdb.h b/source3/include/passdb.h
index c288015..4e53311 100644
--- a/source3/include/passdb.h
+++ b/source3/include/passdb.h
@@ -226,7 +226,7 @@ struct pdb_domain_info {
  * Changed to 18, pdb_rid_algorithm -> pdb_capabilities
  */
 
-#define PASSDB_INTERFACE_VERSION 17
+#define PASSDB_INTERFACE_VERSION 18
 
 struct pdb_methods 
 {
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 955a5a0..e4bcdb5 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -2126,6 +2126,7 @@ void ndr_print_file_id(struct ndr_print *ndr, const char *name, const struct fil
 _PUBLIC_ void ndr_print_bool(struct ndr_print *ndr, const char *name, const bool b);
 _PUBLIC_ void ndr_print_sockaddr_storage(struct ndr_print *ndr, const char *name, const struct sockaddr_storage *ss);
 const char *ndr_errstr(enum ndr_err_code err);
+extern const struct ndr_syntax_id null_ndr_syntax_id;
 
 /* The following definitions come from librpc/ndr/sid.c  */
 
@@ -5692,7 +5693,8 @@ void init_rpc_hdr(RPC_HDR *hdr, enum RPC_PKT_TYPE pkt_type, uint8 flags,
 				uint32 call_id, int data_len, int auth_len);
 bool smb_io_rpc_hdr(const char *desc,  RPC_HDR *rpc, prs_struct *ps, int depth);
 void init_rpc_context(RPC_CONTEXT *rpc_ctx, uint16 context_id,
-		      const RPC_IFACE *abstract, const RPC_IFACE *transfer);
+		      const struct ndr_syntax_id *abstract,
+		      const struct ndr_syntax_id *transfer);
 void init_rpc_hdr_rb(RPC_HDR_RB *rpc, 
 				uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid,
 				RPC_CONTEXT *context);
@@ -5702,7 +5704,7 @@ void init_rpc_hdr_ba(RPC_HDR_BA *rpc,
 				uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid,
 				const char *pipe_addr,
 				uint8 num_results, uint16 result, uint16 reason,
-				RPC_IFACE *transfer);
+				const struct ndr_syntax_id *transfer);
 bool smb_io_rpc_hdr_ba(const char *desc, RPC_HDR_BA *rpc, prs_struct *ps, int depth);
 void init_rpc_hdr_req(RPC_HDR_REQ *hdr, uint32 alloc_hint, uint16 opnum);
 bool smb_io_rpc_hdr_req(const char *desc, RPC_HDR_REQ *rpc, prs_struct *ps, int depth);
@@ -5799,8 +5801,6 @@ bool create_next_pdu(pipes_struct *p);
 bool api_pipe_bind_auth3(pipes_struct *p, prs_struct *rpc_in_p);
 bool setup_fault_pdu(pipes_struct *p, NTSTATUS status);
 bool setup_cancel_ack_reply(pipes_struct *p, prs_struct *rpc_in_p);
-bool check_bind_req(struct pipes_struct *p, RPC_IFACE* abstract,
-                    RPC_IFACE* transfer, uint32 context_id);
 NTSTATUS rpc_pipe_register_commands(int version, const char *clnt,
 				    const char *srv,
 				    const struct ndr_syntax_id *interface,
diff --git a/source3/include/rpc_dce.h b/source3/include/rpc_dce.h
index 8780169..50ca980 100644
--- a/source3/include/rpc_dce.h
+++ b/source3/include/rpc_dce.h
@@ -101,9 +101,6 @@ enum schannel_direction {
 /* #define MAX_PDU_FRAG_LEN 0x1630		this is what wnt sets */
 #define RPC_MAX_PDU_FRAG_LEN 0x10b8			/* this is what w2k sets */
 
-/* RPC_IFACE */
-typedef struct ndr_syntax_id RPC_IFACE;
-
 #define RPC_IFACE_LEN (UUID_SIZE + 4)
 
 /* RPC_HDR - dce rpc header */
@@ -202,8 +199,8 @@ typedef struct rpc_auth_schannel_chk_info {
 typedef struct rpc_context {
 	uint16 context_id;		/* presentation context identifier. */
 	uint8 num_transfer_syntaxes;	/* the number of syntaxes */
-	RPC_IFACE abstract;		/* num and vers. of interface client is using */
-	RPC_IFACE *transfer;		/* Array of transfer interfaces. */
+	struct ndr_syntax_id abstract;	/* num and vers. of interface client is using */
+	struct ndr_syntax_id *transfer;	/* Array of transfer interfaces. */
 } RPC_CONTEXT;
 
 /* RPC_BIND_REQ - ms req bind */
@@ -241,7 +238,7 @@ typedef struct rpc_hdr_ba_info {
 
 	RPC_ADDR_STR addr    ;  /* the secondary address string, as described earlier */
 	RPC_RESULTS  res     ; /* results and reasons */
-	RPC_IFACE    transfer; /* the transfer syntax from the request */
+	struct ndr_syntax_id transfer; /* the transfer syntax from the request */
 } RPC_HDR_BA;
 
 /* RPC_AUTH_VERIFIER */
diff --git a/source3/librpc/ndr/util.c b/source3/librpc/ndr/util.c
index 8fac5ea..0510caa 100644
--- a/source3/librpc/ndr/util.c
+++ b/source3/librpc/ndr/util.c
@@ -210,3 +210,6 @@ struct smb_iconv_convenience *lp_iconv_convenience(void *lp_ctx)
 {
 	return NULL;
 }
+
+const struct ndr_syntax_id null_ndr_syntax_id =
+{ { 0, 0, 0, { 0, 0 }, { 0, 0, 0, 0, 0, 0 } }, 0 };
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index 7d059e4..70660da 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -56,7 +56,7 @@ static const struct pipe_id_info {
 	/* the names appear not to matter: the syntaxes _do_ matter */
 
 	const char *client_pipe;
-	const RPC_IFACE *abstr_syntax; /* this one is the abstract syntax id */
+	const struct ndr_syntax_id *abstr_syntax; /* this one is the abstract syntax id */
 } pipe_names [] =
 {
 	{ PIPE_LSARPC,		&ndr_table_lsarpc.syntax_id },
@@ -1649,8 +1649,8 @@ static NTSTATUS create_schannel_auth_rpc_bind_req( struct rpc_pipe_client *cli,
 static NTSTATUS create_bind_or_alt_ctx_internal(enum RPC_PKT_TYPE pkt_type,
 						prs_struct *rpc_out, 
 						uint32 rpc_call_id,
-						const RPC_IFACE *abstract,
-						const RPC_IFACE *transfer,
+						const struct ndr_syntax_id *abstract,
+						const struct ndr_syntax_id *transfer,
 						RPC_HDR_AUTH *phdr_auth,
 						prs_struct *pauth_info)
 {
@@ -1731,8 +1731,8 @@ static NTSTATUS create_bind_or_alt_ctx_internal(enum RPC_PKT_TYPE pkt_type,
 static NTSTATUS create_rpc_bind_req(struct rpc_pipe_client *cli,
 				prs_struct *rpc_out, 
 				uint32 rpc_call_id,
-				const RPC_IFACE *abstract,
-				const RPC_IFACE *transfer,
+				const struct ndr_syntax_id *abstract,
+				const struct ndr_syntax_id *transfer,
 				enum pipe_auth_type auth_type,
 				enum pipe_auth_level auth_level)
 {
@@ -2368,7 +2368,8 @@ static bool rpc_pipe_set_hnd_state(struct rpc_pipe_client *cli,
  Check the rpc bind acknowledge response.
 ****************************************************************************/
 
-static bool check_bind_response(RPC_HDR_BA *hdr_ba, const RPC_IFACE *transfer)
+static bool check_bind_response(RPC_HDR_BA *hdr_ba,
+				const struct ndr_syntax_id *transfer)
 {
 	if ( hdr_ba->addr.len == 0) {
 		DEBUG(4,("Ignoring length check -- ASU bug (server didn't fill in the pipe name correctly)"));
@@ -2458,8 +2459,8 @@ static NTSTATUS create_rpc_bind_auth3(struct rpc_pipe_client *cli,
  ********************************************************************/
 
 static NTSTATUS create_rpc_alter_context(uint32 rpc_call_id,
-					const RPC_IFACE *abstract,
-					const RPC_IFACE *transfer,
+					const struct ndr_syntax_id *abstract,
+					const struct ndr_syntax_id *transfer,
 					enum pipe_auth_level auth_level,
 					const DATA_BLOB *pauth_blob, /* spnego auth blob already created. */
 					prs_struct *rpc_out)
diff --git a/source3/rpc_parse/parse_rpc.c b/source3/rpc_parse/parse_rpc.c
index 14a4eff..651a591 100644
--- a/source3/rpc_parse/parse_rpc.c
+++ b/source3/rpc_parse/parse_rpc.c
@@ -100,10 +100,11 @@ bool smb_io_rpc_hdr(const char *desc,  RPC_HDR *rpc, prs_struct *ps, int depth)
 }
 
 /*******************************************************************
- Reads or writes an RPC_IFACE structure.
+ Reads or writes an struct ndr_syntax_id structure.
 ********************************************************************/
 
-static bool smb_io_rpc_iface(const char *desc, RPC_IFACE *ifc, prs_struct *ps, int depth)
+static bool smb_io_rpc_iface(const char *desc, struct ndr_syntax_id *ifc,
+			     prs_struct *ps, int depth)
 {
 	if (ifc == NULL)
 		return False;
@@ -192,7 +193,8 @@ static bool smb_io_rpc_hdr_bba(const char *desc,  RPC_HDR_BBA *rpc, prs_struct *
 ********************************************************************/
 
 void init_rpc_context(RPC_CONTEXT *rpc_ctx, uint16 context_id,
-		      const RPC_IFACE *abstract, const RPC_IFACE *transfer)
+		      const struct ndr_syntax_id *abstract,
+		      const struct ndr_syntax_id *transfer)
 {
 	rpc_ctx->context_id   = context_id   ; /* presentation context identifier (0x0) */
 	rpc_ctx->num_transfer_syntaxes = 1 ; /* the number of syntaxes (has always been 1?)(0x1) */
@@ -201,7 +203,7 @@ void init_rpc_context(RPC_CONTEXT *rpc_ctx, uint16 context_id,
 	rpc_ctx->abstract = *abstract;
 
 	/* vers. of interface to use for replies */
-	rpc_ctx->transfer = CONST_DISCARD(RPC_IFACE *, transfer);
+	rpc_ctx->transfer = CONST_DISCARD(struct ndr_syntax_id *, transfer);
 }
 
 /*******************************************************************
@@ -245,7 +247,7 @@ bool smb_io_rpc_context(const char *desc, RPC_CONTEXT *rpc_ctx, prs_struct *ps,
 		return False;
 
 	if (UNMARSHALLING(ps)) {
-		if (!(rpc_ctx->transfer = PRS_ALLOC_MEM(ps, RPC_IFACE, rpc_ctx->num_transfer_syntaxes))) {
+		if (!(rpc_ctx->transfer = PRS_ALLOC_MEM(ps, struct ndr_syntax_id, rpc_ctx->num_transfer_syntaxes))) {
 			return False;
 		}
 	}
@@ -352,7 +354,7 @@ void init_rpc_hdr_ba(RPC_HDR_BA *rpc,
 				uint16 max_tsize, uint16 max_rsize, uint32 assoc_gid,
 				const char *pipe_addr,
 				uint8 num_results, uint16 result, uint16 reason,
-				RPC_IFACE *transfer)
+				const struct ndr_syntax_id *transfer)
 {
 	init_rpc_hdr_bba (&rpc->bba, max_tsize, max_rsize, assoc_gid);
 	init_rpc_addr_str(&rpc->addr, pipe_addr);
diff --git a/source3/rpc_server/srv_pipe.c b/source3/rpc_server/srv_pipe.c
index f3ee18d..341d8b3 100644
--- a/source3/rpc_server/srv_pipe.c
+++ b/source3/rpc_server/srv_pipe.c
@@ -950,8 +950,10 @@ bool setup_cancel_ack_reply(pipes_struct *p, prs_struct *rpc_in_p)
  Used to reject unknown binds from Win2k.
 *******************************************************************/
 
-bool check_bind_req(struct pipes_struct *p, RPC_IFACE* abstract,
-                    RPC_IFACE* transfer, uint32 context_id)
+static bool check_bind_req(struct pipes_struct *p,
+			   struct ndr_syntax_id* abstract,
+			   struct ndr_syntax_id* transfer,
+			   uint32 context_id)
 {
 	int i=0;
 	struct pipe_rpc_fns *context_fns;
@@ -1718,13 +1720,11 @@ bool api_pipe_bind_req(pipes_struct *p, prs_struct *rpc_in_p)
 	                0x1, 0x0, 0x0,
 	                &hdr_rb.rpc_context[0].transfer[0]);
 	} else {
-		RPC_IFACE null_interface;
-		ZERO_STRUCT(null_interface);
 		/* Rejection reason: abstract syntax not supported */
 		init_rpc_hdr_ba(&hdr_ba, RPC_MAX_PDU_FRAG_LEN,
 					RPC_MAX_PDU_FRAG_LEN, assoc_gid,
 					ack_pipe_name, 0x1, 0x2, 0x1,
-					&null_interface);
+					&null_ndr_syntax_id);
 		p->pipe_bound = False;
 	}
 
@@ -1908,13 +1908,11 @@ bool api_pipe_alter_context(pipes_struct *p, prs_struct *rpc_in_p)
 	                0x1, 0x0, 0x0,
 	                &hdr_rb.rpc_context[0].transfer[0]);
 	} else {
-		RPC_IFACE null_interface;
-		ZERO_STRUCT(null_interface);
 		/* Rejection reason: abstract syntax not supported */
 		init_rpc_hdr_ba(&hdr_ba, RPC_MAX_PDU_FRAG_LEN,
 					RPC_MAX_PDU_FRAG_LEN, assoc_gid,
 					ack_pipe_name, 0x1, 0x2, 0x1,
-					&null_interface);
+					&null_ndr_syntax_id);
 		p->pipe_bound = False;
 	}
 
diff --git a/source4/dsdb/samdb/cracknames.c b/source4/dsdb/samdb/cracknames.c
index 119dd92..8e97c45 100644
--- a/source4/dsdb/samdb/cracknames.c
+++ b/source4/dsdb/samdb/cracknames.c
@@ -6,17 +6,17 @@
 
    Copyright (C) Stefan Metzmacher 2004
    Copyright (C) Andrew Bartlett <abartlet at samba.org> 2004-2005
-   
+
    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/>.
 */
@@ -65,12 +65,12 @@ static WERROR dns_domain_from_principal(TALLOC_CTX *mem_ctx, struct smb_krb5_con
 
 	/* This isn't an allocation assignemnt, so it is free'ed with the krb5_free_principal */
 	realm = krb5_principal_get_realm(smb_krb5_context->krb5_context, principal);
-	
+
 	info1->dns_domain_name	= talloc_strdup(mem_ctx, realm);
 	krb5_free_principal(smb_krb5_context->krb5_context, principal);
-	
+
 	W_ERROR_HAVE_NO_MEMORY(info1->dns_domain_name);
-	
+
 	info1->status = DRSUAPI_DS_NAME_STATUS_DOMAIN_ONLY;
 	return WERR_OK;
 }		
@@ -121,7 +121,7 @@ static enum drsuapi_DsNameStatus LDB_lookup_spn_alias(krb5_context context, stru
 		DEBUG(1, ("ldb_search: dn: %s not found", service_dn_str));
 		return DRSUAPI_DS_NAME_STATUS_NOT_FOUND;
 	}
-	
+
 	spnmappings = ldb_msg_find_element(res->msgs[0], "sPNMappings");
 	if (!spnmappings || spnmappings->num_values == 0) {
 		DEBUG(1, ("ldb_search: dn: %s no sPNMappings attribute", service_dn_str));
@@ -138,9 +138,9 @@ static enum drsuapi_DsNameStatus LDB_lookup_spn_alias(krb5_context context, stru
 			talloc_free(tmp_ctx);
 			return DRSUAPI_DS_NAME_STATUS_NOT_FOUND;
 		}
-		
+
 		/* C string manipulation sucks */
-		
+
 		p = strchr(mapping, '=');
 		if (!p) {
 			DEBUG(1, ("ldb_search: dn: %s sPNMapping malformed: %s\n", 
@@ -187,7 +187,7 @@ static WERROR DsCrackNameSPNAlias(struct ldb_context *sam_ctx, TALLOC_CTX *mem_c
 	char *new_service;
 	char *new_princ;
 	enum drsuapi_DsNameStatus namestatus;
-	
+
 	/* parse principal */
 	ret = krb5_parse_name_flags(smb_krb5_context->krb5_context, 
 				    name, KRB5_PRINCIPAL_PARSE_NO_REALM, &principal);
@@ -197,9 +197,9 @@ static WERROR DsCrackNameSPNAlias(struct ldb_context *sam_ctx, TALLOC_CTX *mem_c
 							   ret, mem_ctx)));
 		return WERR_NOMEM;
 	}
-	
+
 	/* grab cifs/, http/ etc */
-	
+
 	/* This is checked for in callers, but be safe */
 	if (principal->name.name_string.len < 2) {
 		info1->status = DRSUAPI_DS_NAME_STATUS_NOT_FOUND;
@@ -207,12 +207,12 @@ static WERROR DsCrackNameSPNAlias(struct ldb_context *sam_ctx, TALLOC_CTX *mem_c
 	}
 	service = principal->name.name_string.val[0];
 	dns_name = principal->name.name_string.val[1];
-	
+
 	/* MAP it */
 	namestatus = LDB_lookup_spn_alias(smb_krb5_context->krb5_context, 
 					  sam_ctx, mem_ctx, 
 					  service, &new_service);
-	
+
 	if (namestatus == DRSUAPI_DS_NAME_STATUS_NOT_FOUND) {
 		info1->status		= DRSUAPI_DS_NAME_STATUS_DOMAIN_ONLY;
 		info1->dns_domain_name	= talloc_strdup(mem_ctx, dns_name);
@@ -226,7 +226,7 @@ static WERROR DsCrackNameSPNAlias(struct ldb_context *sam_ctx, TALLOC_CTX *mem_c
 		krb5_free_principal(smb_krb5_context->krb5_context, principal);
 		return WERR_OK;
 	}
-	
+
 	/* ooh, very nasty playing around in the Principal... */
 	free(principal->name.name_string.val[0]);
 	principal->name.name_string.val[0] = strdup(new_service);
@@ -234,7 +234,7 @@ static WERROR DsCrackNameSPNAlias(struct ldb_context *sam_ctx, TALLOC_CTX *mem_c
 		krb5_free_principal(smb_krb5_context->krb5_context, principal);
 		return WERR_NOMEM;
 	}
-	
+
 	/* reform principal */
 	ret = krb5_unparse_name_flags(smb_krb5_context->krb5_context, principal, 
 				      KRB5_PRINCIPAL_UNPARSE_NO_REALM, &new_princ);
@@ -243,7 +243,7 @@ static WERROR DsCrackNameSPNAlias(struct ldb_context *sam_ctx, TALLOC_CTX *mem_c
 		krb5_free_principal(smb_krb5_context->krb5_context, principal);
 		return WERR_NOMEM;
 	}
-	
+
 	wret = DsCrackNameOneName(sam_ctx, mem_ctx, format_flags, format_offered, format_desired,
 				  new_princ, info1);
 	free(new_princ);
@@ -275,7 +275,7 @@ static WERROR DsCrackNameUPN(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ctx,
 	char *unparsed_name_short;
 	const char *domain_attrs[] = { NULL };
 	struct ldb_result *domain_res = NULL;
-	
+
 	/* Prevent recursion */
 	if (!name) {
 		info1->status = DRSUAPI_DS_NAME_STATUS_NOT_FOUND;
@@ -288,7 +288,7 @@ static WERROR DsCrackNameUPN(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ctx,
 		info1->status = DRSUAPI_DS_NAME_STATUS_NOT_FOUND;
 		return WERR_OK;
 	}
-	
+
 	realm = krb5_principal_get_realm(smb_krb5_context->krb5_context, principal);
 
 	ldb_ret = ldb_search(sam_ctx, mem_ctx, &domain_res,
@@ -304,7 +304,7 @@ static WERROR DsCrackNameUPN(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ctx,
 		info1->status = DRSUAPI_DS_NAME_STATUS_RESOLVE_ERROR;
 		return WERR_OK;
 	}
-	
+
 	switch (domain_res->count) {
 	case 1:
 		break;
@@ -315,16 +315,16 @@ static WERROR DsCrackNameUPN(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ctx,
 		info1->status = DRSUAPI_DS_NAME_STATUS_NOT_UNIQUE;
 		return WERR_OK;
 	}
-	
+
 	ret = krb5_unparse_name_flags(smb_krb5_context->krb5_context, principal, 
 				      KRB5_PRINCIPAL_UNPARSE_NO_REALM, &unparsed_name_short);
 	krb5_free_principal(smb_krb5_context->krb5_context, principal);
-		
+
 	if (ret) {
 		free(unparsed_name_short);
 		return WERR_NOMEM;
 	}
-	
+
 	/* This may need to be extended for more userPrincipalName variations */
 	result_filter = talloc_asprintf(mem_ctx, "(&(objectClass=user)(samAccountName=%s))", 
 					ldb_binary_encode_string(mem_ctx, unparsed_name_short));
@@ -400,15 +400,15 @@ WERROR DsCrackNameOneName(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ctx,
 	case DRSUAPI_DS_NAME_FORMAT_CANONICAL_EX:
 	{
 		char *str, *s, *account;
-		
+
 		if (strlen(name) == 0) {
 			info1->status = DRSUAPI_DS_NAME_STATUS_RESOLVE_ERROR;
 			return WERR_OK;
 		}
-		
+
 		str = talloc_strdup(mem_ctx, name);
 		W_ERROR_HAVE_NO_MEMORY(str);
-		
+
 		if (format_offered == DRSUAPI_DS_NAME_FORMAT_CANONICAL_EX) {
 			/* Look backwards for the \n, and replace it with / */
 			s = strrchr(str, '\n');
@@ -425,7 +425,7 @@ WERROR DsCrackNameOneName(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ctx,
 			info1->status = DRSUAPI_DS_NAME_STATUS_RESOLVE_ERROR;
 			return WERR_OK;
 		}
-		
+
 		s[0] = '\0';
 		s++;
 
@@ -435,7 +435,7 @@ WERROR DsCrackNameOneName(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ctx,
 
 		/* There may not be anything after the domain component (search for the domain itself) */
 		if (s[0]) {
-			
+
 			account = strrchr(s, '/');
 			if (!account) {
 				account = s;
@@ -454,10 +454,10 @@ WERROR DsCrackNameOneName(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ctx,
 		char *p;
 		char *domain;
 		const char *account = NULL;
-		
+
 		domain = talloc_strdup(mem_ctx, name);
 		W_ERROR_HAVE_NO_MEMORY(domain);
-		
+
 		p = strchr(domain, '\\');
 		if (!p) {
 			/* invalid input format */
@@ -465,11 +465,11 @@ WERROR DsCrackNameOneName(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ctx,
 			return WERR_OK;
 		}
 		p[0] = '\0';
-		
+
 		if (p[1]) {
 			account = &p[1];
 		}
-		
+
 		domain_filter = talloc_asprintf(mem_ctx, 
 						"(&(&(nETBIOSName=%s)(objectclass=crossRef))(ncName=*))", 
 						ldb_binary_encode_string(mem_ctx, domain));
@@ -479,7 +479,7 @@ WERROR DsCrackNameOneName(struct ldb_context *sam_ctx, TALLOC_CTX *mem_ctx,
 							ldb_binary_encode_string(mem_ctx, account));
 			W_ERROR_HAVE_NO_MEMORY(result_filter);
 		}
-		
+
 		talloc_free(domain);
 		break;


-- 
Samba Shared Repository


More information about the samba-cvs mailing list