summaryrefslogtreecommitdiffstats
path: root/src/VBox/Additions/linux/sharedfolders/utils.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:47:04 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:47:04 +0000
commit8b152439beb81c8da1bdb00c7870e2d9e8d49612 (patch)
treeea7e527f7531053d0bcc60ce1eea46e1c4b15757 /src/VBox/Additions/linux/sharedfolders/utils.c
parentAdding debian version 7.0.16-dfsg-8. (diff)
downloadvirtualbox-8b152439beb81c8da1bdb00c7870e2d9e8d49612.tar.xz
virtualbox-8b152439beb81c8da1bdb00c7870e2d9e8d49612.zip
Merging upstream version 7.0.18-dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/VBox/Additions/linux/sharedfolders/utils.c')
-rw-r--r--src/VBox/Additions/linux/sharedfolders/utils.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/src/VBox/Additions/linux/sharedfolders/utils.c b/src/VBox/Additions/linux/sharedfolders/utils.c
index 7c1fba95..0c57c08a 100644
--- a/src/VBox/Additions/linux/sharedfolders/utils.c
+++ b/src/VBox/Additions/linux/sharedfolders/utils.c
@@ -298,10 +298,21 @@ DECLINLINE(int) sf_file_mode_to_linux(uint32_t fVBoxMode, int fFixedMode, int fC
*/
static void vbsf_update_inode_timestamps(struct inode *pInode, PSHFLFSOBJINFO pObjInfo)
{
-#if RTLNX_VER_MIN(6,6,0)
- struct timespec64 ts;
- vbsf_time_to_linux(&ts, &pObjInfo->ChangeTime);
- inode_set_ctime_to_ts(pInode, ts);
+#if RTLNX_VER_MIN(6,7,0)
+ struct timespec64 tsAccessTime, tsChangeTime, ModificationTime;
+
+ vbsf_time_to_linux(&tsAccessTime, &pObjInfo->AccessTime);
+ vbsf_time_to_linux(&tsChangeTime, &pObjInfo->ChangeTime);
+ vbsf_time_to_linux(&ModificationTime, &pObjInfo->ModificationTime);
+
+ inode_set_atime_to_ts(pInode, tsAccessTime);
+ inode_set_ctime_to_ts(pInode, tsChangeTime);
+ inode_set_mtime_to_ts(pInode, ModificationTime);
+
+# elif RTLNX_VER_MIN(6,6,0)
+ vbsf_time_to_linux(&pInode->i_atime, &pObjInfo->AccessTime);
+ vbsf_time_to_linux(&pInode->__i_ctime, &pObjInfo->ChangeTime);
+ vbsf_time_to_linux(&pInode->i_mtime, &pObjInfo->ModificationTime);
#else
vbsf_time_to_linux(&pInode->i_atime, &pObjInfo->AccessTime);
vbsf_time_to_linux(&pInode->i_ctime, &pObjInfo->ChangeTime);
@@ -1047,10 +1058,11 @@ static int vbsf_make_path(const char *caller, struct vbsf_inode_info *sf_i,
if (fRoot)
RT_BCOPY_UNFORTIFIED(&tmp->String.utf8[0], d_name, d_len + 1);
else {
- RT_BCOPY_UNFORTIFIED(&tmp->String.utf8[0], p_name, p_len);
- tmp->String.utf8[p_len] = '/';
- RT_BCOPY_UNFORTIFIED(&tmp->String.utf8[p_len + 1], d_name, d_len);
- tmp->String.utf8[p_len + 1 + d_len] = '\0';
+ uint8_t *pszPath = tmp->String.utf8;
+ RT_BCOPY_UNFORTIFIED(&pszPath[0], p_name, p_len);
+ pszPath[p_len] = '/';
+ RT_BCOPY_UNFORTIFIED(&pszPath[p_len + 1], d_name, d_len);
+ pszPath[p_len + 1 + d_len] = '\0';
}
*result = tmp;