git: a79601b07a9f - stable/13 - makefs: correct iso9660 Rock Ridge TF timestamps

From: Ed Maste <emaste_at_FreeBSD.org>
Date: Mon, 10 Apr 2023 13:38:08 UTC
The branch stable/13 has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=a79601b07a9ffacd4a69195f4a175c228d96ac06

commit a79601b07a9ffacd4a69195f4a175c228d96ac06
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2023-03-22 23:42:45 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2023-04-10 13:37:40 +0000

    makefs: correct iso9660 Rock Ridge TF timestamps
    
    The bit definitions for the TF_* timestamp bits (TF_MODIFY, etc.) were
    incorrect, and timestamps were written in the wrong order.
    
    See RRIP 4.1.6 Description of the "TF" System Use Entry for details.
    
    PR:             203531
    Reported by:    Thomas Schmitt <scdbackup@gmx.net>
    Reviewed by:    jrtc27, kevans
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D39221
    
    (cherry picked from commit c65c969bd5d4ae7c52dedafb3c39b7e933079d4a)
---
 usr.sbin/makefs/cd9660/iso9660_rrip.c |  4 ++--
 usr.sbin/makefs/cd9660/iso9660_rrip.h | 16 ++++++++--------
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/usr.sbin/makefs/cd9660/iso9660_rrip.c b/usr.sbin/makefs/cd9660/iso9660_rrip.c
index d4440a656bad..afe46c58747d 100644
--- a/usr.sbin/makefs/cd9660/iso9660_rrip.c
+++ b/usr.sbin/makefs/cd9660/iso9660_rrip.c
@@ -699,11 +699,11 @@ cd9660node_rrip_tf(struct ISO_SUSP_ATTRIBUTES *p, fsnode *_node)
 	 */
 
 	cd9660_time_915(p->attr.rr_entry.TF.timestamp,
-		_node->inode->st.st_atime);
+		_node->inode->st.st_mtime);
 	p->attr.rr_entry.TF.h.length[0] += 7;
 
 	cd9660_time_915(p->attr.rr_entry.TF.timestamp + 7,
-		_node->inode->st.st_mtime);
+		_node->inode->st.st_atime);
 	p->attr.rr_entry.TF.h.length[0] += 7;
 
 	cd9660_time_915(p->attr.rr_entry.TF.timestamp + 14,
diff --git a/usr.sbin/makefs/cd9660/iso9660_rrip.h b/usr.sbin/makefs/cd9660/iso9660_rrip.h
index 3e1a6cb0e7d8..ef35405c62e6 100644
--- a/usr.sbin/makefs/cd9660/iso9660_rrip.h
+++ b/usr.sbin/makefs/cd9660/iso9660_rrip.h
@@ -52,14 +52,14 @@
 
 #define	 PX_LENGTH	   0x2C
 #define	 PN_LENGTH	   0x14
-#define	 TF_CREATION	   0x00
-#define	 TF_MODIFY	   0x01
-#define	 TF_ACCESS	   0x02
-#define	 TF_ATTRIBUTES	   0x04
-#define	 TF_BACKUP	   0x08
-#define	 TF_EXPIRATION	   0x10
-#define	 TF_EFFECTIVE	   0x20
-#define	 TF_LONGFORM	   0x40
+#define	 TF_CREATION	   0x01
+#define	 TF_MODIFY	   0x02
+#define	 TF_ACCESS	   0x04
+#define	 TF_ATTRIBUTES	   0x08
+#define	 TF_BACKUP	   0x10
+#define	 TF_EXPIRATION	   0x20
+#define	 TF_EFFECTIVE	   0x40
+#define	 TF_LONG_FORM	   0x80
 #define  NM_CONTINUE	   0x80
 #define	 NM_CURRENT	   0x100
 #define	 NM_PARENT	   0x200