summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2004-01-26 08:51:58 +0000
committerAndrew Bartlett <abartlet@samba.org>2004-01-26 08:51:58 +0000
commitf85a7bb04286fcab5e844b5457a4fc93da8d96f5 (patch)
tree4bfa03c14925d0bd822e664a1e63ff0ba6d2d4a0 /source3/utils
parent3e0ecb4561d2af5c61b053d4c0e386172f6a9751 (diff)
downloadsamba-f85a7bb04286fcab5e844b5457a4fc93da8d96f5.tar.gz
samba-f85a7bb04286fcab5e844b5457a4fc93da8d96f5.tar.bz2
samba-f85a7bb04286fcab5e844b5457a4fc93da8d96f5.zip
(merge from 3.0)
This adds client-side support for the unicode/SAMR password change scheme. As well as avoiding DOS charset issues, this scheme returns useful error codes, that we can map back via the pam interface. This patch also cleans up the interfaces used for password buffers, to avoid duplication of code. Andrew Bartlett (This used to be commit 8063b8b6c2eb30cb116988e265fb289109d7c348)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_rpc.c8
-rw-r--r--source3/utils/net_rpc_join.c9
2 files changed, 2 insertions, 15 deletions
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index eb5a9634c8..804faf3b9a 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -1849,15 +1849,9 @@ static NTSTATUS rpc_trustdom_add_internals(const DOM_SID *domain_sid, struct cli
{
SAM_USERINFO_CTR ctr;
SAM_USER_INFO_24 p24;
- fstring ucs2_trust_password;
- int ucs2_pw_len;
uchar pwbuf[516];
- ucs2_pw_len = push_ucs2(NULL, ucs2_trust_password, argv[1],
- sizeof(ucs2_trust_password), 0);
-
- encode_pw_buffer((char *)pwbuf, ucs2_trust_password,
- ucs2_pw_len);
+ encode_pw_buffer((char *)pwbuf, argv[1], STR_UNICODE);
ZERO_STRUCT(ctr);
ZERO_STRUCT(p24);
diff --git a/source3/utils/net_rpc_join.c b/source3/utils/net_rpc_join.c
index eb91a7df61..6bfeedc8a0 100644
--- a/source3/utils/net_rpc_join.c
+++ b/source3/utils/net_rpc_join.c
@@ -115,8 +115,6 @@ int net_rpc_join_newstyle(int argc, const char **argv)
/* Password stuff */
char *clear_trust_password = NULL;
- fstring ucs2_trust_password;
- int ucs2_pw_len;
uchar pwbuf[516];
SAM_USERINFO_CTR ctr;
SAM_USER_INFO_24 p24;
@@ -264,12 +262,7 @@ int net_rpc_join_newstyle(int argc, const char **argv)
E_md4hash(clear_trust_password, md4_trust_password);
}
- ucs2_pw_len = push_ucs2(NULL, ucs2_trust_password,
- clear_trust_password,
- sizeof(ucs2_trust_password), 0);
-
- encode_pw_buffer((char *)pwbuf, ucs2_trust_password,
- ucs2_pw_len);
+ encode_pw_buffer(pwbuf, clear_trust_password, STR_UNICODE);
/* Set password on machine account */