From 006799ab801a80c519b0ea63bcff5e60837a681b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Wed, 23 Jan 2019 17:38:10 +0100 Subject: [PATCH] Fixed an endianness error in ntfscp The file timestamp was not set according to CPU endianness. --- ntfsprogs/ntfscp.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ntfsprogs/ntfscp.c b/ntfsprogs/ntfscp.c index 726e6471..f30be5a7 100644 --- a/ntfsprogs/ntfscp.c +++ b/ntfsprogs/ntfscp.c @@ -4,7 +4,7 @@ * Copyright (c) 2004-2007 Yura Pakhuchiy * Copyright (c) 2005 Anton Altaparmakov * Copyright (c) 2006 Hil Liao - * Copyright (c) 2014 Jean-Pierre Andre + * Copyright (c) 2014-2019 Jean-Pierre Andre * * This utility will copy file to an NTFS volume. * @@ -1153,8 +1153,9 @@ close_attr: ntfs_attr_close(na); if (opts.timestamp) { if (!fstat(fileno(in),&st)) { - out->last_data_change_time = st.st_mtime*10000000LL + s64 change_time = st.st_mtime*10000000LL + NTFS_TIME_OFFSET; + out->last_data_change_time = cpu_to_le64(change_time); ntfs_inode_update_times(out, 0); } else { ntfs_log_error("Failed to get the time stamp.\n");