s3: add libnetapi_set_use_ccache()
authorVolker Lendecke <vl@samba.org>
Sun, 24 Jan 2010 17:50:31 +0000 (18:50 +0100)
committerVolker Lendecke <vl@samba.org>
Sun, 24 Jan 2010 19:32:17 +0000 (20:32 +0100)
source3/lib/netapi/cm.c
source3/lib/netapi/netapi.c
source3/lib/netapi/netapi.h

index 9baba7b82404ba364cd76b591e548a410f39c3dc..3a624bf7e8d453970cb2ea81d48b68670af5e5ae 100644 (file)
@@ -55,6 +55,10 @@ static WERROR libnetapi_open_ipc_connection(struct libnetapi_ctx *ctx,
                set_cmdline_auth_info_fallback_after_kerberos(auth_info, true);
        }
 
+       if (ctx->use_ccache) {
+               set_cmdline_auth_info_use_ccache(auth_info, true);
+       }
+
        cli_ipc = cli_cm_open(ctx, NULL,
                                server_name, "IPC$",
                                auth_info,
index e80879a1d26677094cea7607ac00ee55f953e5b6..bde6fd823fdd203acf403bc5f64324fb43993c7d 100644 (file)
@@ -250,6 +250,12 @@ NET_API_STATUS libnetapi_set_use_kerberos(struct libnetapi_ctx *ctx)
        return NET_API_STATUS_SUCCESS;
 }
 
+NET_API_STATUS libnetapi_set_use_ccache(struct libnetapi_ctx *ctx)
+{
+       ctx->use_ccache = true;
+       return NET_API_STATUS_SUCCESS;
+}
+
 /****************************************************************
 ****************************************************************/
 
index 96cf225d0c7a059bf361b493aa59a1edcbbdfcfe..8976ebd4ebddc74a13a0e1ea484dde610d14485f 100644 (file)
@@ -1318,6 +1318,7 @@ struct libnetapi_ctx {
        char *password;
        char *krb5_cc_env;
        int use_kerberos;
+       int use_ccache;
        int disable_policy_handle_cache;
 
        void *private_data;
@@ -1370,6 +1371,11 @@ NET_API_STATUS libnetapi_set_use_kerberos(struct libnetapi_ctx *ctx);
 /****************************************************************
 ****************************************************************/
 
+NET_API_STATUS libnetapi_set_use_ccache(struct libnetapi_ctx *ctx);
+
+/****************************************************************
+****************************************************************/
+
 const char *libnetapi_errstr(NET_API_STATUS status);
 
 /****************************************************************