1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

s3:smbd: split calculation and mashalling of file index and access_mask

metze
This commit is contained in:
Stefan Metzmacher 2009-07-12 16:37:49 +02:00
parent 8422e03233
commit ee690df294

View File

@ -3910,6 +3910,8 @@ static NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn,
uint64_t file_size = 0; uint64_t file_size = 0;
uint64_t pos = 0; uint64_t pos = 0;
uint64_t allocation_size = 0; uint64_t allocation_size = 0;
uint64_t file_index = 0;
uint32_t access_mask = 0;
sbuf = smb_fname->st; sbuf = smb_fname->st;
@ -4013,6 +4015,21 @@ static NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn,
pos = fsp->fh->position_information; 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) { switch (info_level) {
case SMB_INFO_STANDARD: case SMB_INFO_STANDARD:
DEBUG(10,("smbd_do_qfilepathinfo: SMB_INFO_STANDARD\n")); DEBUG(10,("smbd_do_qfilepathinfo: SMB_INFO_STANDARD\n"));
@ -4218,26 +4235,15 @@ static NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn,
break; break;
} }
case SMB_FILE_INTERNAL_INFORMATION: 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")); DEBUG(10,("smbd_do_qfilepathinfo: SMB_FILE_INTERNAL_INFORMATION\n"));
SIVAL(pdata,0,sbuf.st_ex_ino); /* FileIndexLow */ SBVAL(pdata, 0, file_index);
SIVAL(pdata,4,sbuf.st_ex_dev); /* FileIndexHigh */
data_size = 8; data_size = 8;
break; break;
case SMB_FILE_ACCESS_INFORMATION: case SMB_FILE_ACCESS_INFORMATION:
DEBUG(10,("smbd_do_qfilepathinfo: SMB_FILE_ACCESS_INFORMATION\n")); DEBUG(10,("smbd_do_qfilepathinfo: SMB_FILE_ACCESS_INFORMATION\n"));
if (fsp) { SIVAL(pdata, 0, access_mask);
SIVAL(pdata,0,fsp->access_mask);
} else {
/* GENERIC_EXECUTE mapping from Windows */
SIVAL(pdata,0,0x12019F);
}
data_size = 4; data_size = 4;
break; break;