[SCM] Samba Shared Repository - branch v3-2-test updated - release-3-2-0pre2-238-g5f2b314

Günther Deschner gd at samba.org
Wed Mar 12 17:30:57 GMT 2008


The branch, v3-2-test has been updated
       via  5f2b3145fcaeee58f285b6527e9fac09c5337e8a (commit)
       via  6363c383d6989d2dfb2ee488ffa7aeb128c5385b (commit)
       via  4928f1efceb8cb0b0fda813e6f43f668084caa79 (commit)
       via  c8ea359c19f2907683d0cd566ef19f09cc6101bf (commit)
      from  737e470e02d1233fda51e903f27955e45427e95a (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit 5f2b3145fcaeee58f285b6527e9fac09c5337e8a
Author: Günther Deschner <gd at samba.org>
Date:   Wed Mar 12 16:35:41 2008 +0100

    Use existing srv_name_slash.
    
    Guenther

commit 6363c383d6989d2dfb2ee488ffa7aeb128c5385b
Author: Günther Deschner <gd at samba.org>
Date:   Wed Mar 12 16:19:56 2008 +0100

    For convenience reasons, always create cli->srv_name_slash in the rpc_client.
    
    Guenther

commit 4928f1efceb8cb0b0fda813e6f43f668084caa79
Author: Günther Deschner <gd at samba.org>
Date:   Wed Mar 12 16:18:54 2008 +0100

    Remove unused marshalling for SRV_NET_DISK_ENUM.
    
    Guenther

commit c8ea359c19f2907683d0cd566ef19f09cc6101bf
Author: Günther Deschner <gd at samba.org>
Date:   Wed Mar 12 16:17:27 2008 +0100

    Ignore some unneeded autogenerated cli_ and srv_ functions.
    
    Guenther

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

Summary of changes:
 .gitignore                     |   12 ++++
 source/include/client.h        |    1 +
 source/include/rpc_srvsvc.h    |   25 -------
 source/libsmb/cliconnect.c     |    1 +
 source/rpc_client/cli_lsarpc.c |    3 +-
 source/rpc_client/cli_samr.c   |   24 +------
 source/rpc_parse/parse_srv.c   |  139 ----------------------------------------
 source/rpcclient/cmd_srvsvc.c  |    4 +-
 8 files changed, 19 insertions(+), 190 deletions(-)


Changeset truncated at 500 lines:

diff --git a/.gitignore b/.gitignore
index 516fd45..e210315 100644
--- a/.gitignore
+++ b/.gitignore
@@ -62,3 +62,15 @@ examples/libsmbclient/teststat3
 examples/libsmbclient/testutime
 examples/libsmbclient/testwrite
 examples/libsmbclient/testtruncate
+source/librpc/gen_ndr/cli_krb5pac.*
+source/librpc/gen_ndr/cli_messaging.*
+source/librpc/gen_ndr/cli_misc.*
+source/librpc/gen_ndr/cli_notify.*
+source/librpc/gen_ndr/cli_security.*
+source/librpc/gen_ndr/cli_xattr.*
+source/librpc/gen_ndr/srv_krb5pac.*
+source/librpc/gen_ndr/srv_messaging.*
+source/librpc/gen_ndr/srv_misc.*
+source/librpc/gen_ndr/srv_notify.*
+source/librpc/gen_ndr/srv_security.*
+source/librpc/gen_ndr/srv_xattr.*
diff --git a/source/include/client.h b/source/include/client.h
index 52dc513..0787712 100644
--- a/source/include/client.h
+++ b/source/include/client.h
@@ -123,6 +123,7 @@ struct cli_state {
 	int privileges;
 
 	fstring desthost;
+	fstring srv_name_slash;
 
 	/* The credentials used to open the cli_state connection. */
 	fstring domain;
diff --git a/source/include/rpc_srvsvc.h b/source/include/rpc_srvsvc.h
index bc246f2..4d840d0 100644
--- a/source/include/rpc_srvsvc.h
+++ b/source/include/rpc_srvsvc.h
@@ -48,31 +48,6 @@
 
 #define MAX_SERVER_DISK_ENTRIES 15
 
-typedef struct disk_info {
-	uint32  unknown;
-	UNISTR3 disk_name;
-} DISK_INFO;
-
-typedef struct disk_enum_container {
-	uint32 level;
-	uint32 entries_read;
-	uint32 unknown;
-	uint32 disk_info_ptr;
-	DISK_INFO *disk_info;
-} DISK_ENUM_CONTAINER;
-
-typedef struct net_srv_disk_enum {
-	uint32 ptr_srv_name;         /* pointer (to server name?) */
-	UNISTR2 uni_srv_name;        /* server name */
-
-	DISK_ENUM_CONTAINER disk_enum_ctr;
-
-	uint32 preferred_len;        /* preferred maximum length (0xffff ffff) */
-	uint32 total_entries;        /* total number of entries */
-	ENUM_HND enum_hnd;
-	WERROR status;               /* return status */
-} SRV_Q_NET_DISK_ENUM, SRV_R_NET_DISK_ENUM;
-
 /***************************/
 
 /* oops - this is going to take up a *massive* amount of stack. */
diff --git a/source/libsmb/cliconnect.c b/source/libsmb/cliconnect.c
index 912b841..5e8a586 100644
--- a/source/libsmb/cliconnect.c
+++ b/source/libsmb/cliconnect.c
@@ -1485,6 +1485,7 @@ NTSTATUS cli_connect(struct cli_state *cli,
 	}
 
 	fstrcpy(cli->desthost, host);
+	fstr_sprintf(cli->srv_name_slash, "\\\\%s", cli->desthost);
 
 	/* allow hostnames of the form NAME#xx and do a netbios lookup */
 	if ((p = strchr(cli->desthost, '#'))) {
diff --git a/source/rpc_client/cli_lsarpc.c b/source/rpc_client/cli_lsarpc.c
index 0b89488..3d57e22 100644
--- a/source/rpc_client/cli_lsarpc.c
+++ b/source/rpc_client/cli_lsarpc.c
@@ -87,7 +87,6 @@ NTSTATUS rpccli_lsa_open_policy2(struct rpc_pipe_client *cli,
 {
 	struct lsa_ObjectAttribute attr;
 	struct lsa_QosInfo qos;
-	char *srv_name_slash = talloc_asprintf(mem_ctx, "\\\\%s", cli->cli->desthost);
 
 	if (sec_qos) {
 		init_lsa_sec_qos(&qos, 0xc, 2, 1, 0);
@@ -109,7 +108,7 @@ NTSTATUS rpccli_lsa_open_policy2(struct rpc_pipe_client *cli,
 	}
 
 	return rpccli_lsa_OpenPolicy2(cli, mem_ctx,
-				      srv_name_slash,
+				      cli->cli->srv_name_slash,
 				      &attr,
 				      des_access,
 				      pol);
diff --git a/source/rpc_client/cli_samr.c b/source/rpc_client/cli_samr.c
index 62a5c72..f0763cc 100644
--- a/source/rpc_client/cli_samr.c
+++ b/source/rpc_client/cli_samr.c
@@ -42,18 +42,12 @@ NTSTATUS rpccli_samr_chgpasswd_user(struct rpc_pipe_client *cli,
 	uchar new_nt_hash[16];
 	uchar new_lanman_hash[16];
 	struct lsa_String server, account;
-	char *srv_name_slash = NULL;
 
 	DEBUG(10,("rpccli_samr_chgpasswd_user\n"));
 
-	init_lsa_String(&server, srv_name_slash);
+	init_lsa_String(&server, cli->cli->srv_name_slash);
 	init_lsa_String(&account, username);
 
-	srv_name_slash = talloc_asprintf(mem_ctx, "\\\\%s", cli->cli->desthost);
-	if (!srv_name_slash) {
-		return NT_STATUS_NO_MEMORY;
-	}
-
 	/* Calculate the MD4 hash (NT compatible) of the password */
 	E_md4hash(oldpassword, old_nt_hash);
 	E_md4hash(newpassword, new_nt_hash);
@@ -108,16 +102,10 @@ NTSTATUS rpccli_samr_chng_pswd_auth_crap(struct rpc_pipe_client *cli,
 	struct samr_Password old_nt_hash_enc;
 	struct samr_Password old_lm_hash_enc;
 	struct lsa_String server, account;
-	char *srv_name_slash = NULL;
 
 	DEBUG(10,("rpccli_samr_chng_pswd_auth_crap\n"));
 
-	srv_name_slash = talloc_asprintf(mem_ctx, "\\\\%s", cli->cli->desthost);
-	if (!srv_name_slash) {
-		return NT_STATUS_NO_MEMORY;
-	}
-
-	init_lsa_String(&server, srv_name_slash);
+	init_lsa_String(&server, cli->cli->srv_name_slash);
 	init_lsa_String(&account, username);
 
 	memcpy(&new_nt_password.data, new_nt_password_blob.data, 516);
@@ -160,16 +148,10 @@ NTSTATUS rpccli_samr_chgpasswd3(struct rpc_pipe_client *cli,
 	uchar new_lanman_hash[16];
 
 	struct lsa_String server, account;
-	char *srv_name_slash = NULL;
 
 	DEBUG(10,("rpccli_samr_chgpasswd_user3\n"));
 
-	srv_name_slash = talloc_asprintf(mem_ctx, "\\\\%s", cli->cli->desthost);
-	if (!srv_name_slash) {
-		return NT_STATUS_NO_MEMORY;
-	}
-
-	init_lsa_String(&server, srv_name_slash);
+	init_lsa_String(&server, cli->cli->srv_name_slash);
 	init_lsa_String(&account, username);
 
 	/* Calculate the MD4 hash (NT compatible) of the password */
diff --git a/source/rpc_parse/parse_srv.c b/source/rpc_parse/parse_srv.c
index ec214d3..b184848 100644
--- a/source/rpc_parse/parse_srv.c
+++ b/source/rpc_parse/parse_srv.c
@@ -987,142 +987,3 @@ bool srv_io_r_net_file_enum(const char *desc, SRV_R_NET_FILE_ENUM *r_n, prs_stru
 
 	return True;
 }
-
-/*******************************************************************
- initialises a structure.
- ********************************************************************/
-
-bool init_srv_q_net_disk_enum(SRV_Q_NET_DISK_ENUM *q_n,
-			      const char *srv_name,
-			      uint32 preferred_len,
-			      ENUM_HND *enum_hnd
-	) 
-{
-  
-
-	DEBUG(5,("init_srv_q_net_srv_disk_enum\n"));
-
-	init_buf_unistr2(&q_n->uni_srv_name, &q_n->ptr_srv_name, srv_name);
-
-	q_n->disk_enum_ctr.level = 0;
-	q_n->disk_enum_ctr.disk_info_ptr   = 0;
-  
-	q_n->preferred_len = preferred_len;
-	memcpy(&q_n->enum_hnd, enum_hnd, sizeof(*enum_hnd));
-
-	return True;
-}
-
-/*******************************************************************
- Reads or writes a structure.
- ********************************************************************/
-
-bool srv_io_q_net_disk_enum(const char *desc, SRV_Q_NET_DISK_ENUM *q_n, prs_struct *ps, int depth)
-{
-	if (q_n == NULL)
-		return False;
-
-	prs_debug(ps, depth, desc, "srv_io_q_net_disk_enum");
-	depth++;
-
-	if(!prs_align(ps))
-		return False;
-
-	if(!prs_uint32("ptr_srv_name", ps, depth, &q_n->ptr_srv_name))
-		return False;
-
-	if(!smb_io_unistr2("", &q_n->uni_srv_name, True, ps, depth))
-		return False;
-
-	if(!prs_align(ps))
-		return False;
-
-	if(!prs_uint32("level", ps, depth, &q_n->disk_enum_ctr.level))
-		return False;
-
-	if(!prs_uint32("entries_read", ps, depth, &q_n->disk_enum_ctr.entries_read))
-		return False;
-
-	if(!prs_uint32("buffer", ps, depth, &q_n->disk_enum_ctr.disk_info_ptr))
-		return False;
-
-	if(!prs_align(ps))
-		return False;
-
-	if(!prs_uint32("preferred_len", ps, depth, &q_n->preferred_len))
-		return False;
-	if(!smb_io_enum_hnd("enum_hnd", &q_n->enum_hnd, ps, depth))
-		return False;
-
-	return True;
-}
-
-/*******************************************************************
- Reads or writes a structure.
- ********************************************************************/
-
-bool srv_io_r_net_disk_enum(const char *desc, SRV_R_NET_DISK_ENUM *r_n, prs_struct *ps, int depth)
-{
-
-	unsigned int i;
-	uint32 entries_read, entries_read2, entries_read3;
-
-	if (r_n == NULL)
-		return False;
-
-	prs_debug(ps, depth, desc, "srv_io_r_net_disk_enum");
-	depth++;
-
-	entries_read = entries_read2 = entries_read3 = r_n->disk_enum_ctr.entries_read;
-
-	if(!prs_align(ps))
-		return False;
-
-	if(!prs_uint32("entries_read", ps, depth, &entries_read))
-		return False;
-	if(!prs_uint32("ptr_disk_info", ps, depth, &r_n->disk_enum_ctr.disk_info_ptr))
-		return False;
-
-	/*this may be max, unknown, actual?*/
-
-	if(!prs_uint32("max_elements", ps, depth, &entries_read2))
-		return False;
-	if(!prs_uint32("unknown", ps, depth, &r_n->disk_enum_ctr.unknown))
-		return False;
-	if(!prs_uint32("actual_elements", ps, depth, &entries_read3))
-		return False;
-
-	r_n->disk_enum_ctr.entries_read = entries_read3;
-
-	if(UNMARSHALLING(ps) && entries_read3) {
-
-		DISK_INFO *dinfo;
-
-		if(!(dinfo = PRS_ALLOC_MEM(ps, DISK_INFO, entries_read3)))
-			return False;
-		r_n->disk_enum_ctr.disk_info = dinfo;
-	}
-
-	for(i=0; i < entries_read3; i++) {
-
-		if(!prs_uint32("unknown", ps, depth, &r_n->disk_enum_ctr.disk_info[i].unknown))
-			return False;
-   
-		if(!smb_io_unistr3("disk_name", &r_n->disk_enum_ctr.disk_info[i].disk_name, ps, depth))
-			return False;
-
-		if(!prs_align(ps))
-			return False;
-	}
-
-	if(!prs_uint32("total_entries", ps, depth, &r_n->total_entries))
-		return False;
-
-	if(!smb_io_enum_hnd("enum_hnd", &r_n->enum_hnd, ps, depth))
-		return False;
-
-	if(!prs_werror("status", ps, depth, &r_n->status))
-		return False;
-
-	return True;
-}
diff --git a/source/rpcclient/cmd_srvsvc.c b/source/rpcclient/cmd_srvsvc.c
index 0c447e0..fc00f8a 100644
--- a/source/rpcclient/cmd_srvsvc.c
+++ b/source/rpcclient/cmd_srvsvc.c
@@ -516,7 +516,6 @@ static WERROR cmd_srvsvc_net_remote_tod(struct rpc_pipe_client *cli,
                                           int argc, const char **argv)
 {
 	struct srvsvc_NetRemoteTODInfo *tod = NULL;
-	fstring srv_name_slash;
 	WERROR result;
 	NTSTATUS status;
 
@@ -525,9 +524,8 @@ static WERROR cmd_srvsvc_net_remote_tod(struct rpc_pipe_client *cli,
 		return WERR_OK;
 	}
 
-	fstr_sprintf(srv_name_slash, "\\\\%s", cli->cli->desthost);
 	status = rpccli_srvsvc_NetRemoteTOD(cli, mem_ctx,
-					    srv_name_slash,
+					    cli->cli->srv_name_slash,
 					    &tod,
 					    &result);
 	if (!NT_STATUS_IS_OK(status)) {


-- 
Samba Shared Repository


More information about the samba-cvs mailing list