[SCM] Samba Shared Repository - branch master updated - ae385145347f8e7a10acd61a5217685c6c617661

Jelmer Vernooij jelmer at samba.org
Tue Sep 30 12:58:46 GMT 2008


The branch, master has been updated
       via  ae385145347f8e7a10acd61a5217685c6c617661 (commit)
       via  ac5e69a999c4dcd337c5b8467aba3018df50126b (commit)
       via  43aaa78fe6f032d8d79b558ea931e7e8240f6f9d (commit)
       via  454122ab091715edf02c26e0a408141c7374b693 (commit)
       via  2400b1fea2a07ad3972ee8133e37eaf2f91499d0 (commit)
       via  4a1dabd8361c8480261d89b4ea39236ff0431897 (commit)
       via  5bbd73c0ff64ec5da337d327d4f6ed1de2132ed4 (commit)
       via  2ba4a79210f35df526a72c740ada5de34d6f45f4 (commit)
       via  235b729309a17fa44fecf743db5fe6552f67f577 (commit)
       via  181ee01da67985f5db684500247d655ce72fe611 (commit)
       via  cef80957c49c972e82a634724590b5fd5d6ca78f (commit)
       via  4e8cb60222ea13295eaff477625164dfd61e288f (commit)
       via  755ad80e2932f2114941adeb13f8879010484ff8 (commit)
       via  43d944e6d6b66cf67ee857a62a439296738d3a59 (commit)
       via  9de1472bd1848363dfce1644ce7b971486551ec3 (commit)
       via  83183bf38190b867ca4bb7ebda1136803e36f777 (commit)
       via  c8a19f0b8373bec27f4d3638bb731963896f3ff5 (commit)
      from  394f24b374e1fda8dc8222b71ce164a1a79efde6 (commit)

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


- Log -----------------------------------------------------------------
commit ae385145347f8e7a10acd61a5217685c6c617661
Merge: ac5e69a999c4dcd337c5b8467aba3018df50126b 394f24b374e1fda8dc8222b71ce164a1a79efde6
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Tue Sep 30 14:57:51 2008 +0200

    Merge branch 'master' of ssh://git.samba.org/data/git/samba

commit ac5e69a999c4dcd337c5b8467aba3018df50126b
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Tue Sep 30 06:10:32 2008 +0200

    dcesrv: Remove use of global_loadparm.

commit 43aaa78fe6f032d8d79b558ea931e7e8240f6f9d
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Tue Sep 30 06:05:46 2008 +0200

    Update .gitignore for new pidl location.

commit 454122ab091715edf02c26e0a408141c7374b693
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Tue Sep 30 06:05:05 2008 +0200

    make sure dcerpc is always initialized.

commit 2400b1fea2a07ad3972ee8133e37eaf2f91499d0
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Tue Sep 30 04:22:54 2008 +0200

    Fix segfault.

commit 4a1dabd8361c8480261d89b4ea39236ff0431897
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Tue Sep 30 04:22:24 2008 +0200

    wmi: Use cli_credentials.

commit 5bbd73c0ff64ec5da337d327d4f6ed1de2132ed4
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Tue Sep 30 04:01:47 2008 +0200

    Remove two more uses of global loadparm by remember required
    details for secondary DCE/RPC connections.

commit 2ba4a79210f35df526a72c740ada5de34d6f45f4
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Tue Sep 30 03:20:46 2008 +0200

    Eliminate another global_loadparm.

commit 235b729309a17fa44fecf743db5fe6552f67f577
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Tue Sep 30 03:07:08 2008 +0200

    Cope with API changes.

commit 181ee01da67985f5db684500247d655ce72fe611
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Tue Sep 30 02:47:19 2008 +0200

    Pass session options around; saves another use of global_loadparm.

commit cef80957c49c972e82a634724590b5fd5d6ca78f
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Tue Sep 30 02:19:15 2008 +0200

    Remove global_loadparm instance, discard_const_p.

commit 4e8cb60222ea13295eaff477625164dfd61e288f
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Tue Sep 30 02:11:55 2008 +0200

    Remove global_loadparm instance.

