net: now that "net rpc user" uses netapi calls exclusivly, net rpc shell needs
authorGünther Deschner <gd@samba.org>
Wed, 27 Aug 2008 11:54:49 +0000 (13:54 +0200)
committerGünther Deschner <gd@samba.org>
Fri, 29 Aug 2008 11:57:59 +0000 (13:57 +0200)
to use netapi as well.

Guenther
(This used to be commit 2f730649b73dcd11734d12921bfdad982fe75717)

source3/utils/net_rpc_shell.c

index c6051dc97685cbc2301e1774098f3c7e6d0f82e9..3aaed1ed1814f239f87984f1c93c7da4f828e293 100644 (file)
@@ -217,6 +217,15 @@ int net_rpc_shell(struct net_context *c, int argc, const char **argv)
                return -1;
        }
 
+       if (libnetapi_init(&c->netapi_ctx) != 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);
+       }
+
        ctx = TALLOC_P(NULL, struct rpc_sh_ctx);
        if (ctx == NULL) {
                d_fprintf(stderr, "talloc failed\n");