From ef8f8274492c142765a94cc453d3da640c9fef91 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 20 Feb 2004 23:19:39 +0000 Subject: [PATCH] Make SMB_FILE_ACCESS_INFORMATION call work correctly. Jeremy. (This used to be commit 0ea0ada6c609e1bb0fb4aace24e1beb7197495b5) --- source3/libsmb/clirap.c | 2 +- source3/smbd/trans2.c | 4 +++- source3/torture/torture.c | 15 +++++++++------ 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/source3/libsmb/clirap.c b/source3/libsmb/clirap.c index c4b08d21d81..9c10e9d938c 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 525b0153791..605169277da 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 d8bfe53dc3f..8c4d994b400 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)) { -- 2.34.1