commit 755ad80e2932f2114941adeb13f8879010484ff8
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Tue Sep 30 02:07:14 2008 +0200

    Remove uses of global_loadparm.

commit 43d944e6d6b66cf67ee857a62a439296738d3a59
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Tue Sep 30 01:59:10 2008 +0200

    Remove global_loadparm instance.

commit 9de1472bd1848363dfce1644ce7b971486551ec3
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Tue Sep 30 01:58:06 2008 +0200

    Remove redundant call.

commit 83183bf38190b867ca4bb7ebda1136803e36f777
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Tue Sep 30 01:38:51 2008 +0200

    Explicitly pass on session options to session setup function.

commit c8a19f0b8373bec27f4d3638bb731963896f3ff5
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Tue Sep 30 01:29:53 2008 +0200

    Pass options struct into session initialization functions rather than
    using global_loadparm.

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

Summary of changes:
 .gitignore                                   |    8 ++--
 pidl/lib/Parse/Pidl/Samba4/Python.pm         |   10 ++++++
 source4/auth/ntlm/auth_server.c              |    1 +
 source4/client/cifsdd.c                      |   15 ++++++---
 source4/client/cifsdd.h                      |    4 ++-
 source4/client/cifsddio.c                    |   17 +++++++----
 source4/client/client.c                      |    9 ++++--
 source4/client/smbmount.c                    |   19 +++++++++---
 source4/lib/wmi/wmi.h                        |    2 +-
 source4/lib/wmi/wmicore.c                    |   14 +--------
 source4/libcli/cliconnect.c                  |   12 +++++--
 source4/libcli/raw/clisession.c              |    7 ++--
 source4/libcli/raw/clitree.c                 |    4 ++-
 source4/libcli/smb_composite/connect.c       |    2 +-
 source4/libcli/smb_composite/fetchfile.c     |    1 +
 source4/libcli/smb_composite/fsinfo.c        |   11 ++++--
 source4/libcli/smb_composite/smb_composite.h |    2 +
 source4/libnet/libnet_samdump_keytab.c       |   18 ++++++++---
 source4/libnet/libnet_site.c                 |    2 +-
 source4/librpc/rpc/dcerpc.c                  |    4 +--
 source4/librpc/rpc/dcerpc_connect.c          |    3 +-
 source4/librpc/rpc/dcerpc_secondary.c        |    7 ++--
 source4/librpc/rpc/dcerpc_sock.c             |   40 +++++++++++++++++--------
 source4/ntvfs/cifs/vfs_cifs.c                |    1 +
 source4/param/loadparm.c                     |    8 +++++
 source4/param/param.h                        |    3 ++
 source4/rpc_server/service_rpc.c             |   38 ++++++++++++------------
 source4/smbd/process_model.h                 |    3 +-
 source4/smbd/process_prefork.c               |    2 +-
 source4/smbd/process_single.c                |    2 +-
 source4/smbd/process_standard.c              |    5 ++-
 source4/smbd/process_thread.c                |    2 +-
 source4/smbd/service_stream.c                |    2 +-
 source4/smbd/service_task.c                  |    2 +-
 source4/torture/basic/misc.c                 |    1 +
 source4/torture/basic/secleak.c              |    5 ++-
 source4/torture/gentest.c                    |    5 ++-
 source4/torture/locktest.c                   |    4 ++-
 source4/torture/locktest2.c                  |   19 ++++++++----
 source4/torture/masktest.c                   |    9 ++++--
 source4/torture/raw/composite.c              |    3 +-
 source4/torture/raw/context.c                |   26 +++++++++++-----
 source4/torture/raw/lock.c                   |    5 ++-
 source4/torture/raw/lockbench.c              |    1 +
 source4/torture/raw/openbench.c              |    1 +
 source4/torture/raw/oplock.c                 |    5 ++-
 source4/torture/raw/tconrate.c               |    4 ++-
 source4/torture/rpc/join.c                   |    6 ++-
 source4/torture/rpc/samba3rpc.c              |   26 +++++++++++-----
 source4/torture/rpc/samlogon.c               |    8 ++++-
 source4/torture/unix/unix_info2.c            |    4 ++-
 source4/torture/unix/whoami.c                |    4 ++-
 source4/torture/util_smb.c                   |    4 ++-
 53 files changed, 274 insertions(+), 146 deletions(-)


