diff options
author | Jeremy Allison <jra@samba.org> | 2004-02-20 23:19:36 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2004-02-20 23:19:36 +0000 |
commit | e1b5599cc7f138424bbcec87822e6f5d3672d286 (patch) | |
tree | 1f59b6638b5da9d1c178df98a6a6f26282dad3fc /source3 | |
parent | e5c79dd79eb86c4fa790cd919056ed0fca3c73c1 (diff) | |
download | samba-e1b5599cc7f138424bbcec87822e6f5d3672d286.tar.gz samba-e1b5599cc7f138424bbcec87822e6f5d3672d286.tar.bz2 samba-e1b5599cc7f138424bbcec87822e6f5d3672d286.zip |
Make SMB_FILE_ACCESS_INFORMATION call work correctly.
Jeremy.
(This used to be commit a6cb7af9bad1610e802fa5cddbf68fb887bc2974)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/include/tdbsam2_parse_info.h | 107 | ||||
-rw-r--r-- | source3/libsmb/clirap.c | 2 | ||||
-rw-r--r-- | source3/smbd/trans2.c | 4 | ||||
-rw-r--r-- | source3/torture/torture.c | 15 |
4 files changed, 13 insertions, 115 deletions
diff --git a/source3/include/tdbsam2_parse_info.h b/source3/include/tdbsam2_parse_info.h index abaa2b142a..35eeaeb2d2 100644 --- a/source3/include/tdbsam2_parse_info.h +++ b/source3/include/tdbsam2_parse_info.h @@ -1,109 +1,2 @@ /* This is an automatically generated file - DO NOT EDIT! */ -int gen_dump_struct_gums_user(TALLOC_CTX *mem_ctx, struct parse_string *, const char *, unsigned); -int gen_parse_struct_gums_user(TALLOC_CTX *mem_ctx, char *, const char *); -static const struct parse_struct pinfo_gums_user[] = { -{"group_sid", 1, sizeof(DOM_SID), offsetof(struct gums_user, group_sid), 0, NULL, 0, gen_dump_DOM_SID, gen_parse_DOM_SID}, -{"logon_time", 0, sizeof(NTTIME), offsetof(struct gums_user, logon_time), 0, NULL, 0, gen_dump_NTTIME, gen_parse_NTTIME}, -{"logoff_time", 0, sizeof(NTTIME), offsetof(struct gums_user, logoff_time), 0, NULL, 0, gen_dump_NTTIME, gen_parse_NTTIME}, -{"kickoff_time", 0, sizeof(NTTIME), offsetof(struct gums_user, kickoff_time), 0, NULL, 0, gen_dump_NTTIME, gen_parse_NTTIME}, -{"pass_last_set_time", 0, sizeof(NTTIME), offsetof(struct gums_user, pass_last_set_time), 0, NULL, 0, gen_dump_NTTIME, gen_parse_NTTIME}, -{"pass_can_change_time", 0, sizeof(NTTIME), offsetof(struct gums_user, pass_can_change_time), 0, NULL, 0, gen_dump_NTTIME, gen_parse_NTTIME}, -{"pass_must_change_time", 0, sizeof(NTTIME), offsetof(struct gums_user, pass_must_change_time), 0, NULL, 0, gen_dump_NTTIME, gen_parse_NTTIME}, -{"full_name", 1, sizeof(char), offsetof(struct gums_user, full_name), 0, NULL, FLAG_NULLTERM, gen_dump_char, gen_parse_char}, -{"home_dir", 1, sizeof(char), offsetof(struct gums_user, home_dir), 0, NULL, FLAG_NULLTERM, gen_dump_char, gen_parse_char}, -{"dir_drive", 1, sizeof(char), offsetof(struct gums_user, dir_drive), 0, NULL, FLAG_NULLTERM, gen_dump_char, gen_parse_char}, -{"logon_script", 1, sizeof(char), offsetof(struct gums_user, logon_script), 0, NULL, FLAG_NULLTERM, gen_dump_char, gen_parse_char}, -{"profile_path", 1, sizeof(char), offsetof(struct gums_user, profile_path), 0, NULL, FLAG_NULLTERM, gen_dump_char, gen_parse_char}, -{"workstations", 1, sizeof(char), offsetof(struct gums_user, workstations), 0, NULL, FLAG_NULLTERM, gen_dump_char, gen_parse_char}, -{"unknown_str", 1, sizeof(char), offsetof(struct gums_user, unknown_str), 0, NULL, FLAG_NULLTERM, gen_dump_char, gen_parse_char}, -{"munged_dial", 1, sizeof(char), offsetof(struct gums_user, munged_dial), 0, NULL, FLAG_NULLTERM, gen_dump_char, gen_parse_char}, -{"lm_pw", 0, sizeof(DATA_BLOB), offsetof(struct gums_user, lm_pw), 0, NULL, 0, gen_dump_DATA_BLOB, gen_parse_DATA_BLOB}, -{"nt_pw", 0, sizeof(DATA_BLOB), offsetof(struct gums_user, nt_pw), 0, NULL, 0, gen_dump_DATA_BLOB, gen_parse_DATA_BLOB}, -{"acct_ctrl", 0, sizeof(uint16), offsetof(struct gums_user, acct_ctrl), 0, NULL, 0, gen_dump_uint16, gen_parse_uint16}, -{"logon_divs", 0, sizeof(uint16), offsetof(struct gums_user, logon_divs), 0, NULL, 0, gen_dump_uint16, gen_parse_uint16}, -{"hours_len", 0, sizeof(uint32), offsetof(struct gums_user, hours_len), 0, NULL, 0, gen_dump_uint32, gen_parse_uint32}, -{"hours", 1, sizeof(uint8), offsetof(struct gums_user, hours), 0, "hours_len", 0, gen_dump_uint8, gen_parse_uint8}, -{"bad_password_count", 0, sizeof(uint16), offsetof(struct gums_user, bad_password_count), 0, NULL, 0, gen_dump_uint16, gen_parse_uint16}, -{"logon_count", 0, sizeof(uint16), offsetof(struct gums_user, logon_count), 0, NULL, 0, gen_dump_uint16, gen_parse_uint16}, -{"unknown_3", 0, sizeof(uint32), offsetof(struct gums_user, unknown_3), 0, NULL, 0, gen_dump_uint32, gen_parse_uint32}, -{"unknown_6", 0, sizeof(uint32), offsetof(struct gums_user, unknown_6), 0, NULL, 0, gen_dump_uint32, gen_parse_uint32}, -{NULL, 0, 0, 0, 0, NULL, 0, NULL, NULL}}; - -int gen_dump_struct_gums_user(TALLOC_CTX *mem_ctx, struct parse_string *p, const char *ptr, unsigned indent) { - return gen_dump_struct(mem_ctx, pinfo_gums_user, p, ptr, indent); -} -int gen_parse_struct_gums_user(TALLOC_CTX *mem_ctx, char *ptr, const char *str) { - return gen_parse_struct(mem_ctx, pinfo_gums_user, ptr, str); -} - -int gen_dump_struct_gums_group(TALLOC_CTX *mem_ctx, struct parse_string *, const char *, unsigned); -int gen_parse_struct_gums_group(TALLOC_CTX *mem_ctx, char *, const char *); -static const struct parse_struct pinfo_gums_group[] = { -{"count", 0, sizeof(uint32), offsetof(struct gums_group, count), 0, NULL, 0, gen_dump_uint32, gen_parse_uint32}, -{"members", 1, sizeof(DOM_SID), offsetof(struct gums_group, members), 0, "count", 0, gen_dump_DOM_SID, gen_parse_DOM_SID}, -{NULL, 0, 0, 0, 0, NULL, 0, NULL, NULL}}; - -int gen_dump_struct_gums_group(TALLOC_CTX *mem_ctx, struct parse_string *p, const char *ptr, unsigned indent) { - return gen_dump_struct(mem_ctx, pinfo_gums_group, p, ptr, indent); -} -int gen_parse_struct_gums_group(TALLOC_CTX *mem_ctx, char *ptr, const char *str) { - return gen_parse_struct(mem_ctx, pinfo_gums_group, ptr, str); -} - -int gen_dump_struct_gums_domain(TALLOC_CTX *mem_ctx, struct parse_string *, const char *, unsigned); -int gen_parse_struct_gums_domain(TALLOC_CTX *mem_ctx, char *, const char *); -static const struct parse_struct pinfo_gums_domain[] = { -{"next_rid", 0, sizeof(uint32), offsetof(struct gums_domain, next_rid), 0, NULL, 0, gen_dump_uint32, gen_parse_uint32}, -{NULL, 0, 0, 0, 0, NULL, 0, NULL, NULL}}; - -int gen_dump_struct_gums_domain(TALLOC_CTX *mem_ctx, struct parse_string *p, const char *ptr, unsigned indent) { - return gen_dump_struct(mem_ctx, pinfo_gums_domain, p, ptr, indent); -} -int gen_parse_struct_gums_domain(TALLOC_CTX *mem_ctx, char *ptr, const char *str) { - return gen_parse_struct(mem_ctx, pinfo_gums_domain, ptr, str); -} - -int gen_dump_struct_gums_object(TALLOC_CTX *mem_ctx, struct parse_string *, const char *, unsigned); -int gen_parse_struct_gums_object(TALLOC_CTX *mem_ctx, char *, const char *); -static const struct parse_struct pinfo_gums_object[] = { -{"mem_ctx", 1, sizeof(TALLOC_CTX), offsetof(struct gums_object, mem_ctx), 0, NULL, 0, gen_dump_TALLOC_CTX, gen_parse_TALLOC_CTX}, -{"type", 0, sizeof(uint32), offsetof(struct gums_object, type), 0, NULL, 0, gen_dump_uint32, gen_parse_uint32}, -{"version", 0, sizeof(uint32), offsetof(struct gums_object, version), 0, NULL, 0, gen_dump_uint32, gen_parse_uint32}, -{"seq_num", 0, sizeof(uint32), offsetof(struct gums_object, seq_num), 0, NULL, 0, gen_dump_uint32, gen_parse_uint32}, -{"sec_desc", 1, sizeof(SEC_DESC), offsetof(struct gums_object, sec_desc), 0, NULL, 0, gen_dump_SEC_DESC, gen_parse_SEC_DESC}, -{"sid", 1, sizeof(DOM_SID), offsetof(struct gums_object, sid), 0, NULL, 0, gen_dump_DOM_SID, gen_parse_DOM_SID}, -{"name", 1, sizeof(char), offsetof(struct gums_object, name), 0, NULL, FLAG_NULLTERM, gen_dump_char, gen_parse_char}, -{"description", 1, sizeof(char), offsetof(struct gums_object, description), 0, NULL, FLAG_NULLTERM, gen_dump_char, gen_parse_char}, -{"user", 1, sizeof(struct gums_user), offsetof(struct gums_object, user), 0, NULL, 0, gen_dump_struct_gums_user, gen_parse_struct_gums_user}, -{"group", 1, sizeof(struct gums_group), offsetof(struct gums_object, group), 0, NULL, 0, gen_dump_struct_gums_group, gen_parse_struct_gums_group}, -{"domain", 1, sizeof(struct gums_domain), offsetof(struct gums_object, domain), 0, NULL, 0, gen_dump_struct_gums_domain, gen_parse_struct_gums_domain}, -{NULL, 0, 0, 0, 0, NULL, 0, NULL, NULL}}; - -int gen_dump_struct_gums_object(TALLOC_CTX *mem_ctx, struct parse_string *p, const char *ptr, unsigned indent) { - return gen_dump_struct(mem_ctx, pinfo_gums_object, p, ptr, indent); -} -int gen_parse_struct_gums_object(TALLOC_CTX *mem_ctx, char *ptr, const char *str) { - return gen_parse_struct(mem_ctx, pinfo_gums_object, ptr, str); -} - -int gen_dump_struct_gums_privilege(TALLOC_CTX *mem_ctx, struct parse_string *, const char *, unsigned); -int gen_parse_struct_gums_privilege(TALLOC_CTX *mem_ctx, char *, const char *); -static const struct parse_struct pinfo_gums_privilege[] = { -{"mem_ctx", 1, sizeof(TALLOC_CTX), offsetof(struct gums_privilege, mem_ctx), 0, NULL, 0, gen_dump_TALLOC_CTX, gen_parse_TALLOC_CTX}, -{"version", 0, sizeof(uint32), offsetof(struct gums_privilege, version), 0, NULL, 0, gen_dump_uint32, gen_parse_uint32}, -{"seq_num", 0, sizeof(uint32), offsetof(struct gums_privilege, seq_num), 0, NULL, 0, gen_dump_uint32, gen_parse_uint32}, -{"name", 1, sizeof(char), offsetof(struct gums_privilege, name), 0, NULL, FLAG_NULLTERM, gen_dump_char, gen_parse_char}, -{"description", 1, sizeof(char), offsetof(struct gums_privilege, description), 0, NULL, FLAG_NULLTERM, gen_dump_char, gen_parse_char}, -{"privilege", 1, sizeof(LUID_ATTR), offsetof(struct gums_privilege, privilege), 0, NULL, 0, gen_dump_LUID_ATTR, gen_parse_LUID_ATTR}, -{"count", 0, sizeof(uint32), offsetof(struct gums_privilege, count), 0, NULL, 0, gen_dump_uint32, gen_parse_uint32}, -{"members", 1, sizeof(DOM_SID), offsetof(struct gums_privilege, members), 0, "count", 0, gen_dump_DOM_SID, gen_parse_DOM_SID}, -{NULL, 0, 0, 0, 0, NULL, 0, NULL, NULL}}; - -int gen_dump_struct_gums_privilege(TALLOC_CTX *mem_ctx, struct parse_string *p, const char *ptr, unsigned indent) { - return gen_dump_struct(mem_ctx, pinfo_gums_privilege, p, ptr, indent); -} -int gen_parse_struct_gums_privilege(TALLOC_CTX *mem_ctx, char *ptr, const char *str) { - return gen_parse_struct(mem_ctx, pinfo_gums_privilege, ptr, str); -} - diff --git a/source3/libsmb/clirap.c b/source3/libsmb/clirap.c index 721d3dcb47..f8204e05d6 100644 --- a/source3/libsmb/clirap.c +++ b/source3/libsmb/clirap.c @@ -669,7 +669,7 @@ BOOL cli_qfileinfo_test(struct cli_state *cli, int fnum, int level, char **poutd return False; } - memdup(poutdata, data_len); + *poutdata = memdup(rdata, data_len); *poutlen = data_len; SAFE_FREE(rdata); diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c index 525b015379..605169277d 100644 --- a/source3/smbd/trans2.c +++ b/source3/smbd/trans2.c @@ -1841,6 +1841,7 @@ static int call_trans2qfilepathinfo(connection_struct *conn, int len; time_t c_time; files_struct *fsp = NULL; + uint32 desired_access = 0x12019F; /* Default - GENERIC_EXECUTE mapping from Windows */ if (!params) return ERROR_NT(NT_STATUS_INVALID_PARAMETER); @@ -1904,6 +1905,7 @@ static int call_trans2qfilepathinfo(connection_struct *conn, } pos = fsp->position_information; delete_pending = fsp->delete_on_close; + desired_access = fsp->desired_access; } } else { /* qpathinfo */ @@ -2152,7 +2154,7 @@ static int call_trans2qfilepathinfo(connection_struct *conn, break; case SMB_FILE_ACCESS_INFORMATION: - SIVAL(pdata,0,0x12019F); /* ??? */ + SIVAL(pdata,0,desired_access); data_size = 4; break; diff --git a/source3/torture/torture.c b/source3/torture/torture.c index e612ddea92..57ba24e63e 100644 --- a/source3/torture/torture.c +++ b/source3/torture/torture.c @@ -2822,12 +2822,15 @@ static BOOL run_deletetest(int dummy) goto fail; } -#if 0 - { - uint32 accinfo = 0; - cli_qfileinfo_test(cli1, fnum1, SMB_FILE_ACCESS_INFORMATION, (char *)&accinfo); - printf("access mode = 0x%lx\n", accinfo); - } +#if 0 /* JRATEST */ + { + uint32 *accinfo = NULL; + uint32 len; + cli_qfileinfo_test(cli1, fnum1, SMB_FILE_ACCESS_INFORMATION, (char **)&accinfo, &len); + if (accinfo) + printf("access mode = 0x%lx\n", *accinfo); + SAFE_FREE(accinfo); + } #endif if (!cli_close(cli1, fnum1)) { |