[SCM] Samba Shared Repository - branch v3-4-test updated - release-4-0-0alpha7-826-g0c5f19f

Günther Deschner gd at samba.org
Tue Apr 28 10:27:47 GMT 2009


The branch, v3-4-test has been updated
       via  0c5f19fbea7a6419a84ac0137a9a09995ef7a933 (commit)
      from  3bdb4342225444055b084908083e003e0e272e10 (commit)

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


- Log -----------------------------------------------------------------
commit 0c5f19fbea7a6419a84ac0137a9a09995ef7a933
Author: Günther Deschner <gd at samba.org>
Date:   Mon Apr 27 14:39:02 2009 +0200

    s3-net: make sure to call libnetapi init functions at the top of "net rpc" command.
    
    Without the initialization "net rpc password" will prompt twice for passwords
    and will not allow to define the name of the connection admin user.
    
    In the long run we should probably only have one place where to initialize
    libnetapi.
    
    Kai, please check.
    
    Guenther
    (cherry picked from commit 09ec85715b0e99740156ebb7213eddd1edfea631)

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

Summary of changes:
 source3/utils/net_rpc.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index d100189..d347bd8 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -7001,6 +7001,8 @@ int net_rpc_printer(struct net_context *c, int argc, const char **argv)
 
 int net_rpc(struct net_context *c, int argc, const char **argv)
 {
+	NET_API_STATUS status;
+
 	struct functable func[] = {
 		{
 			"audit",
@@ -7181,5 +7183,16 @@ int net_rpc(struct net_context *c, int argc, const char **argv)
 		},
 		{NULL, NULL, 0, NULL, NULL}
 	};
+
+	status = libnetapi_init(&c->netapi_ctx);
+	if (status != 0) {
+		return -1;
+	}
+	libnetapi_set_username(c->netapi_ctx, c->opt_user_name);
+	libnetapi_set_password(c->netapi_ctx, c->opt_password);
+	if (c->opt_kerberos) {
+		libnetapi_set_use_kerberos(c->netapi_ctx);
+	}
+
 	return net_run_function(c, argc, argv, "net rpc", func);
 }


-- 
Samba Shared Repository


More information about the samba-cvs mailing list