diff options
author | Stefan Metzmacher <metze@samba.org> | 2013-02-01 13:14:05 +0100 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2013-02-04 17:14:22 +0100 |
commit | 9292e5b74310632e1f0b4b2b76a9ef4ccae6874e (patch) | |
tree | 0d83eff5d57a9ceccecf64da2505d65ccf87ed6b /source3/utils | |
parent | c5d991e5102069ec712fe609c031a10ee8b0f389 (diff) | |
download | samba-9292e5b74310632e1f0b4b2b76a9ef4ccae6874e.tar.gz samba-9292e5b74310632e1f0b4b2b76a9ef4ccae6874e.tar.bz2 samba-9292e5b74310632e1f0b4b2b76a9ef4ccae6874e.zip |
s3: use generate_random_password() instead of generate_random_str()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/net_rpc_join.c | 4 | ||||
-rw-r--r-- | source3/utils/net_rpc_trust.c | 8 |
2 files changed, 7 insertions, 5 deletions
diff --git a/source3/utils/net_rpc_join.c b/source3/utils/net_rpc_join.c index ed81aacac7..7167cf9f3c 100644 --- a/source3/utils/net_rpc_join.c +++ b/source3/utils/net_rpc_join.c @@ -401,7 +401,9 @@ int net_rpc_join_newstyle(struct net_context *c, int argc, const char **argv) /* Create a random machine account password */ - clear_trust_password = generate_random_str(talloc_tos(), DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH); + clear_trust_password = generate_random_password(talloc_tos(), + DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH, + DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH); E_md4hash(clear_trust_password, md4_trust_password); /* Set password on machine account */ diff --git a/source3/utils/net_rpc_trust.c b/source3/utils/net_rpc_trust.c index d15d10c0d4..9060700be1 100644 --- a/source3/utils/net_rpc_trust.c +++ b/source3/utils/net_rpc_trust.c @@ -518,11 +518,11 @@ static int rpc_trust_common(struct net_context *net_ctx, int argc, } DEBUG(0, ("Using random trust password.\n")); - /* FIXME: why only 8 characters work? Would it be possible to use a - * random binary password? */ - trust_pw = generate_random_str(mem_ctx, 8); + trust_pw = generate_random_password(mem_ctx, + DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH, + DEFAULT_TRUST_ACCOUNT_PASSWORD_LENGTH); if (trust_pw == NULL) { - DEBUG(0, ("generate_random_str failed.\n")); + DEBUG(0, ("generate_random_password failed.\n")); goto done; } } else { |