struct connection_struct *conn,
struct files_struct **_fsp);
+NTSTATUS vfs_fget_dos_attributes(struct files_struct *fsp,
+ uint32_t *dosmode);
+
#include "source3/lib/interface.h"
/* The following definitions come from lib/ldap_debug_handler.c */
}
/* Get the DOS attributes via the VFS if we can */
- status = SMB_VFS_FGET_DOS_ATTRIBUTES(
- fsp->conn, metadata_fsp(fsp), &result);
+ status = vfs_fget_dos_attributes(fsp, &result);
if (!NT_STATUS_IS_OK(status)) {
/*
* Only fall back to using UNIX modes if we get NOT_IMPLEMENTED.
*/
uint32_t attr = 0;
- status = SMB_VFS_FGET_DOS_ATTRIBUTES(
- conn, metadata_fsp(smb_fname->fsp), &attr);
+ status = vfs_fget_dos_attributes(smb_fname->fsp, &attr);
if (NT_STATUS_IS_OK(status)) {
existing_dos_attributes = attr;
}
return NT_STATUS_OK;
}
+NTSTATUS vfs_fget_dos_attributes(struct files_struct *fsp,
+ uint32_t *dosmode)
+{
+ NTSTATUS status;
+
+ /*
+ * First make sure to pass the base_fsp to the VFS
+ */
+ status = SMB_VFS_FGET_DOS_ATTRIBUTES(
+ fsp->conn, metadata_fsp(fsp), dosmode);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
+
+ /*
+ * If this isn't a stream fsp we're done, ...
+ */
+ if (!fsp_is_alternate_stream(fsp)) {
+ return NT_STATUS_OK;
+ }
+
+ /*
+ * ...otherwise the VFS might have updated the btime, propagate the
+ * btime from the base_fsp to the stream fsp.
+ */
+
+ if (!(fsp->base_fsp->fsp_name->st.st_ex_iflags &
+ ST_EX_IFLAG_CALCULATED_BTIME))
+ {
+ update_stat_ex_create_time(
+ &fsp->fsp_name->st,
+ fsp->base_fsp->fsp_name->st.st_ex_btime);
+ }
+
+ if (!(fsp->base_fsp->fsp_name->st.st_ex_iflags &
+ ST_EX_IFLAG_CALCULATED_ITIME))
+ {
+ update_stat_ex_itime(
+ &fsp->fsp_name->st,
+ fsp->base_fsp->fsp_name->st.st_ex_itime);
+ }
+
+ if (!(fsp->base_fsp->fsp_name->st.st_ex_iflags &
+ ST_EX_IFLAG_CALCULATED_FILE_ID))
+ {
+ update_stat_ex_file_id(
+ &fsp->fsp_name->st,
+ fsp->base_fsp->fsp_name->st.st_ex_file_id);
+ }
+
+
+ return NT_STATUS_OK;
+}
+
int smb_vfs_call_connect(struct vfs_handle_struct *handle,
const char *service, const char *user)
{