return key;
}
+static uint64_t vfswrap_fs_file_id(struct vfs_handle_struct *handle,
+ const SMB_STRUCT_STAT *psbuf)
+{
+ uint64_t file_id;
+
+ if (handle->conn->sconn->aapl_zero_file_id) {
+ return 0;
+ }
+
+ if (handle->conn->base_share_dev == psbuf->st_ex_dev) {
+ return (uint64_t)psbuf->st_ex_ino;
+ }
+
+ /* FileIDLow */
+ file_id = ((psbuf->st_ex_ino) & UINT32_MAX);
+
+ /* FileIDHigh */
+ file_id |= ((uint64_t)((psbuf->st_ex_dev) & UINT32_MAX)) << 32;
+
+ return file_id;
+}
+
static NTSTATUS vfswrap_streaminfo(vfs_handle_struct *handle,
struct files_struct *fsp,
const struct smb_filename *smb_fname,
.realpath_fn = vfswrap_realpath,
.chflags_fn = vfswrap_chflags,
.file_id_create_fn = vfswrap_file_id_create,
+ .fs_file_id_fn = vfswrap_fs_file_id,
.streaminfo_fn = vfswrap_streaminfo,
.get_real_filename_fn = vfswrap_get_real_filename,
.connectpath_fn = vfswrap_connectpath,
NTSTATUS check_access_fsp(const struct files_struct *fsp,
uint32_t access_mask);
uint64_t smb_roundup(connection_struct *conn, uint64_t val);
-uint64_t get_fs_file_id(connection_struct *conn, const SMB_STRUCT_STAT *psbuf);
void aapl_force_zero_file_id(struct smbd_server_connection *sconn);
bool samba_private_attr_name(const char *unix_ea_name);
NTSTATUS get_ea_value(TALLOC_CTX *mem_ctx, connection_struct *conn,
if (state->qfid != NULL) {
uint8_t p[32];
- uint64_t file_id = get_fs_file_id(state->result->conn,
- &state->result->fsp_name->st);
+ uint64_t file_id = SMB_VFS_FS_FILE_ID(
+ state->result->conn,
+ &state->result->fsp_name->st);
DATA_BLOB blob = data_blob_const(p, sizeof(p));
ZERO_STRUCT(p);
return val;
}
-/********************************************************************
- Create a 64 bit FileIndex. If the file is on the same device as
- the root of the share, just return the 64-bit inode. If it isn't,
- mangle as we used to do.
-********************************************************************/
-
-uint64_t get_fs_file_id(connection_struct *conn, const SMB_STRUCT_STAT *psbuf)
-{
- uint64_t file_id;
- if (conn->sconn->aapl_zero_file_id) {
- return 0;
- }
- if (conn->base_share_dev == psbuf->st_ex_dev) {
- return (uint64_t)psbuf->st_ex_ino;
- }
- file_id = ((psbuf->st_ex_ino) & UINT32_MAX); /* FileIDLow */
- file_id |= ((uint64_t)((psbuf->st_ex_dev) & UINT32_MAX)) << 32; /* FileIDHigh */
- return file_id;
-}
-
-
/********************************************************************
Globally (for this connection / multi-channel) disable file-ID
calculation. This is required to be global because it serves
}
}
- file_id = get_fs_file_id(conn, &smb_fname->st);
+ file_id = SMB_VFS_FS_FILE_ID(conn, &smb_fname->st);
mdate_ts = smb_fname->st.st_ex_mtime;
adate_ts = smb_fname->st.st_ex_atime;
I think this causes us to fail the IFSKIT
BasicFileInformationTest. -tpot */
- file_id = get_fs_file_id(conn, psbuf);
+ file_id = SMB_VFS_FS_FILE_ID(conn, psbuf);
*fixed_portion = 0;