diff options
author | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-12-03 20:09:31 +0100 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-12-03 20:09:31 +0100 |
commit | d14e0e8ff1e3f9144bf815daec9eb292879a97ca (patch) | |
tree | 5be9339c05844b868a8f1e59f4e922cee8a971b7 /source4/libnet | |
parent | 189b4bc1c27f0bfe08d86236ce20e281ff4215dd (diff) | |
download | samba-d14e0e8ff1e3f9144bf815daec9eb292879a97ca.tar.gz samba-d14e0e8ff1e3f9144bf815daec9eb292879a97ca.tar.bz2 samba-d14e0e8ff1e3f9144bf815daec9eb292879a97ca.zip |
s4:libnet_JoinADSDomain - move away from "samdb_msg_add_string"
These calls can be substituted by "ldb_msg_add_string" without any problems -
only the allocation contexts of the SPNs and the DNS hostnames have to adapted.
Diffstat (limited to 'source4/libnet')
-rw-r--r-- | source4/libnet/libnet_join.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source4/libnet/libnet_join.c b/source4/libnet/libnet_join.c index 6077de906b..1b485e7724 100644 --- a/source4/libnet/libnet_join.c +++ b/source4/libnet/libnet_join.c @@ -272,8 +272,8 @@ static NTSTATUS libnet_JoinADSDomain(struct libnet_context *ctx, struct libnet_J { unsigned int i; const char *service_principal_name[2]; - const char *dns_host_name = strlower_talloc(tmp_ctx, - talloc_asprintf(tmp_ctx, + const char *dns_host_name = strlower_talloc(msg, + talloc_asprintf(msg, "%s.%s", r->in.netbios_name, realm)); @@ -284,9 +284,9 @@ static NTSTATUS libnet_JoinADSDomain(struct libnet_context *ctx, struct libnet_J return NT_STATUS_NO_MEMORY; } - service_principal_name[0] = talloc_asprintf(tmp_ctx, "HOST/%s", + service_principal_name[0] = talloc_asprintf(msg, "HOST/%s", dns_host_name); - service_principal_name[1] = talloc_asprintf(tmp_ctx, "HOST/%s", + service_principal_name[1] = talloc_asprintf(msg, "HOST/%s", r->in.netbios_name); for (i=0; i < ARRAY_SIZE(service_principal_name); i++) { @@ -295,7 +295,8 @@ static NTSTATUS libnet_JoinADSDomain(struct libnet_context *ctx, struct libnet_J talloc_free(tmp_ctx); return NT_STATUS_NO_MEMORY; } - rtn = samdb_msg_add_string(remote_ldb, tmp_ctx, msg, "servicePrincipalName", service_principal_name[i]); + rtn = ldb_msg_add_string(msg, "servicePrincipalName", + service_principal_name[i]); if (rtn != LDB_SUCCESS) { r->out.error_string = NULL; talloc_free(tmp_ctx); @@ -303,8 +304,7 @@ static NTSTATUS libnet_JoinADSDomain(struct libnet_context *ctx, struct libnet_J } } - rtn = samdb_msg_add_string(remote_ldb, tmp_ctx, msg, - "dNSHostName", dns_host_name); + rtn = ldb_msg_add_string(msg, "dNSHostName", dns_host_name); if (rtn != LDB_SUCCESS) { r->out.error_string = NULL; talloc_free(tmp_ctx); |