diff options
author | Stefan Metzmacher <metze@samba.org> | 2017-05-17 12:42:04 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2017-06-27 16:57:43 +0200 |
commit | 5958c6790fbceb39065353c07fe25f74ddf09ef0 (patch) | |
tree | 082181fa380b7e4c54aefcc399cae0e8b43261e0 /source3/libnet | |
parent | ec2da944d304852d76137e8f9d234462bc807c6b (diff) | |
download | samba-5958c6790fbceb39065353c07fe25f74ddf09ef0.tar.gz |
s3:libnet_join: remove dead code from libnet_join_connect_ads()
username[strlen(username)] is *always* '\0'!
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12782
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Diffstat (limited to 'source3/libnet')
-rw-r--r-- | source3/libnet/libnet_join.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/source3/libnet/libnet_join.c b/source3/libnet/libnet_join.c index 4d00ef65413..e33c3838866 100644 --- a/source3/libnet/libnet_join.c +++ b/source3/libnet/libnet_join.c @@ -195,16 +195,11 @@ static ADS_STATUS libnet_join_connect_ads(TALLOC_CTX *mem_ctx, r->in.machine_password == NULL) { return ADS_ERROR_NT(NT_STATUS_INVALID_PARAMETER); } - username = talloc_strdup(mem_ctx, r->in.machine_name); + username = talloc_asprintf(mem_ctx, "%s$", + r->in.machine_name); if (username == NULL) { return ADS_ERROR(LDAP_NO_MEMORY); } - if (username[strlen(username)] != '$') { - username = talloc_asprintf(username, "%s$", username); - if (username == NULL) { - return ADS_ERROR(LDAP_NO_MEMORY); - } - } password = r->in.machine_password; ccname = "MEMORY:libnet_join_machine_creds"; } else { |