OSDN Git Service

ntfs-3g.c: Fix raw usage of inode time fields without byteswapping.
authorErik Larsson <mechie@users.sourceforge.net>
Tue, 26 Jan 2016 06:55:45 +0000 (07:55 +0100)
committerErik Larsson <mechie@users.sourceforge.net>
Tue, 26 Jan 2016 06:55:45 +0000 (07:55 +0100)
src/ntfs-3g.c

index dc2d445..1e56de7 100644 (file)
@@ -568,7 +568,7 @@ static int ntfs_macfuse_getxtimes(const char *org_path,
        }
        
        /* We have no backup timestamp in NTFS. */
-       crtime->tv_sec = ni->creation_time;
+       crtime->tv_sec = sle64_to_cpu(ni->creation_time);
 exit:
        if (ntfs_inode_close(ni))
                set_fuse_error(&res);
@@ -590,7 +590,7 @@ int ntfs_macfuse_setcrtime(const char *path, const struct timespec *tv)
                return -errno;
        
        if (tv) {
-               ni->creation_time = tv->tv_sec;
+               ni->creation_time = cpu_to_sle64(tv->tv_sec);
                ntfs_fuse_update_times(ni, NTFS_UPDATE_CTIME);
        }
 
@@ -632,7 +632,7 @@ int ntfs_macfuse_setchgtime(const char *path, const struct timespec *tv)
                return -errno;
 
        if (tv) {
-               ni->last_mft_change_time = tv->tv_sec;
+               ni->last_mft_change_time = cpu_to_sle64(tv->tv_sec);
                ntfs_fuse_update_times(ni, 0);
        }