summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-07-12 16:37:49 +0200
committerStefan Metzmacher <metze@samba.org>2009-07-12 16:54:46 +0200
commitee690df294aab7a738bfec1976a2f015e918db1e (patch)
tree9883b9dcd4989023ee8d4a747bcaa2a4d5219311 /source3/smbd
parent8422e032339f624e6322a4a6a4938b1d84b347a0 (diff)
downloadsamba-ee690df294aab7a738bfec1976a2f015e918db1e.tar.gz
samba-ee690df294aab7a738bfec1976a2f015e918db1e.tar.bz2
samba-ee690df294aab7a738bfec1976a2f015e918db1e.zip
s3:smbd: split calculation and mashalling of file index and access_mask
metze
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/trans2.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index c9e7e4bbfb..757e5f5c8b 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -3910,6 +3910,8 @@ static NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn,
uint64_t file_size = 0;
uint64_t pos = 0;
uint64_t allocation_size = 0;
+ uint64_t file_index = 0;
+ uint32_t access_mask = 0;
sbuf = smb_fname->st;
@@ -4013,6 +4015,21 @@ static NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn,
pos = fsp->fh->position_information;
}
+ if (fsp) {
+ access_mask = fsp->access_mask;
+ } else {
+ /* GENERIC_EXECUTE mapping from Windows */
+ access_mask = 0x12019F;
+ }
+
+ /* This should be an index number - looks like
+ dev/ino to me :-)
+
+ I think this causes us to fail the IFSKIT
+ BasicFileInformationTest. -tpot */
+ file_index = ((sbuf.st_ex_ino) & UINT32_MAX); /* FileIndexLow */
+ file_index |= ((sbuf.st_ex_dev) & UINT32_MAX) << 32; /* FileIndexHigh */
+
switch (info_level) {
case SMB_INFO_STANDARD:
DEBUG(10,("smbd_do_qfilepathinfo: SMB_INFO_STANDARD\n"));
@@ -4218,26 +4235,15 @@ static NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn,
break;
}
case SMB_FILE_INTERNAL_INFORMATION:
- /* This should be an index number - looks like
- dev/ino to me :-)
-
- I think this causes us to fail the IFSKIT
- BasicFileInformationTest. -tpot */
DEBUG(10,("smbd_do_qfilepathinfo: SMB_FILE_INTERNAL_INFORMATION\n"));
- SIVAL(pdata,0,sbuf.st_ex_ino); /* FileIndexLow */
- SIVAL(pdata,4,sbuf.st_ex_dev); /* FileIndexHigh */
+ SBVAL(pdata, 0, file_index);
data_size = 8;
break;
case SMB_FILE_ACCESS_INFORMATION:
DEBUG(10,("smbd_do_qfilepathinfo: SMB_FILE_ACCESS_INFORMATION\n"));
- if (fsp) {
- SIVAL(pdata,0,fsp->access_mask);
- } else {
- /* GENERIC_EXECUTE mapping from Windows */
- SIVAL(pdata,0,0x12019F);
- }
+ SIVAL(pdata, 0, access_mask);
data_size = 4;
break;