diff options
author | Andrew Tridgell <tridge@samba.org> | 2004-04-19 05:48:03 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:51:19 -0500 |
commit | 8fce9e3c549bcf1433119333ddbbf0a3dc4af8d9 (patch) | |
tree | 47f7cbbc59bbd5f65d50e5d14321cd4f82c4d30c /source4/librpc | |
parent | 6de32ddc2dbfe0685f361ed1a0dc11dff8ca19e5 (diff) | |
download | samba-8fce9e3c549bcf1433119333ddbbf0a3dc4af8d9.tar.gz samba-8fce9e3c549bcf1433119333ddbbf0a3dc4af8d9.tar.bz2 samba-8fce9e3c549bcf1433119333ddbbf0a3dc4af8d9.zip |
r275: added IDL and test code for samr_QueryDisplayInfo3(),
samr_AddMultipleMembersToAlias(),
samr_RemoveMultipleMembersFromAlias(), samr_OemChangePasswordUser2(),
and samr_ChangePasswordUser2()
The password change functions don't actually work yet (but should
soon). At this stage I have just completed the IDL for them. Next step
is to get the hash verifiers right and the torture test should be able
to do password changes.
(This used to be commit 849d0d314a2add80f2b2be6b503fea05973f998e)
Diffstat (limited to 'source4/librpc')
-rw-r--r-- | source4/librpc/idl/idl_types.h | 6 | ||||
-rw-r--r-- | source4/librpc/idl/samr.idl | 49 | ||||
-rw-r--r-- | source4/librpc/ndr/ndr_basic.c | 20 |
3 files changed, 67 insertions, 8 deletions
diff --git a/source4/librpc/idl/idl_types.h b/source4/librpc/idl/idl_types.h index 434dfb8c64..7f1ba48bc8 100644 --- a/source4/librpc/idl/idl_types.h +++ b/source4/librpc/idl/idl_types.h @@ -44,6 +44,12 @@ */ #define ascstr3 [flag(STR_ASCII|STR_SIZE2)] string +/* + an ascii string prefixed with [size] [offset] [length], all 32 bits + not null terminated +*/ +#define ascstr_noterm [flag(STR_NOTERM|STR_ASCII|STR_SIZE4|STR_LEN4)] string + #define NDR_NOALIGN LIBNDR_FLAG_NOALIGN #define NDR_REMAINING LIBNDR_FLAG_REMAINING diff --git a/source4/librpc/idl/samr.idl b/source4/librpc/idl/samr.idl index 01bfc7ed7a..3639c21cd3 100644 --- a/source4/librpc/idl/samr.idl +++ b/source4/librpc/idl/samr.idl @@ -756,7 +756,7 @@ typedef struct { [value(strlen_m(r->name))] uint16 name_len; [value(strlen_m(r->name))] uint16 name_size; - ascstr *name; + ascstr_noterm *name; } samr_AsciiName; typedef struct { @@ -930,23 +930,60 @@ /************************/ /* Function 0x33 */ - NTSTATUS samr_QUERY_DISPINFO3(); + + /* + another duplicate. There must be a reason .... + */ + NTSTATUS samr_QueryDisplayInfo3( + [in,ref] policy_handle *handle, + [in] uint16 level, + [in] uint32 start_idx, + [in] uint32 max_entries, + [in] uint32 buf_size, + [out] uint32 total_size, + [out] uint32 returned_size, + [out,switch_is(level)] samr_DispInfo info + ); /************************/ /* Function 0x34 */ - NTSTATUS samr_ADD_MULTIPLE_MEMBERS_TO_ALIAS(); + NTSTATUS samr_AddMultipleMembersToAlias( + [in,ref] policy_handle *handle, + [in,ref] lsa_SidArray *sids + ); /************************/ /* Function 0x35 */ - NTSTATUS samr_REMOVE_MULTIPLE_MEMBERS_FROM_ALIAS(); + NTSTATUS samr_RemoveMultipleMembersFromAlias( + [in,ref] policy_handle *handle, + [in,ref] lsa_SidArray *sids + ); /************************/ /* Function 0x36 */ - NTSTATUS samr_OEM_CHANGE_PASSWORD_USER2(); + + typedef [flag(NDR_PAHEX)] struct { + uint8 data[516]; + } samr_CryptPassword; + + NTSTATUS samr_OemChangePasswordUser2( + [in] samr_AsciiName *server, + [in,ref] samr_AsciiName *account, + [in] samr_CryptPassword *password, + [in] samr_Hash *hash + ); /************************/ /* Function 0x37 */ - NTSTATUS samr_UNICODE_CHANGE_PASSWORD_USER2(); + NTSTATUS samr_ChangePasswordUser2( + [in] samr_Name *server, + [in,ref] samr_Name *account, + [in] samr_CryptPassword *nt_password, + [in] samr_Hash *nt_verifier, + [in] bool8 lm_change, + [in] samr_CryptPassword *lm_password, + [in] samr_Hash *lm_verifier + ); /************************/ /* Function 0x38 */ diff --git a/source4/librpc/ndr/ndr_basic.c b/source4/librpc/ndr/ndr_basic.c index 570f7719a4..33176ec9c0 100644 --- a/source4/librpc/ndr/ndr_basic.c +++ b/source4/librpc/ndr/ndr_basic.c @@ -419,6 +419,7 @@ NTSTATUS ndr_pull_string(struct ndr_pull *ndr, int ndr_flags, const char **s) break; case LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_LEN4|LIBNDR_FLAG_STR_SIZE4: + case LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_LEN4|LIBNDR_FLAG_STR_SIZE4|LIBNDR_FLAG_STR_NOTERM: NDR_CHECK(ndr_pull_uint32(ndr, &len1)); NDR_CHECK(ndr_pull_uint32(ndr, &ofs)); NDR_CHECK(ndr_pull_uint32(ndr, &len2)); @@ -550,6 +551,21 @@ NTSTATUS ndr_push_string(struct ndr_push *ndr, int ndr_flags, const char *s) ndr->offset += c_len + 1; break; + case LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_LEN4|LIBNDR_FLAG_STR_SIZE4|LIBNDR_FLAG_STR_NOTERM: + NDR_CHECK(ndr_push_uint32(ndr, c_len)); + NDR_CHECK(ndr_push_uint32(ndr, 0)); + NDR_CHECK(ndr_push_uint32(ndr, c_len)); + NDR_PUSH_NEED_BYTES(ndr, c_len); + ret = convert_string(CH_UNIX, CH_DOS, + s, s_len, + ndr->data+ndr->offset, c_len); + if (ret == -1) { + return ndr_push_error(ndr, NDR_ERR_CHARCNV, + "Bad character conversion"); + } + ndr->offset += c_len; + break; + case LIBNDR_FLAG_STR_ASCII|LIBNDR_FLAG_STR_LEN4: NDR_CHECK(ndr_push_uint32(ndr, 0)); NDR_CHECK(ndr_push_uint32(ndr, c_len+1)); @@ -733,8 +749,8 @@ void ndr_print_array_uint8(struct ndr_print *ndr, const char *name, { int i; - if (count <= 32 && (ndr->flags & LIBNDR_PRINT_ARRAY_HEX)) { - char s[65]; + if (count <= 600 && (ndr->flags & LIBNDR_PRINT_ARRAY_HEX)) { + char s[1202]; for (i=0;i<count;i++) { snprintf(&s[i*2], 3, "%02x", data[i]); } |