s3:libnet: let the caller truncate the pw in libnet_join_joindomain_rpc_unsecure()
authorStefan Metzmacher <metze@samba.org>
Thu, 13 Jun 2013 17:12:27 +0000 (19:12 +0200)
committerAndreas Schneider <asn@samba.org>
Mon, 5 Aug 2013 08:30:01 +0000 (10:30 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/libnet/libnet_join.c

index df3a86d092d7f7f596abbe8cdb366e5f2563ede7..26c037a67504e0950d71540c07bb7f27288dfb0b 100644 (file)
@@ -803,7 +803,6 @@ static NTSTATUS libnet_join_joindomain_rpc_unsecure(TALLOC_CTX *mem_ctx,
        struct rpc_pipe_client *pipe_hnd = NULL;
        unsigned char orig_trust_passwd_hash[16];
        unsigned char new_trust_passwd_hash[16];
-       fstring trust_passwd;
        NTSTATUS status;
 
        status = cli_rpc_pipe_open_noauth(cli, &ndr_table_netlogon,
@@ -822,19 +821,7 @@ static NTSTATUS libnet_join_joindomain_rpc_unsecure(TALLOC_CTX *mem_ctx,
        E_md4hash(r->in.machine_password, new_trust_passwd_hash);
 
        /* according to WKSSVC_JOIN_FLAGS_MACHINE_PWD_PASSED */
-       fstrcpy(trust_passwd, r->in.admin_password);
-       if (!strlower_m(trust_passwd)) {
-               return NT_STATUS_INVALID_PARAMETER;
-       }
-
-       /*
-        * Machine names can be 15 characters, but the max length on
-        * a password is 14.  --jerry
-        */
-
-       trust_passwd[14] = '\0';
-
-       E_md4hash(trust_passwd, orig_trust_passwd_hash);
+       E_md4hash(r->in.admin_password, orig_trust_passwd_hash);
 
        status = rpccli_netlogon_set_trust_password(pipe_hnd, mem_ctx,
                                                    r->in.machine_name,