Changeset truncated at 500 lines:

diff --git a/.gitignore b/.gitignore
index b87f786..e585504 100644
--- a/.gitignore
+++ b/.gitignore
@@ -252,10 +252,10 @@ source4/param/proto.h
 source4/param/secrets_proto.h
 source4/param/share_proto.h
 source4/passdb/proto.h
-source4/pidl/blib
-source4/pidl/cover_db
-source4/pidl/Makefile
-source4/pidl/pm_to_blib
+pidl/blib
+pidl/cover_db
+pidl/Makefile
+pidl/pm_to_blib
 source4/rpc_server/common/proto.h
 source4/rpc_server/dcerpc_server_proto.h
 source4/rpc_server/lsa/proto.h
diff --git a/pidl/lib/Parse/Pidl/Samba4/Python.pm b/pidl/lib/Parse/Pidl/Samba4/Python.pm
index 74cec5a..fc64c35 100644
--- a/pidl/lib/Parse/Pidl/Samba4/Python.pm
+++ b/pidl/lib/Parse/Pidl/Samba4/Python.pm
@@ -1173,6 +1173,7 @@ sub Parse($$$$$)
 	$self->pidl("{");
 	$self->indent;
 	$self->pidl("PyObject *m;");
+	$self->pidl("NTSTATUS status;");
 	$self->pidl("");
 
 	foreach (@{$self->{ready_types}}) {
@@ -1208,6 +1209,15 @@ sub Parse($$$$$)
 		$self->pidl("PyModule_AddObject(m, \"$object_name\", $c_name);");
 	}
 
+	$self->pidl("");
+	$self->pidl("status = dcerpc_init();");
+	$self->pidl("if (!NT_STATUS_IS_OK(status)) {");
+	$self->indent;
+	$self->pidl("PyErr_SetNTSTATUS(status);");
+	$self->pidl("return;");
+	$self->deindent;
+	$self->pidl("}");
+
 	$self->deindent;
 	$self->pidl("}");
     return ($self->{res_hdr}, $self->{res});
