diff options
author | Volker Lendecke <vlendec@samba.org> | 2004-12-15 13:13:15 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 10:53:38 -0500 |
commit | 4027c4088b0e5e4d6f87781a44f8703c62f24027 (patch) | |
tree | f4240ddce0ebf328b866fa23795c1b1f852f5c54 | |
parent | 786b6c5e284b0f9b01a7554e217e67ae777adf5a (diff) | |
download | samba-4027c4088b0e5e4d6f87781a44f8703c62f24027.tar.gz samba-4027c4088b0e5e4d6f87781a44f8703c62f24027.tar.bz2 samba-4027c4088b0e5e4d6f87781a44f8703c62f24027.zip |
r4219: Fix samba3 samr "idl"... According to samba4 idl samr_DomInfo2 contains a
comment string and not an unknown 12 byte structure...
Found after abartlet's smbtorture extended this string to
"Tortured by Samba4: Fri Nov 26 15:40:18 2004 CET"
;-))
Volker
(This used to be commit b41d94d8186f66136918432cf32e9dcef5a8bd12)
-rw-r--r-- | source3/include/rpc_samr.h | 5 | ||||
-rw-r--r-- | source3/rpc_parse/parse_samr.c | 23 | ||||
-rw-r--r-- | source3/rpc_server/srv_samr_nt.c | 2 |
3 files changed, 9 insertions, 21 deletions
diff --git a/source3/include/rpc_samr.h b/source3/include/rpc_samr.h index ae603c9cd9..c0c7e389e5 100644 --- a/source3/include/rpc_samr.h +++ b/source3/include/rpc_samr.h @@ -556,9 +556,7 @@ typedef struct sam_unknown_info_2_inf { uint32 unknown_0; /* 0x0000 0000 */ uint32 unknown_1; /* 0x8000 0000 */ - uint32 unknown_2; /* 0x0000 0000 */ - - uint32 ptr_0; /* pointer to unknown structure */ + UNIHDR hdr_comment; /* comment according to samba4 idl */ UNIHDR hdr_domain; /* domain name unicode header */ UNIHDR hdr_server; /* server name unicode header */ @@ -578,6 +576,7 @@ typedef struct sam_unknown_info_2_inf uint8 padding[12]; /* 12 bytes zeros */ + UNISTR2 uni_comment; /* comment unicode string */ UNISTR2 uni_domain; /* domain name unicode string */ UNISTR2 uni_server; /* server name unicode string */ diff --git a/source3/rpc_parse/parse_samr.c b/source3/rpc_parse/parse_samr.c index 34f48b9ad7..a674b89ab6 100644 --- a/source3/rpc_parse/parse_samr.c +++ b/source3/rpc_parse/parse_samr.c @@ -662,14 +662,11 @@ inits a structure. ********************************************************************/ void init_unk_info2(SAM_UNK_INFO_2 * u_2, - const char *domain, const char *server, + const char *comment, const char *domain, const char *server, uint32 seq_num, uint32 num_users, uint32 num_groups, uint32 num_alias) { u_2->unknown_0 = 0x00000000; u_2->unknown_1 = 0x80000000; - u_2->unknown_2 = 0x00000000; - - u_2->ptr_0 = 1; u_2->seq_num = seq_num; u_2->unknown_3 = 0x00000000; @@ -683,6 +680,8 @@ void init_unk_info2(SAM_UNK_INFO_2 * u_2, memset(u_2->padding, 0, sizeof(u_2->padding)); /* 12 bytes zeros */ + init_unistr2(&u_2->uni_comment, comment, UNI_FLAGS_NONE); + init_uni_hdr(&u_2->hdr_comment, &u_2->uni_comment); init_unistr2(&u_2->uni_domain, domain, UNI_FLAGS_NONE); init_uni_hdr(&u_2->hdr_domain, &u_2->uni_domain); init_unistr2(&u_2->uni_server, server, UNI_FLAGS_NONE); @@ -706,10 +705,7 @@ static BOOL sam_io_unk_info2(const char *desc, SAM_UNK_INFO_2 * u_2, return False; if(!prs_uint32("unknown_1", ps, depth, &u_2->unknown_1)) /* 0x8000 0000 */ return False; - if(!prs_uint32("unknown_2", ps, depth, &u_2->unknown_2)) /* 0x0000 0000 */ - return False; - - if(!prs_uint32("ptr_0", ps, depth, &u_2->ptr_0)) + if(!smb_io_unihdr("hdr_comment", &u_2->hdr_comment, ps, depth)) return False; if(!smb_io_unihdr("hdr_domain", &u_2->hdr_domain, ps, depth)) return False; @@ -738,15 +734,8 @@ static BOOL sam_io_unk_info2(const char *desc, SAM_UNK_INFO_2 * u_2, if(!prs_uint32("num_local_grps", ps, depth, &u_2->num_local_grps)) return False; - if (u_2->ptr_0) { - /* this was originally marked as 'padding'. It isn't - padding, it is some sort of optional 12 byte - structure. When it is present it contains zeros - !? */ - if(!prs_uint8s(False, "unknown", ps, depth, u_2->padding,sizeof(u_2->padding))) - return False; - } - + if(!smb_io_unistr2("uni_comment", &u_2->uni_comment, u_2->hdr_comment.buffer, ps, depth)) + return False; if(!smb_io_unistr2("uni_domain", &u_2->uni_domain, u_2->hdr_domain.buffer, ps, depth)) return False; if(!smb_io_unistr2("uni_server", &u_2->uni_server, u_2->hdr_server.buffer, ps, depth)) diff --git a/source3/rpc_server/srv_samr_nt.c b/source3/rpc_server/srv_samr_nt.c index 5f74df420a..b094a5f30b 100644 --- a/source3/rpc_server/srv_samr_nt.c +++ b/source3/rpc_server/srv_samr_nt.c @@ -2115,7 +2115,7 @@ NTSTATUS _samr_query_dom_info(pipes_struct *p, SAMR_Q_QUERY_DOMAIN_INFO *q_u, SA free_samr_db(info); /* The time call below is to get a sequence number for the sam. FIXME !!! JRA. */ - init_unk_info2(&ctr->info.inf2, lp_workgroup(), global_myname(), (uint32) time(NULL), + init_unk_info2(&ctr->info.inf2, "", lp_workgroup(), global_myname(), (uint32) time(NULL), num_users, num_groups, num_aliases); break; case 0x03: |