s3: use generate_random_password() instead of generate_random_str()
[mat/samba.git] / source3 / libsmb / trusts_util.c
index be1f1f8971f5d5f42b1b31e053ea34ec66b417a9..0d039bc812e8eac127c53050e25176956d003e3d 100644 (file)
@@ -52,10 +52,11 @@ NTSTATUS trust_pw_change_and_store_it(struct rpc_pipe_client *cli, TALLOC_CTX *m
        }
 
        /* Create a random machine account password */
-       new_trust_passwd = generate_random_str(mem_ctx, DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH);
-
+       new_trust_passwd = generate_random_password(mem_ctx,
+                               DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH,
+                               DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH);
        if (new_trust_passwd == NULL) {
-               DEBUG(0, ("talloc_strdup failed\n"));
+               DEBUG(0, ("generate_random_password failed\n"));
                return NT_STATUS_NO_MEMORY;
        }