diff --git a/source4/auth/ntlm/auth_server.c b/source4/auth/ntlm/auth_server.c
index bb8773e..539ae6a 100644
--- a/source4/auth/ntlm/auth_server.c
+++ b/source4/auth/ntlm/auth_server.c
@@ -80,6 +80,7 @@ static NTSTATUS server_get_challenge(struct auth_method_context *ctx, TALLOC_CTX
 	io.in.workgroup = ""; /* only used with SPNEGO, disabled above */
 
 	io.in.options = smb_options;
+	lp_smbcli_session_options(ctx->auth_ctx->lp_ctx, &io.in.session_options);
 
 	status = smb_composite_connect(&io, mem_ctx, lp_resolve_context(ctx->auth_ctx->lp_ctx),
 				       ctx->auth_ctx->event_ctx);
diff --git a/source4/client/cifsdd.c b/source4/client/cifsdd.c
index 141b165..5f07826 100644
--- a/source4/client/cifsdd.c
+++ b/source4/client/cifsdd.c
@@ -357,7 +357,8 @@ static void print_transfer_stats(void)
 static struct dd_iohandle * open_file(struct resolve_context *resolve_ctx, 
 				      struct event_context *ev,
 				      const char * which, const char **ports,
-				      struct smbcli_options *smb_options)
+				      struct smbcli_options *smb_options,
+				      struct smbcli_session_options *smb_session_options)
 {
 	int			options = 0;
 	const char *		path = NULL;
@@ -379,13 +380,13 @@ static struct dd_iohandle * open_file(struct resolve_context *resolve_ctx,
 		path = check_arg_pathname("if");
 		handle = dd_open_path(resolve_ctx, ev, path, ports,
 				      check_arg_numeric("ibs"), options,
-				      smb_options);
+				      smb_options, smb_session_options);
 	} else if (strcmp(which, "of") == 0) {
 		options |= DD_WRITE;
 		path = check_arg_pathname("of");
 		handle = dd_open_path(resolve_ctx, ev, path, ports,
 				      check_arg_numeric("obs"), options,
-				      smb_options);
+				      smb_options, smb_session_options);
 	} else {
 		SMB_ASSERT(0);
 		return(NULL);
@@ -412,12 +413,14 @@ static int copy_files(struct event_context *ev, struct loadparm_context *lp_ctx)
 	struct dd_iohandle *	ofile;
 
 	struct smbcli_options options;
+	struct smbcli_session_options session_options;
 
 	ibs = check_arg_numeric("ibs");
 	obs = check_arg_numeric("obs");
 	count = check_arg_numeric("count");
 
 	lp_smbcli_options(lp_ctx, &options);
+	lp_smbcli_session_options(lp_ctx, &session_options);
 
 	/* Allocate IO buffer. We need more than the max IO size because we
 	 * could accumulate a remainder if ibs and obs don't match.
@@ -436,12 +439,14 @@ static int copy_files(struct event_context *ev, struct loadparm_context *lp_ctx)
 			(unsigned long long)iomax, options.max_xmit));
 
 	if (!(ifile = open_file(lp_resolve_context(lp_ctx), ev, "if",
-				lp_smb_ports(lp_ctx), &options))) {
+				lp_smb_ports(lp_ctx), &options,
+				&session_options))) {
 		return(FILESYS_EXIT_CODE);
 	}
 
 	if (!(ofile = open_file(lp_resolve_context(lp_ctx), ev, "of",
-				lp_smb_ports(lp_ctx), &options))) {
+				lp_smb_ports(lp_ctx), &options,
+				&session_options))) {
 		return(FILESYS_EXIT_CODE);
 	}
 
diff --git a/source4/client/cifsdd.h b/source4/client/cifsdd.h
index 21a4ad4..3195e43 100644
--- a/source4/client/cifsdd.h
+++ b/source4/client/cifsdd.h
@@ -89,6 +89,7 @@ struct dd_iohandle
 #define DD_OPLOCK		0x00000008
 
 struct smbcli_options;
+struct smbcli_session_options;
 struct event_context;
 
 struct dd_iohandle * dd_open_path(struct resolve_context *resolve_ctx, 
@@ -96,7 +97,8 @@ struct dd_iohandle * dd_open_path(struct resolve_context *resolve_ctx,
 				  const char * path,
 				  const char **ports,
 				uint64_t io_size, int options, 
-				struct smbcli_options *smb_options);
+				struct smbcli_options *smb_options,
+				struct smbcli_session_options *smb_session_options);
 bool dd_fill_block(struct dd_iohandle * h, uint8_t * buf,
 		uint64_t * buf_size, uint64_t need_size, uint64_t block_size);
 bool dd_flush_block(struct dd_iohandle * h, uint8_t * buf,
diff --git a/source4/client/cifsddio.c b/source4/client/cifsddio.c
index 4297c30..25194a6 100644
--- a/source4/client/cifsddio.c
+++ b/source4/client/cifsddio.c
@@ -225,7 +225,8 @@ static struct smbcli_state * init_smb_session(struct resolve_context *resolve_ct
 					      const char * host,
 					      const char **ports,
 					      const char * share,
-					      struct smbcli_options *options)
+					      struct smbcli_options *options,
+					      struct smbcli_session_options *session_options)
 {
 	NTSTATUS		ret;
 	struct smbcli_state *	cli = NULL;
@@ -236,7 +237,8 @@ static struct smbcli_state * init_smb_session(struct resolve_context *resolve_ct
 	ret = smbcli_full_connection(NULL, &cli, host, ports, share,
 				     NULL /* devtype */,
 				     cmdline_credentials, resolve_ctx,
-				     ev, options);
+				     ev, options,
+				     session_options);
 
 	if (!NT_STATUS_IS_OK(ret)) {
 		fprintf(stderr, "%s: connecting to //%s/%s: %s\n",
@@ -302,7 +304,8 @@ static struct dd_iohandle * open_cifs_handle(struct resolve_context *resolve_ctx
 					const char * path,
 					uint64_t io_size,
 					int options,
-					struct smbcli_options *smb_options)
+					struct smbcli_options *smb_options,
+					struct smbcli_session_options *smb_session_options)
 {
 	struct cifs_handle * smbh;
 
@@ -323,7 +326,7 @@ static struct dd_iohandle * open_cifs_handle(struct resolve_context *resolve_ctx
 	smbh->h.io_seek = smb_seek_func;
 
 	if ((smbh->cli = init_smb_session(resolve_ctx, ev, host, ports, share,
-					  smb_options)) == NULL) {
+					  smb_options, smb_session_options)) == NULL) {
 		return(NULL);
 	}
 
@@ -344,7 +347,8 @@ struct dd_iohandle * dd_open_path(struct resolve_context *resolve_ctx,
 				  const char **ports,
 				uint64_t io_size,
 				int options,
-				struct smbcli_options *smb_options)
+				struct smbcli_options *smb_options,
+				struct smbcli_session_options *smb_session_options)
 {
 	if (file_exist(path)) {
 		return(open_fd_handle(path, io_size, options));
@@ -361,7 +365,8 @@ struct dd_iohandle * dd_open_path(struct resolve_context *resolve_ctx,
 
 			return(open_cifs_handle(resolve_ctx, ev, host, ports,
 						share, remain,
-						io_size, options, smb_options));
+						io_size, options, smb_options,
+						smb_session_options));
 		}
 
 		return(open_fd_handle(path, io_size, options));
