diff options
author | Luke Leighton <lkcl@samba.org> | 2000-01-03 00:41:53 +0000 |
---|---|---|
committer | Luke Leighton <lkcl@samba.org> | 2000-01-03 00:41:53 +0000 |
commit | 174299b8dd3072ee0b90ebb9a7fa92efcad69bb2 (patch) | |
tree | c18476c094cf054c97c363880827abc6b29e23ba /source/rpc_parse/parse_samr.c | |
parent | 9ef8fddaa6080e4942bc2268b89e61c3fb1ccd3d (diff) | |
download | samba-174299b8dd3072ee0b90ebb9a7fa92efcad69bb2.tar.gz |
removed dependency of smbd on the smb password database api.
the _only_ function smbd calls is pass_check(), and for some
_weird_ reason, that is in the passdb/ directory.
nasty debugging of an rpcclient incident. the "usr_creds"
need to be told what they are dealing with (ptr_ntc = 1, for
NT creds to be used). i forgot. wasted an hour.
Diffstat (limited to 'source/rpc_parse/parse_samr.c')
-rw-r--r-- | source/rpc_parse/parse_samr.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/source/rpc_parse/parse_samr.c b/source/rpc_parse/parse_samr.c index 84f73ede4be..49e6591f10c 100644 --- a/source/rpc_parse/parse_samr.c +++ b/source/rpc_parse/parse_samr.c @@ -6141,8 +6141,15 @@ make a SAMR_ENC_PASSWD structure. ********************************************************************/ BOOL make_enc_passwd(SAMR_ENC_PASSWD *pwd, const char pass[512]) { + ZERO_STRUCTP(pwd); + if (pwd == NULL) return False; + if (pass == NULL) + { + pwd->ptr = 0; + return True; + } pwd->ptr = 1; memcpy(pwd->pass, pass, sizeof(pwd->pass)); @@ -6162,7 +6169,10 @@ BOOL samr_io_enc_passwd(char *desc, SAMR_ENC_PASSWD *pwd, prs_struct *ps, int de prs_align(ps); prs_uint32("ptr", ps, depth, &(pwd->ptr)); - prs_uint8s(False, "pwd", ps, depth, pwd->pass, sizeof(pwd->pass)); + if (pwd->ptr != 0) + { + prs_uint8s(False, "pwd", ps, depth, pwd->pass, sizeof(pwd->pass)); + } return True; } @@ -6172,8 +6182,16 @@ makes a SAMR_ENC_HASH structure. ********************************************************************/ BOOL make_enc_hash(SAMR_ENC_HASH *hsh, const uchar hash[16]) { + ZERO_STRUCTP(hsh); + if (hsh == NULL) return False; + if (hash == NULL) + { + hsh->ptr = 0; + return True; + } + hsh->ptr = 1; memcpy(hsh->hash, hash, sizeof(hsh->hash)); @@ -6193,7 +6211,10 @@ BOOL samr_io_enc_hash(char *desc, SAMR_ENC_HASH *hsh, prs_struct *ps, int depth) prs_align(ps); prs_uint32("ptr ", ps, depth, &(hsh->ptr)); - prs_uint8s(False, "hash", ps, depth, hsh->hash, sizeof(hsh->hash)); + if (hsh->ptr != 0) + { + prs_uint8s(False, "hash", ps, depth, hsh->hash, sizeof(hsh->hash)); + } return True; } |