summaryrefslogtreecommitdiff
path: root/source3/smbd/smb2_create.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2010-05-20 11:36:47 -0700
committerJeremy Allison <jra@samba.org>2010-05-20 11:36:47 -0700
commita8a4fe0605e6149efb5f9051181d794572edbf27 (patch)
tree15bcb3771d87fefcd91ae26fbf713c790cbf763e /source3/smbd/smb2_create.c
parenta7cab4ea36eb21d7b72efa80a77c702bb92bec62 (diff)
downloadsamba-a8a4fe0605e6149efb5f9051181d794572edbf27.tar.gz
samba-a8a4fe0605e6149efb5f9051181d794572edbf27.tar.bz2
samba-a8a4fe0605e6149efb5f9051181d794572edbf27.zip
Fix bug #7410 - samba sends "raw" inode number as uniqueid with unix extensions.
Move to a consistent get_FileIndex() function for all inode returns, that checks if st_dev on the file is identical to the top directory dev_t of the exported share, and if so uses the raw 64-bit inode number. If it isn't (we've traversed a mount point) - return what we used to do for Windows which is the concatination of the bottom 32-bits of the inode with the 32-bit device number. We can get more creative with this over time (hashing?) if we want as now all inode returns go through this single function. Jeremy.
Diffstat (limited to 'source3/smbd/smb2_create.c')
-rw-r--r--source3/smbd/smb2_create.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/source3/smbd/smb2_create.c b/source3/smbd/smb2_create.c
index 09bd827802..cc65df235c 100644
--- a/source3/smbd/smb2_create.c
+++ b/source3/smbd/smb2_create.c
@@ -741,13 +741,18 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
if (qfid) {
uint8_t p[32];
+ uint64_t file_index = get_FileIndex(result->conn,
+ &result->fsp_name->st);
DATA_BLOB blob = data_blob_const(p, sizeof(p));
ZERO_STRUCT(p);
- /* TODO: maybe use result->file_id */
- SIVAL(p, 0, result->fsp_name->st.st_ex_ino);/* FileIndexLow */
- SIVAL(p, 4, result->fsp_name->st.st_ex_dev);/* FileIndexHigh */
+ /* From conversations with Microsoft engineers at
+ the MS plugfest. The first 8 bytes are the "volume index"
+ == inode, the second 8 bytes are the "volume id",
+ == dev. This will be updated in the SMB2 doc. */
+ SBVAL(p, 0, file_index);
+ SIVAL(p, 8, result->fsp_name->st.st_ex_dev);/* FileIndexHigh */
status = smb2_create_blob_add(state, &out_context_blobs,
SMB2_CREATE_TAG_QFID,