diff --git a/source4/client/client.c b/source4/client/client.c
index e05e195..266bd67 100644
--- a/source4/client/client.c
+++ b/source4/client/client.c
@@ -3032,7 +3032,8 @@ static bool do_connect(struct smbclient_context *ctx,
 		       const char *specified_server, const char **ports, 
 		       const char *specified_share, 
 		       struct cli_credentials *cred, 
-		       struct smbcli_options *options)
+		       struct smbcli_options *options,
+		       struct smbcli_session_options *session_options)
 {
 	NTSTATUS status;
 	char *server, *share;
@@ -3051,7 +3052,7 @@ static bool do_connect(struct smbclient_context *ctx,
 	
 	status = smbcli_full_connection(ctx, &ctx->cli, server, ports,
 					share, NULL, cred, resolve_ctx, 
-					ev_ctx, options);
+					ev_ctx, options, session_options);
 	if (!NT_STATUS_IS_OK(status)) {
 		d_printf("Connection to \\\\%s\\%s failed - %s\n", 
 			 server, share, nt_errstr(status));
@@ -3138,6 +3139,7 @@ static int do_message_op(const char *netbios_name, const char *desthost,
 	struct smbclient_context *ctx;
 	const char *cmdstr = NULL;
 	struct smbcli_options smb_options;
+	struct smbcli_session_options smb_session_options;
 
 	struct poptOption long_options[] = {
 		POPT_AUTOHELP
@@ -3227,6 +3229,7 @@ static int do_message_op(const char *netbios_name, const char *desthost,
 	poptFreeContext(pc);
 
 	lp_smbcli_options(cmdline_lp_ctx, &smb_options);
+	lp_smbcli_session_options(cmdline_lp_ctx, &smb_session_options);
 
 	ev_ctx = s4_event_context_init(talloc_autofree_context());
 
@@ -3255,7 +3258,7 @@ static int do_message_op(const char *netbios_name, const char *desthost,
 	
 	if (!do_connect(ctx, ev_ctx, lp_resolve_context(cmdline_lp_ctx),
 			desthost, lp_smb_ports(cmdline_lp_ctx), service,
-			cmdline_credentials, &smb_options))
+			cmdline_credentials, &smb_options, &smb_session_options))
 		return 1;
 
 	if (base_directory) 
diff --git a/source4/client/smbmount.c b/source4/client/smbmount.c
index 9ab6c37..37c9eaa 100644
--- a/source4/client/smbmount.c
+++ b/source4/client/smbmount.c
@@ -111,7 +111,8 @@ static void usr1_handler(int x)
 /***************************************************** 
 return a connection to a server
 *******************************************************/
-static struct smbcli_state *do_connection(const char *the_service, bool unicode, int maxprotocol)
+static struct smbcli_state *do_connection(const char *the_service, bool unicode, int maxprotocol,
+					  struct smbcli_session_options session_options)
 {
 	struct smbcli_state *c;
 	struct nmb_name called, calling;
@@ -210,11 +211,12 @@ static struct smbcli_state *do_connection(const char *the_service, bool unicode,
 	if (!smbcli_session_setup(c, username, 
 			       password, strlen(password),
 			       password, strlen(password),
-			       workgroup)) {
+			       workgroup, session_options)) {
 		/* if a password was not supplied then try again with a
 			null username */
 		if (password[0] || !username[0] ||
-				!smbcli_session_setup(c, "", "", 0, "", 0, workgroup)) {
+				!smbcli_session_setup(c, "", "", 0, "", 0, workgroup, 
+						      session_options)) {
 			DEBUG(0,("%d: session setup failed: %s\n",
 				sys_getpid(), smbcli_errstr(c)));
 			talloc_free(c);
@@ -329,6 +331,9 @@ static void send_fs_socket(struct loadparm_context *lp_ctx,
 	int fd, closed = 0, res = 1;
 	pid_t parentpid = getppid();
 	struct smb_conn_opt conn_options;
+	struct smbcli_session_options session_options;
+
+	lp_smbcli_session_options(lp_ctx, &session_options);
 
 	memset(&conn_options, 0, sizeof(conn_options));
 
@@ -409,7 +414,8 @@ static void send_fs_socket(struct loadparm_context *lp_ctx,
 			DEBUG(2,("mount.smbfs[%d]: got signal, getting new socket\n", sys_getpid()));
 			c = do_connection(the_service, 
 					  lp_unicode(lp_ctx), 
-					  lp_cli_maxprotocol(lp_ctx));
+					  lp_cli_maxprotocol(lp_ctx),
+					  session_options);
 		}
 	}
 
@@ -430,14 +436,17 @@ static void init_mount(struct loadparm_context *lp_ctx)
 	struct smbcli_state *c;
 	char *args[20];
 	int i, status;
+	struct smbcli_session_options session_options;
 
 	if (realpath(mpoint, mount_point) == NULL) {
 		fprintf(stderr, "Could not resolve mount point %s\n", mpoint);
 		return;
 	}
 
+	lp_smbcli_session_options(lp_ctx, &session_options);
 
-	c = do_connection(service, lp_unicode(lp_ctx), lp_cli_maxprotocol(lp_ctx));
+	c = do_connection(service, lp_unicode(lp_ctx), lp_cli_maxprotocol(lp_ctx),
+			  session_options);
 	if (!c) {
 		fprintf(stderr,"SMB connection failed\n");
 		exit(1);
diff --git a/source4/lib/wmi/wmi.h b/source4/lib/wmi/wmi.h
index 32543a8..46c9b70 100644
--- a/source4/lib/wmi/wmi.h
+++ b/source4/lib/wmi/wmi.h
@@ -27,7 +27,7 @@
 
 /** FIXME: Use credentials struct rather than user/password here */
 WERROR WBEM_ConnectServer(struct com_context *ctx, const char *server, const char *nspace, 
-			  const char *user, const char *password, 
+			  struct cli_credentials *credentials,
 			  const char *locale, uint32_t flags, const char *authority, 
 			  struct IWbemContext* wbem_ctx, struct IWbemServices** services);
 const char *wmi_errstr(WERROR werror);
diff --git a/source4/lib/wmi/wmicore.c b/source4/lib/wmi/wmicore.c
index 49c1e03..3ac6c89 100644
--- a/source4/lib/wmi/wmicore.c
+++ b/source4/lib/wmi/wmicore.c
@@ -51,7 +51,7 @@ void wmi_init(struct com_context **ctx, struct cli_credentials *credentials)
 
 /** FIXME: Use credentials struct rather than user/password here */
 WERROR WBEM_ConnectServer(struct com_context *ctx, const char *server, const uint16_t *nspace, 
-			  const char *user, const char *password, 
+			  struct cli_credentials *credentials,
 			  const char *locale, uint32_t flags, const char *authority, 
 			  struct IWbemContext* wbem_ctx, struct IWbemServices** services)
 {
@@ -61,18 +61,6 @@ WERROR WBEM_ConnectServer(struct com_context *ctx, const char *server, const uin
         struct IUnknown **mqi;
         struct IWbemLevel1Login *pL;
 
-        if (user) {
-                char *cred;
-                struct cli_credentials *cc;
-
-                cred = talloc_asprintf(NULL, "%s%%%s", user, password);
-                cc = cli_credentials_init(cred);
-                cli_credentials_set_conf(cc, global_loadparm);
-                cli_credentials_parse_string(cc, cred, CRED_SPECIFIED);
-                dcom_add_server_credentials(ctx, server, cc);
-                talloc_free(cred);
-        }
-
         GUID_from_string(CLSID_WBEMLEVEL1LOGIN, &clsid);
         GUID_from_string(COM_IWBEMLEVEL1LOGIN_UUID, &iid);
         result = dcom_create_object(ctx, &clsid, server, 1, &iid, &mqi, &coresult);
diff --git a/source4/libcli/cliconnect.c b/source4/libcli/cliconnect.c
index c20a7fd..e42b04c 100644
--- a/source4/libcli/cliconnect.c
+++ b/source4/libcli/cliconnect.c
@@ -69,12 +69,14 @@ NTSTATUS smbcli_negprot(struct smbcli_state *cli, bool unicode, int maxprotocol)
 /* wrapper around smb_raw_sesssetup() */
 NTSTATUS smbcli_session_setup(struct smbcli_state *cli, 
 			      struct cli_credentials *credentials,
-			      const char *workgroup)
+			      const char *workgroup,
+			      struct smbcli_session_options options)
 {
 	struct smb_composite_sesssetup setup;
 	NTSTATUS status;
 
-	cli->session = smbcli_session_init(cli->transport, cli, true);
+	cli->session = smbcli_session_init(cli->transport, cli, true,
+					   options);
 	if (!cli->session) return NT_STATUS_UNSUCCESSFUL;
 
 	setup.in.sesskey = cli->transport->negotiate.sesskey;
@@ -144,7 +146,8 @@ NTSTATUS smbcli_full_connection(TALLOC_CTX *parent_ctx,
 				struct cli_credentials *credentials,
 				struct resolve_context *resolve_ctx,
 				struct event_context *ev,
-				struct smbcli_options *options)
+				struct smbcli_options *options,
+				struct smbcli_session_options *session_options)
 {
 	struct smbcli_tree *tree;
 	NTSTATUS status;
@@ -155,7 +158,8 @@ NTSTATUS smbcli_full_connection(TALLOC_CTX *parent_ctx,
 					     &tree, host, ports, 
 					     sharename, devtype,
 					     credentials, resolve_ctx, ev,
-					     options);
+					     options,
+					     session_options);
 	if (!NT_STATUS_IS_OK(status)) {
 		goto done;
 	}
diff --git a/source4/libcli/raw/clisession.c b/source4/libcli/raw/clisession.c
index ad4ca7b..38d8f70 100644
--- a/source4/libcli/raw/clisession.c
+++ b/source4/libcli/raw/clisession.c
@@ -35,7 +35,8 @@
  Initialize the session context
 ****************************************************************************/
 struct smbcli_session *smbcli_session_init(struct smbcli_transport *transport, 
-					   TALLOC_CTX *parent_ctx, bool primary)
+					   TALLOC_CTX *parent_ctx, bool primary,
+					   struct smbcli_session_options options)
 {
 	struct smbcli_session *session;
 	uint16_t flags2;
@@ -53,9 +54,7 @@ struct smbcli_session *smbcli_session_init(struct smbcli_transport *transport,
 	}
 	session->pid = (uint16_t)getpid();
 	session->vuid = UID_FIELD_INVALID;
-	session->options.lanman_auth = lp_client_lanman_auth(global_loadparm);
-	session->options.ntlmv2_auth = lp_client_ntlmv2_auth(global_loadparm);
-	session->options.plaintext_auth = lp_client_plaintext_auth(global_loadparm);
+	session->options = options;
 	
 	capabilities = transport->negotiate.capabilities;
 
diff --git a/source4/libcli/raw/clitree.c b/source4/libcli/raw/clitree.c
index 15cd708..4b5d2dc 100644
--- a/source4/libcli/raw/clitree.c
+++ b/source4/libcli/raw/clitree.c
@@ -177,7 +177,8 @@ NTSTATUS smbcli_tree_full_connection(TALLOC_CTX *parent_ctx,
 				     struct cli_credentials *credentials,
 				     struct resolve_context *resolve_ctx,
 				     struct event_context *ev,
-				     struct smbcli_options *options)
+				     struct smbcli_options *options,
+				     struct smbcli_session_options *session_options)
 {
 	struct smb_composite_connect io;
 	NTSTATUS status;
@@ -200,6 +201,7 @@ NTSTATUS smbcli_tree_full_connection(TALLOC_CTX *parent_ctx,
 	 * is complete -- abartlet 2008-04-28 */
 	io.in.workgroup = lp_workgroup(global_loadparm);
 	io.in.options = *options;
+	io.in.session_options = *session_options;
 	
 	status = smb_composite_connect(&io, parent_ctx, resolve_ctx, ev);
 	if (NT_STATUS_IS_OK(status)) {
diff --git a/source4/libcli/smb_composite/connect.c b/source4/libcli/smb_composite/connect.c
index e56339f..a413729 100644
--- a/source4/libcli/smb_composite/connect.c
+++ b/source4/libcli/smb_composite/connect.c
@@ -234,7 +234,7 @@ static NTSTATUS connect_negprot(struct composite_context *c,
 	NT_STATUS_NOT_OK_RETURN(status);
 
 	/* next step is a session setup */
-	state->session = smbcli_session_init(state->transport, state, true);
+	state->session = smbcli_session_init(state->transport, state, true, io->in.session_options);
 	NT_STATUS_HAVE_NO_MEMORY(state->session);
 	
 	/* setup for a tconx (or at least have the structure ready to
diff --git a/source4/libcli/smb_composite/fetchfile.c b/source4/libcli/smb_composite/fetchfile.c
index 9cd02a5..ff4f0e7 100644
--- a/source4/libcli/smb_composite/fetchfile.c
+++ b/source4/libcli/smb_composite/fetchfile.c
@@ -147,6 +147,7 @@ struct composite_context *smb_composite_fetchfile_send(struct smb_composite_fetc
 	state->connect->in.workgroup    = io->in.workgroup;
 
 	state->connect->in.options	= io->in.options;
+	state->connect->in.session_options = io->in.session_options;
 
 	state->creq = smb_composite_connect_send(state->connect, state, 
 						 io->in.resolve_ctx, event_ctx);
diff --git a/source4/libcli/smb_composite/fsinfo.c b/source4/libcli/smb_composite/fsinfo.c
index 270d71f..dc5327a 100644
--- a/source4/libcli/smb_composite/fsinfo.c
+++ b/source4/libcli/smb_composite/fsinfo.c
@@ -127,7 +127,8 @@ static void fsinfo_composite_handler(struct composite_context *creq)
   composite fsinfo call - connects to a tree and queries a file system information
 */
 struct composite_context *smb_composite_fsinfo_send(struct smbcli_tree *tree, 
-						    struct smb_composite_fsinfo *io)
+						    struct smb_composite_fsinfo *io,
+						    struct resolve_context *resolve_ctx)
 {
 	struct composite_context *c;
 	struct fsinfo_state *state;
@@ -154,13 +155,14 @@ struct composite_context *smb_composite_fsinfo_send(struct smbcli_tree *tree,
 	state->connect->in.workgroup    = io->in.workgroup;
 
 	state->connect->in.options = tree->session->transport->options;
+	state->connect->in.session_options = tree->session->options;
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list