summaryrefslogtreecommitdiff
path: root/source4/libnet
diff options
context:
space:
mode:
Diffstat (limited to 'source4/libnet')
-rw-r--r--source4/libnet/config.mk8
-rw-r--r--source4/libnet/libnet_become_dc.c26
-rw-r--r--source4/libnet/libnet_join.c2
-rw-r--r--source4/libnet/libnet_samdump_keytab.c7
-rw-r--r--source4/libnet/libnet_samsync_ldb.c2
-rw-r--r--source4/libnet/libnet_site.c15
-rw-r--r--source4/libnet/libnet_unbecome_dc.c23
-rw-r--r--source4/libnet/libnet_user.c97
-rw-r--r--source4/libnet/libnet_user.h11
-rw-r--r--source4/libnet/libnet_vampire.c7
-rw-r--r--source4/libnet/py_net.c5
11 files changed, 139 insertions, 64 deletions
diff --git a/source4/libnet/config.mk b/source4/libnet/config.mk
index 243fc1813a..fac8af18b7 100644
--- a/source4/libnet/config.mk
+++ b/source4/libnet/config.mk
@@ -1,8 +1,7 @@
[SUBSYSTEM::LIBSAMBA-NET]
-PRIVATE_PROTO_HEADER = libnet_proto.h
PUBLIC_DEPENDENCIES = CREDENTIALS dcerpc dcerpc_samr RPC_NDR_LSA RPC_NDR_SRVSVC RPC_NDR_DRSUAPI LIBCLI_COMPOSITE LIBCLI_RESOLVE LIBCLI_FINDDCS LIBCLI_CLDAP LIBCLI_FINDDCS gensec_schannel LIBCLI_AUTH LIBNDR SMBPASSWD PROVISION
-LIBSAMBA-NET_OBJ_FILES = $(addprefix libnet/, \
+LIBSAMBA-NET_OBJ_FILES = $(addprefix $(libnetsrcdir)/, \
libnet.o libnet_passwd.o libnet_time.o libnet_rpc.o \
libnet_join.o libnet_site.o libnet_become_dc.o libnet_unbecome_dc.o \
libnet_vampire.o libnet_samdump.o libnet_samdump_keytab.o \
@@ -10,7 +9,10 @@ LIBSAMBA-NET_OBJ_FILES = $(addprefix libnet/, \
libnet_lookup.o libnet_domain.o userinfo.o groupinfo.o userman.o \
groupman.o prereq_domain.o libnet_samsync.o)
+$(eval $(call proto_header_template,$(libnetsrcdir)/libnet_proto.h,$(LIBSAMBA-NET_OBJ_FILES:.o=.c)))
+
[PYTHON::python_net]
+LIBRARY_REALNAME = samba/net.$(SHLIBEXT)
PRIVATE_DEPENDENCIES = LIBSAMBA-NET
-python_net_OBJ_FILES = libnet/py_net.o
+python_net_OBJ_FILES = $(libnetsrcdir)/py_net.o
diff --git a/source4/libnet/libnet_become_dc.c b/source4/libnet/libnet_become_dc.c
index c4f9cabb11..1c4c1d0732 100644
--- a/source4/libnet/libnet_become_dc.c
+++ b/source4/libnet/libnet_become_dc.c
@@ -30,6 +30,7 @@
#include "libcli/security/security.h"
#include "librpc/gen_ndr/ndr_misc.h"
#include "librpc/gen_ndr/ndr_security.h"
+#include "librpc/gen_ndr/ndr_nbt.h"
#include "librpc/gen_ndr/ndr_drsuapi.h"
#include "auth/gensec/gensec.h"
#include "param/param.h"
@@ -687,7 +688,7 @@ struct libnet_BecomeDC_state {
struct {
struct cldap_socket *sock;
struct cldap_netlogon io;
- struct nbt_cldap_netlogon_5 netlogon5;
+ struct NETLOGON_SAM_LOGON_RESPONSE_EX netlogon;
} cldap;
struct becomeDC_ldap {
@@ -745,7 +746,8 @@ static void becomeDC_send_cldap(struct libnet_BecomeDC_state *s)
s->cldap.io.in.domain_guid = NULL;
s->cldap.io.in.domain_sid = NULL;
s->cldap.io.in.acct_control = -1;
- s->cldap.io.in.version = 6;
+ s->cldap.io.in.version = NETLOGON_NT_VERSION_5 | NETLOGON_NT_VERSION_5EX;
+ s->cldap.io.in.map_response = true;
s->cldap.sock = cldap_socket_init(s, s->libnet->event_ctx,
lp_iconv_convenience(s->libnet->lp_ctx));
@@ -768,19 +770,19 @@ static void becomeDC_recv_cldap(struct cldap_request *req)
c->status = cldap_netlogon_recv(req, s, &s->cldap.io);
if (!composite_is_ok(c)) return;
- s->cldap.netlogon5 = s->cldap.io.out.netlogon.logon5;
+ s->cldap.netlogon = s->cldap.io.out.netlogon.nt5_ex;
- s->domain.dns_name = s->cldap.netlogon5.dns_domain;
- s->domain.netbios_name = s->cldap.netlogon5.domain;
- s->domain.guid = s->cldap.netlogon5.domain_uuid;
+ s->domain.dns_name = s->cldap.netlogon.dns_domain;
+ s->domain.netbios_name = s->cldap.netlogon.domain;
+ s->domain.guid = s->cldap.netlogon.domain_uuid;
- s->forest.dns_name = s->cldap.netlogon5.forest;
+ s->forest.dns_name = s->cldap.netlogon.forest;
- s->source_dsa.dns_name = s->cldap.netlogon5.pdc_dns_name;
- s->source_dsa.netbios_name = s->cldap.netlogon5.pdc_name;
- s->source_dsa.site_name = s->cldap.netlogon5.server_site;
+ s->source_dsa.dns_name = s->cldap.netlogon.pdc_dns_name;
+ s->source_dsa.netbios_name = s->cldap.netlogon.pdc_name;
+ s->source_dsa.site_name = s->cldap.netlogon.server_site;
- s->dest_dsa.site_name = s->cldap.netlogon5.client_site;
+ s->dest_dsa.site_name = s->cldap.netlogon.client_site;
becomeDC_connect_ldap1(s);
}
@@ -793,7 +795,7 @@ static NTSTATUS becomeDC_ldap_connect(struct libnet_BecomeDC_state *s,
url = talloc_asprintf(s, "ldap://%s/", s->source_dsa.dns_name);
NT_STATUS_HAVE_NO_MEMORY(url);
- ldap->ldb = ldb_wrap_connect(s, s->libnet->lp_ctx, url,
+ ldap->ldb = ldb_wrap_connect(s, s->libnet->event_ctx, s->libnet->lp_ctx, url,
NULL,
s->libnet->cred,
0, NULL);
diff --git a/source4/libnet/libnet_join.c b/source4/libnet/libnet_join.c
index 4549cd6e93..b5b28df81d 100644
--- a/source4/libnet/libnet_join.c
+++ b/source4/libnet/libnet_join.c
@@ -230,7 +230,7 @@ static NTSTATUS libnet_JoinADSDomain(struct libnet_context *ctx, struct libnet_J
return NT_STATUS_NO_MEMORY;
}
- remote_ldb = ldb_wrap_connect(tmp_ctx, ctx->lp_ctx,
+ remote_ldb = ldb_wrap_connect(tmp_ctx, ctx->event_ctx, ctx->lp_ctx,
remote_ldb_url,
NULL, ctx->cred, 0, NULL);
if (!remote_ldb) {
diff --git a/source4/libnet/libnet_samdump_keytab.c b/source4/libnet/libnet_samdump_keytab.c
index c25cb4d9c5..0c4d3e5c59 100644
--- a/source4/libnet/libnet_samdump_keytab.c
+++ b/source4/libnet/libnet_samdump_keytab.c
@@ -26,8 +26,10 @@
#include "auth/credentials/credentials.h"
#include "auth/credentials/credentials_krb5.h"
#include "param/param.h"
+#include "lib/events/events.h"
static NTSTATUS samdump_keytab_handle_user(TALLOC_CTX *mem_ctx,
+ struct event_context *event_ctx,
struct loadparm_context *lp_ctx,
const char *keytab_name,
struct netr_DELTA_ENUM *delta)
@@ -53,12 +55,12 @@ static NTSTATUS samdump_keytab_handle_user(TALLOC_CTX *mem_ctx,
* pass a value in here */
cli_credentials_set_kvno(credentials, 0);
cli_credentials_set_nt_hash(credentials, &user->ntpassword, CRED_SPECIFIED);
- ret = cli_credentials_set_keytab_name(credentials, lp_ctx, keytab_name, CRED_SPECIFIED);
+ ret = cli_credentials_set_keytab_name(credentials, event_ctx, lp_ctx, keytab_name, CRED_SPECIFIED);
if (ret) {
return NT_STATUS_UNSUCCESSFUL;
}
- ret = cli_credentials_update_keytab(credentials, lp_ctx);
+ ret = cli_credentials_update_keytab(credentials, event_ctx, lp_ctx);
if (ret) {
return NT_STATUS_UNSUCCESSFUL;
}
@@ -82,6 +84,7 @@ static NTSTATUS libnet_samdump_keytab_fn(TALLOC_CTX *mem_ctx,
/* not interested in builtin users */
if (database == SAM_DATABASE_DOMAIN) {
nt_status = samdump_keytab_handle_user(mem_ctx,
+ event_context_find(mem_ctx),
global_loadparm,
keytab_name,
delta);
diff --git a/source4/libnet/libnet_samsync_ldb.c b/source4/libnet/libnet_samsync_ldb.c
index a60b05189b..85e5dea2d7 100644
--- a/source4/libnet/libnet_samsync_ldb.c
+++ b/source4/libnet/libnet_samsync_ldb.c
@@ -1194,6 +1194,7 @@ static NTSTATUS libnet_samsync_ldb_init(TALLOC_CTX *mem_ctx,
ldap_url = talloc_asprintf(state, "ldap://%s", server);
state->remote_ldb = ldb_wrap_connect(mem_ctx,
+ state->samsync_state->machine_net_ctx->event_ctx,
state->samsync_state->machine_net_ctx->lp_ctx,
ldap_url,
NULL, state->samsync_state->machine_net_ctx->cred,
@@ -1222,6 +1223,7 @@ NTSTATUS libnet_samsync_ldb(struct libnet_context *ctx, TALLOC_CTX *mem_ctx, str
state->trusted_domains = NULL;
state->sam_ldb = ldb_wrap_connect(mem_ctx,
+ ctx->event_ctx,
ctx->lp_ctx,
lp_sam_url(ctx->lp_ctx),
r->in.session_info,
diff --git a/source4/libnet/libnet_site.c b/source4/libnet/libnet_site.c
index dabd23a5be..bb65de1f54 100644
--- a/source4/libnet/libnet_site.c
+++ b/source4/libnet/libnet_site.c
@@ -30,7 +30,7 @@
* 1. Setup a CLDAP socket.
* 2. Lookup the default Site-Name.
*/
-NTSTATUS libnet_FindSite(TALLOC_CTX *ctx, struct libnet_JoinSite *r)
+NTSTATUS libnet_FindSite(TALLOC_CTX *ctx, struct libnet_context *lctx, struct libnet_JoinSite *r)
{
NTSTATUS status;
TALLOC_CTX *tmp_ctx;
@@ -53,11 +53,12 @@ NTSTATUS libnet_FindSite(TALLOC_CTX *ctx, struct libnet_JoinSite *r)
search.in.dest_address = r->in.dest_address;
search.in.dest_port = r->in.cldap_port;
search.in.acct_control = -1;
- search.in.version = 6;
+ search.in.version = NETLOGON_NT_VERSION_5 | NETLOGON_NT_VERSION_5EX;
+ search.in.map_response = true;
- cldap = cldap_socket_init(tmp_ctx, NULL, lp_iconv_convenience(global_loadparm));
+ cldap = cldap_socket_init(tmp_ctx, lctx->event_ctx, lp_iconv_convenience(global_loadparm));
status = cldap_netlogon(cldap, tmp_ctx, &search);
- if (!NT_STATUS_IS_OK(status)) {
+ if (!NT_STATUS_IS_OK(status) || !search.out.netlogon.nt5_ex.client_site) {
/*
If cldap_netlogon() returns in error,
default to using Default-First-Site-Name.
@@ -71,7 +72,7 @@ NTSTATUS libnet_FindSite(TALLOC_CTX *ctx, struct libnet_JoinSite *r)
}
} else {
site_name_str = talloc_asprintf(tmp_ctx, "%s",
- search.out.netlogon.logon5.client_site);
+ search.out.netlogon.nt5_ex.client_site);
if (!site_name_str) {
r->out.error_string = NULL;
talloc_free(tmp_ctx);
@@ -148,7 +149,7 @@ NTSTATUS libnet_JoinSite(struct libnet_context *ctx,
}
make_nbt_name_client(&name, libnet_r->out.samr_binding->host);
- status = resolve_name(lp_resolve_context(ctx->lp_ctx), &name, r, &dest_addr, NULL);
+ status = resolve_name(lp_resolve_context(ctx->lp_ctx), &name, r, &dest_addr, ctx->event_ctx);
if (!NT_STATUS_IS_OK(status)) {
libnet_r->out.error_string = NULL;
talloc_free(tmp_ctx);
@@ -161,7 +162,7 @@ NTSTATUS libnet_JoinSite(struct libnet_context *ctx,
r->in.domain_dn_str = libnet_r->out.domain_dn_str;
r->in.cldap_port = lp_cldap_port(ctx->lp_ctx);
- status = libnet_FindSite(tmp_ctx, r);
+ status = libnet_FindSite(tmp_ctx, ctx, r);
if (!NT_STATUS_IS_OK(status)) {
libnet_r->out.error_string =
talloc_steal(libnet_r, r->out.error_string);
diff --git a/source4/libnet/libnet_unbecome_dc.c b/source4/libnet/libnet_unbecome_dc.c
index 5d346ac166..cff919018a 100644
--- a/source4/libnet/libnet_unbecome_dc.c
+++ b/source4/libnet/libnet_unbecome_dc.c
@@ -193,7 +193,7 @@ struct libnet_UnbecomeDC_state {
struct {
struct cldap_socket *sock;
struct cldap_netlogon io;
- struct nbt_cldap_netlogon_5 netlogon5;
+ struct NETLOGON_SAM_LOGON_RESPONSE_EX netlogon;
} cldap;
struct {
@@ -265,7 +265,8 @@ static void unbecomeDC_send_cldap(struct libnet_UnbecomeDC_state *s)
s->cldap.io.in.domain_guid = NULL;
s->cldap.io.in.domain_sid = NULL;
s->cldap.io.in.acct_control = -1;
- s->cldap.io.in.version = 6;
+ s->cldap.io.in.version = NETLOGON_NT_VERSION_5 | NETLOGON_NT_VERSION_5EX;
+ s->cldap.io.in.map_response = true;
s->cldap.sock = cldap_socket_init(s, s->libnet->event_ctx,
lp_iconv_convenience(s->libnet->lp_ctx));
@@ -288,17 +289,17 @@ static void unbecomeDC_recv_cldap(struct cldap_request *req)
c->status = cldap_netlogon_recv(req, s, &s->cldap.io);
if (!composite_is_ok(c)) return;
- s->cldap.netlogon5 = s->cldap.io.out.netlogon.logon5;
+ s->cldap.netlogon = s->cldap.io.out.netlogon.nt5_ex;
- s->domain.dns_name = s->cldap.netlogon5.dns_domain;
- s->domain.netbios_name = s->cldap.netlogon5.domain;
- s->domain.guid = s->cldap.netlogon5.domain_uuid;
+ s->domain.dns_name = s->cldap.netlogon.dns_domain;
+ s->domain.netbios_name = s->cldap.netlogon.domain;
+ s->domain.guid = s->cldap.netlogon.domain_uuid;
- s->source_dsa.dns_name = s->cldap.netlogon5.pdc_dns_name;
- s->source_dsa.netbios_name = s->cldap.netlogon5.pdc_name;
- s->source_dsa.site_name = s->cldap.netlogon5.server_site;
+ s->source_dsa.dns_name = s->cldap.netlogon.pdc_dns_name;
+ s->source_dsa.netbios_name = s->cldap.netlogon.pdc_name;
+ s->source_dsa.site_name = s->cldap.netlogon.server_site;
- s->dest_dsa.site_name = s->cldap.netlogon5.client_site;
+ s->dest_dsa.site_name = s->cldap.netlogon.client_site;
unbecomeDC_connect_ldap(s);
}
@@ -310,7 +311,7 @@ static NTSTATUS unbecomeDC_ldap_connect(struct libnet_UnbecomeDC_state *s)
url = talloc_asprintf(s, "ldap://%s/", s->source_dsa.dns_name);
NT_STATUS_HAVE_NO_MEMORY(url);
- s->ldap.ldb = ldb_wrap_connect(s, s->libnet->lp_ctx, url,
+ s->ldap.ldb = ldb_wrap_connect(s, s->libnet->event_ctx, s->libnet->lp_ctx, url,
NULL,
s->libnet->cred,
0, NULL);
diff --git a/source4/libnet/libnet_user.c b/source4/libnet/libnet_user.c
index 678c7a226e..dce7320c73 100644
--- a/source4/libnet/libnet_user.c
+++ b/source4/libnet/libnet_user.c
@@ -597,7 +597,9 @@ NTSTATUS libnet_ModifyUser(struct libnet_context *ctx, TALLOC_CTX *mem_ctx,
struct user_info_state {
struct libnet_context *ctx;
const char *domain_name;
+ enum libnet_UserInfo_level level;
const char *user_name;
+ const char *sid_string;
struct libnet_LookupName lookup;
struct libnet_DomainOpen domopen;
struct libnet_rpc_userinfo userinfo;
@@ -628,7 +630,7 @@ struct composite_context* libnet_UserInfo_send(struct libnet_context *ctx,
{
struct composite_context *c;
struct user_info_state *s;
- struct composite_context *lookup_req;
+ struct composite_context *lookup_req, *info_req;
bool prereq_met = false;
/* composite context allocation and setup */
@@ -644,23 +646,54 @@ struct composite_context* libnet_UserInfo_send(struct libnet_context *ctx,
s->monitor_fn = monitor;
s->ctx = ctx;
s->domain_name = talloc_strdup(c, r->in.domain_name);
- s->user_name = talloc_strdup(c, r->in.user_name);
+ s->level = r->in.level;
+ switch (s->level) {
+ case USER_INFO_BY_NAME:
+ s->user_name = talloc_strdup(c, r->in.data.user_name);
+ s->sid_string = NULL;
+ break;
+ case USER_INFO_BY_SID:
+ s->user_name = NULL;
+ s->sid_string = dom_sid_string(c, r->in.data.user_sid);
+ break;
+ }
/* prerequisite: make sure the domain is opened */
prereq_met = samr_domain_opened(ctx, s->domain_name, &c, &s->domopen,
continue_domain_open_info, monitor);
if (!prereq_met) return c;
- /* prepare arguments for LookupName call */
- s->lookup.in.domain_name = s->domain_name;
- s->lookup.in.name = s->user_name;
-
- /* send the request */
- lookup_req = libnet_LookupName_send(ctx, c, &s->lookup, s->monitor_fn);
- if (composite_nomem(lookup_req, c)) return c;
+ switch (s->level) {
+ case USER_INFO_BY_NAME:
+ /* prepare arguments for LookupName call */
+ s->lookup.in.domain_name = s->domain_name;
+ s->lookup.in.name = s->user_name;
+
+ /* send the request */
+ lookup_req = libnet_LookupName_send(ctx, c, &s->lookup,
+ s->monitor_fn);
+ if (composite_nomem(lookup_req, c)) return c;
+
+ /* set the next stage */
+ composite_continue(c, lookup_req, continue_name_found, c);
+ break;
+ case USER_INFO_BY_SID:
+ /* prepare arguments for UserInfo call */
+ s->userinfo.in.domain_handle = s->ctx->samr.handle;
+ s->userinfo.in.sid = s->sid_string;
+ s->userinfo.in.level = 21;
+
+ /* send the request */
+ info_req = libnet_rpc_userinfo_send(s->ctx->samr.pipe,
+ &s->userinfo,
+ s->monitor_fn);
+ if (composite_nomem(info_req, c)) return c;
+
+ /* set the next stage */
+ composite_continue(c, info_req, continue_info_received, c);
+ break;
+ }
- /* set the next stage */
- composite_continue(c, lookup_req, continue_name_found, c);
return c;
}
@@ -673,7 +706,7 @@ static void continue_domain_open_info(struct composite_context *ctx)
{
struct composite_context *c;
struct user_info_state *s;
- struct composite_context *lookup_req;
+ struct composite_context *lookup_req, *info_req;
struct monitor_msg msg;
c = talloc_get_type(ctx->async.private_data, struct composite_context);
@@ -686,16 +719,36 @@ static void continue_domain_open_info(struct composite_context *ctx)
/* send monitor message */
if (s->monitor_fn) s->monitor_fn(&msg);
- /* prepare arguments for LookupName call */
- s->lookup.in.domain_name = s->domain_name;
- s->lookup.in.name = s->user_name;
-
- /* send the request */
- lookup_req = libnet_LookupName_send(s->ctx, c, &s->lookup, s->monitor_fn);
- if (composite_nomem(lookup_req, c)) return;
-
- /* set the next stage */
- composite_continue(c, lookup_req, continue_name_found, c);
+ switch (s->level) {
+ case USER_INFO_BY_NAME:
+ /* prepare arguments for LookupName call */
+ s->lookup.in.domain_name = s->domain_name;
+ s->lookup.in.name = s->user_name;
+
+ /* send the request */
+ lookup_req = libnet_LookupName_send(s->ctx, c, &s->lookup, s->monitor_fn);
+ if (composite_nomem(lookup_req, c)) return;
+
+ /* set the next stage */
+ composite_continue(c, lookup_req, continue_name_found, c);
+ break;
+
+ case USER_INFO_BY_SID:
+ /* prepare arguments for UserInfo call */
+ s->userinfo.in.domain_handle = s->ctx->samr.handle;
+ s->userinfo.in.sid = s->sid_string;
+ s->userinfo.in.level = 21;
+
+ /* send the request */
+ info_req = libnet_rpc_userinfo_send(s->ctx->samr.pipe,
+ &s->userinfo,
+ s->monitor_fn);
+ if (composite_nomem(info_req, c)) return;
+
+ /* set the next stage */
+ composite_continue(c, info_req, continue_info_received, c);
+ break;
+ }
}
diff --git a/source4/libnet/libnet_user.h b/source4/libnet/libnet_user.h
index 94aa38464f..7095160004 100644
--- a/source4/libnet/libnet_user.h
+++ b/source4/libnet/libnet_user.h
@@ -99,11 +99,19 @@ struct libnet_ModifyUser {
} \
}
+enum libnet_UserInfo_level {
+ USER_INFO_BY_NAME=0,
+ USER_INFO_BY_SID
+};
struct libnet_UserInfo {
struct {
- const char *user_name;
const char *domain_name;
+ enum libnet_UserInfo_level level;
+ union {
+ const char *user_name;
+ const struct dom_sid *user_sid;
+ } data;
} in;
struct {
struct dom_sid *user_sid;
@@ -123,7 +131,6 @@ struct libnet_UserInfo {
struct timeval *last_logoff;
struct timeval *last_password_change;
uint32_t acct_flags;
-
const char *error_string;
} out;
};
diff --git a/source4/libnet/libnet_vampire.c b/source4/libnet/libnet_vampire.c
index 1cc63a3fb0..56a8ebe034 100644
--- a/source4/libnet/libnet_vampire.c
+++ b/source4/libnet/libnet_vampire.c
@@ -70,6 +70,7 @@ struct vampire_state {
const char *targetdir;
struct loadparm_context *lp_ctx;
+ struct event_context *event_ctx;
};
static NTSTATUS vampire_prepare_db(void *private_data,
@@ -335,7 +336,7 @@ static NTSTATUS vampire_apply_schema(struct vampire_state *s,
s->schema = NULL;
DEBUG(0,("Reopen the SAM LDB with system credentials and a already stored schema\n"));
- s->ldb = samdb_connect(s, s->lp_ctx,
+ s->ldb = samdb_connect(s, s->event_ctx, s->lp_ctx,
system_session(s, s->lp_ctx));
if (!s->ldb) {
DEBUG(0,("Failed to reopen sam.ldb\n"));
@@ -569,7 +570,6 @@ NTSTATUS libnet_Vampire(struct libnet_context *ctx, TALLOC_CTX *mem_ctx,
struct libnet_JoinDomain *join;
struct libnet_set_join_secrets *set_secrets;
struct libnet_BecomeDC b;
- struct libnet_UnbecomeDC u;
struct vampire_state *s;
struct ldb_message *msg;
int ldb_ret;
@@ -581,12 +581,13 @@ NTSTATUS libnet_Vampire(struct libnet_context *ctx, TALLOC_CTX *mem_ctx,
r->out.error_string = NULL;
- s = talloc_zero(mem_ctx , struct vampire_state);
+ s = talloc_zero(mem_ctx, struct vampire_state);
if (!s) {
return NT_STATUS_NO_MEMORY;
}
s->lp_ctx = ctx->lp_ctx;
+ s->event_ctx = ctx->event_ctx;
join = talloc_zero(s, struct libnet_JoinDomain);
if (!join) {
diff --git a/source4/libnet/py_net.c b/source4/libnet/py_net.c
index cf81d8070d..443da299c7 100644
--- a/source4/libnet/py_net.c
+++ b/source4/libnet/py_net.c
@@ -71,8 +71,11 @@ static PyObject *py_net_join(PyObject *cls, PyObject *args, PyObject *kwargs)
return result;
}
+static char py_net_join_doc[] = "join(domain_name, netbios_name, join_type, level) -> (join_password, domain_sid, domain_name)\n\n" \
+"Join the domain with the specified name.";
+
static struct PyMethodDef net_methods[] = {
- {"Join", (PyCFunction)py_net_join, METH_VARARGS|METH_KEYWORDS},
+ {"Join", (PyCFunction)py_net_join, METH_VARARGS|METH_KEYWORDS, py_net_join_doc},
{NULL }
};