summaryrefslogtreecommitdiff
path: root/source4/libnet
diff options
context:
space:
mode:
Diffstat (limited to 'source4/libnet')
-rw-r--r--source4/libnet/config.mk10
-rw-r--r--source4/libnet/libnet_become_dc.c3
-rw-r--r--source4/libnet/libnet_lookup.c3
-rw-r--r--source4/libnet/libnet_site.c2
-rw-r--r--source4/libnet/libnet_unbecome_dc.c3
-rw-r--r--source4/libnet/libnet_user.c2
-rw-r--r--source4/libnet/libnet_user.h8
7 files changed, 22 insertions, 9 deletions
diff --git a/source4/libnet/config.mk b/source4/libnet/config.mk
index a72ae5b51f..c35b7decc4 100644
--- a/source4/libnet/config.mk
+++ b/source4/libnet/config.mk
@@ -1,9 +1,5 @@
[SUBSYSTEM::LIBSAMBA-NET]
PRIVATE_PROTO_HEADER = libnet_proto.h
-PUBLIC_HEADERS = libnet.h libnet_join.h libnet_lookup.h libnet_passwd.h \
- libnet_rpc.h libnet_share.h libnet_time.h \
- libnet_user.h libnet_site.h libnet_vampire.h \
- userinfo.h userman.h
OBJ_FILES = \
libnet.o \
libnet_passwd.o \
@@ -29,6 +25,12 @@ OBJ_FILES = \
prereq_domain.o
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
+PUBLIC_HEADERS += $(addprefix libnet/, libnet.h libnet_join.h libnet_lookup.h libnet_passwd.h \
+ libnet_rpc.h libnet_share.h libnet_time.h \
+ libnet_user.h libnet_site.h libnet_vampire.h \
+ userinfo.h userman.h)
+
+
[PYTHON::swig_net]
PRIVATE_DEPENDENCIES = LIBSAMBA-NET
SWIG_FILE = net.i
diff --git a/source4/libnet/libnet_become_dc.c b/source4/libnet/libnet_become_dc.c
index c9185c749b..c4f9cabb11 100644
--- a/source4/libnet/libnet_become_dc.c
+++ b/source4/libnet/libnet_become_dc.c
@@ -747,7 +747,8 @@ static void becomeDC_send_cldap(struct libnet_BecomeDC_state *s)
s->cldap.io.in.acct_control = -1;
s->cldap.io.in.version = 6;
- s->cldap.sock = cldap_socket_init(s, s->libnet->event_ctx);
+ s->cldap.sock = cldap_socket_init(s, s->libnet->event_ctx,
+ lp_iconv_convenience(s->libnet->lp_ctx));
if (composite_nomem(s->cldap.sock, c)) return;
req = cldap_netlogon_send(s->cldap.sock, &s->cldap.io);
diff --git a/source4/libnet/libnet_lookup.c b/source4/libnet/libnet_lookup.c
index 409cc7575b..cab4d9e73f 100644
--- a/source4/libnet/libnet_lookup.c
+++ b/source4/libnet/libnet_lookup.c
@@ -197,7 +197,8 @@ struct composite_context* libnet_LookupDCs_send(struct libnet_context *ctx,
c = finddcs_send(mem_ctx, lp_netbios_name(ctx->lp_ctx), lp_nbt_port(ctx->lp_ctx),
io->in.domain_name, io->in.name_type,
- NULL, ctx->resolve_ctx, ctx->event_ctx, msg_ctx);
+ NULL, lp_iconv_convenience(ctx->lp_ctx),
+ ctx->resolve_ctx, ctx->event_ctx, msg_ctx);
return c;
}
diff --git a/source4/libnet/libnet_site.c b/source4/libnet/libnet_site.c
index 9db9494865..dabd23a5be 100644
--- a/source4/libnet/libnet_site.c
+++ b/source4/libnet/libnet_site.c
@@ -55,7 +55,7 @@ NTSTATUS libnet_FindSite(TALLOC_CTX *ctx, struct libnet_JoinSite *r)
search.in.acct_control = -1;
search.in.version = 6;
- cldap = cldap_socket_init(tmp_ctx, NULL);
+ cldap = cldap_socket_init(tmp_ctx, NULL, lp_iconv_convenience(global_loadparm));
status = cldap_netlogon(cldap, tmp_ctx, &search);
if (!NT_STATUS_IS_OK(status)) {
/*
diff --git a/source4/libnet/libnet_unbecome_dc.c b/source4/libnet/libnet_unbecome_dc.c
index 415912e34d..5d346ac166 100644
--- a/source4/libnet/libnet_unbecome_dc.c
+++ b/source4/libnet/libnet_unbecome_dc.c
@@ -267,7 +267,8 @@ static void unbecomeDC_send_cldap(struct libnet_UnbecomeDC_state *s)
s->cldap.io.in.acct_control = -1;
s->cldap.io.in.version = 6;
- s->cldap.sock = cldap_socket_init(s, s->libnet->event_ctx);
+ s->cldap.sock = cldap_socket_init(s, s->libnet->event_ctx,
+ lp_iconv_convenience(s->libnet->lp_ctx));
if (composite_nomem(s->cldap.sock, c)) return;
req = cldap_netlogon_send(s->cldap.sock, &s->cldap.io);
diff --git a/source4/libnet/libnet_user.c b/source4/libnet/libnet_user.c
index d5ccf34a57..678c7a226e 100644
--- a/source4/libnet/libnet_user.c
+++ b/source4/libnet/libnet_user.c
@@ -534,7 +534,7 @@ static NTSTATUS set_user_changes(TALLOC_CTX *mem_ctx, struct usermod_change *mod
SET_FIELD_NTTIME(r->in, user, mod, acct_expiry, USERMOD_FIELD_ACCT_EXPIRY);
/* account flags change */
- SET_FIELD_UINT32(r->in, user, mod, acct_flags, USERMOD_FIELD_ACCT_FLAGS);
+ SET_FIELD_ACCT_FLAGS(r->in, user, mod, acct_flags, USERMOD_FIELD_ACCT_FLAGS);
return NT_STATUS_OK;
}
diff --git a/source4/libnet/libnet_user.h b/source4/libnet/libnet_user.h
index ece06f08fc..94aa38464f 100644
--- a/source4/libnet/libnet_user.h
+++ b/source4/libnet/libnet_user.h
@@ -91,6 +91,14 @@ struct libnet_ModifyUser {
mod->fields |= flag; \
}
+#define SET_FIELD_ACCT_FLAGS(new, current, mod, field, flag) \
+ if (new.field) { \
+ if (current->field != new.field) { \
+ mod->field = new.field; \
+ mod->fields |= flag; \
+ } \
+ }
+
struct libnet_UserInfo {
struct {