#include "secrets.h"
#include "rpc_client/init_lsa.h"
#include "rpc_client/cli_pipe.h"
-#include "krb5_env.h"
#include "../libcli/security/security.h"
#include "passdb.h"
#include "libsmb/libsmb.h"
DEBUG(0,("libnet_join_ok: failed to get schannel session "
"key from server %s for domain %s. Error was %s\n",
- cli->desthost, netbios_domain_name, nt_errstr(status)));
+ cli_state_remote_name(cli),
+ netbios_domain_name, nt_errstr(status)));
cli_shutdown(cli);
return status;
}
DEBUG(0,("libnet_join_ok: failed to open schannel session "
"on netlogon pipe to server %s for domain %s. "
"Error was %s\n",
- cli->desthost, netbios_domain_name, nt_errstr(status)));
+ cli_state_remote_name(cli),
+ netbios_domain_name, nt_errstr(status)));
return status;
}
return werr;
}
- lp_load(get_dyn_CONFIGFILE(),true,false,false,true);
+ lp_load_global(get_dyn_CONFIGFILE());
r->out.modified_config = true;
r->out.result = werr;
return werr;
}
- lp_load(get_dyn_CONFIGFILE(),true,false,false,true);
+ lp_load_global(get_dyn_CONFIGFILE());
r->out.modified_config = true;
r->out.result = werr;
if (NT_STATUS_EQUAL(status, NT_STATUS_PROTOCOL_UNREACHABLE)) {
DEBUG(10,("Unable to auto-add domain administrators to "
"BUILTIN\\Administrators during join because "
- "winbindd must be running."));
+ "winbindd must be running.\n"));
} else if (!NT_STATUS_IS_OK(status)) {
DEBUG(5, ("Failed to auto-add domain administrators to "
"BUILTIN\\Administrators during join: %s\n",
status = create_builtin_users(domain_sid);
if (NT_STATUS_EQUAL(status, NT_STATUS_PROTOCOL_UNREACHABLE)) {
DEBUG(10,("Unable to auto-add domain users to BUILTIN\\users "
- "during join because winbindd must be running."));
+ "during join because winbindd must be running.\n"));
} else if (!NT_STATUS_IS_OK(status)) {
DEBUG(5, ("Failed to auto-add domain administrators to "
"BUILTIN\\Administrators during join: %s\n",
static int libnet_destroy_JoinCtx(struct libnet_JoinCtx *r)
{
- const char *krb5_cc_env = NULL;
-
if (r->in.ads) {
ads_destroy(&r->in.ads);
}
- krb5_cc_env = getenv(KRB5_ENV_CCNAME);
- if (krb5_cc_env && strcasecmp_m(krb5_cc_env, "MEMORY:libnetjoin")) {
- unsetenv(KRB5_ENV_CCNAME);
- }
-
return 0;
}
static int libnet_destroy_UnjoinCtx(struct libnet_UnjoinCtx *r)
{
- const char *krb5_cc_env = NULL;
-
if (r->in.ads) {
ads_destroy(&r->in.ads);
}
- krb5_cc_env = getenv(KRB5_ENV_CCNAME);
- if (krb5_cc_env && strcasecmp_m(krb5_cc_env, "MEMORY:libnetjoin")) {
- unsetenv(KRB5_ENV_CCNAME);
- }
-
return 0;
}
struct libnet_JoinCtx **r)
{
struct libnet_JoinCtx *ctx;
- const char *krb5_cc_env = NULL;
ctx = talloc_zero(mem_ctx, struct libnet_JoinCtx);
if (!ctx) {
talloc_set_destructor(ctx, libnet_destroy_JoinCtx);
- ctx->in.machine_name = talloc_strdup(mem_ctx, global_myname());
+ ctx->in.machine_name = talloc_strdup(mem_ctx, lp_netbios_name());
W_ERROR_HAVE_NO_MEMORY(ctx->in.machine_name);
- krb5_cc_env = getenv(KRB5_ENV_CCNAME);
- if (!krb5_cc_env || (strlen(krb5_cc_env) == 0)) {
- krb5_cc_env = talloc_strdup(mem_ctx, "MEMORY:libnetjoin");
- W_ERROR_HAVE_NO_MEMORY(krb5_cc_env);
- setenv(KRB5_ENV_CCNAME, krb5_cc_env, 1);
- }
-
ctx->in.secure_channel_type = SEC_CHAN_WKSTA;
*r = ctx;
struct libnet_UnjoinCtx **r)
{
struct libnet_UnjoinCtx *ctx;
- const char *krb5_cc_env = NULL;
ctx = talloc_zero(mem_ctx, struct libnet_UnjoinCtx);
if (!ctx) {
talloc_set_destructor(ctx, libnet_destroy_UnjoinCtx);
- ctx->in.machine_name = talloc_strdup(mem_ctx, global_myname());
+ ctx->in.machine_name = talloc_strdup(mem_ctx, lp_netbios_name());
W_ERROR_HAVE_NO_MEMORY(ctx->in.machine_name);
- krb5_cc_env = getenv(KRB5_ENV_CCNAME);
- if (!krb5_cc_env || (strlen(krb5_cc_env) == 0)) {
- krb5_cc_env = talloc_strdup(mem_ctx, "MEMORY:libnetjoin");
- W_ERROR_HAVE_NO_MEMORY(krb5_cc_env);
- setenv(KRB5_ENV_CCNAME, krb5_cc_env, 1);
- }
-
*r = ctx;
return WERR_OK;
create_local_private_krb5_conf_for_domain(
r->out.dns_domain_name, r->out.netbios_domain_name,
- NULL, &cli->dest_ss, cli->desthost);
+ NULL, cli_state_remote_sockaddr(cli),
+ cli_state_remote_name(cli));
if (r->out.domain_is_ad && r->in.account_ou &&
!(r->in.join_flags & WKSSVC_JOIN_FLAGS_JOIN_UNSECURE)) {