s3-build: only include krb5 environment variables where required.
[ira/wip.git] / source3 / lib / netapi / netapi.c
index 889388173f005f04b92ee0c1d048c8a2ebc03081..c4c2556b0bb2908c91473de827093a1059a47050 100644 (file)
@@ -20,6 +20,8 @@
 #include "includes.h"
 #include "lib/netapi/netapi.h"
 #include "lib/netapi/netapi_private.h"
+#include "secrets.h"
+#include "krb5_env.h"
 
 extern bool AllowDebugChange;
 
@@ -89,7 +91,7 @@ NET_API_STATUS libnetapi_init(struct libnetapi_ctx **context)
 
        if (!lp_load(get_dyn_CONFIGFILE(), true, false, false, false)) {
                TALLOC_FREE(frame);
-               fprintf(stderr, "lp_load failed\n");
+               fprintf(stderr, "error loading %s\n", get_dyn_CONFIGFILE() );
                return W_ERROR_V(WERR_GENERAL_FAILURE);
        }
 
@@ -170,7 +172,6 @@ NET_API_STATUS libnetapi_free(struct libnetapi_ctx *ctx)
        gfree_charcnv();
        gfree_interfaces();
 
-       gencache_shutdown();
        secrets_shutdown();
 
        TALLOC_FREE(ctx);
@@ -251,6 +252,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;
+}
+
 /****************************************************************
 ****************************************************************/