CVS commit: src/usr.sbin/makefs/cd9660

2023-04-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr 18 23:02:51 UTC 2023

Modified Files:
src/usr.sbin/makefs/cd9660: iso9660_rrip.c

Log Message:
We previously attempted to emit Rock Ridge NM records only when the name
represented by the Rock Ridge extensions would actually differ. We would
omit the record for an all-upper-case directory name, however Linux (and
perhaps other operating systems) map names with no NM record to
lowercase.

This affected only directories, as file names have an implicit ";1"
version number appended and thus always differ.  To solve, just emit NM
records for all entries other than DOT and DOTDOT .

We could continue to omit the NM record for directories that would avoid
mapping (for example, one named 1234.567) but this does not seem worth
the complexity.

>From FreeBSD https://reviews.freebsd.org/D39258


To generate a diff of this commit:
cvs rdiff -u -r1.15 -r1.16 src/usr.sbin/makefs/cd9660/iso9660_rrip.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/makefs/cd9660

2023-04-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr 18 23:00:02 UTC 2023

Modified Files:
src/usr.sbin/makefs/cd9660: cd9660_eltorito.c

Log Message:
The boot catalog pointer is a DWord, but we previously populated it via
cd9660_bothendian_dword which overwrote four unused bytes following it.
See El Torito 1.0 (1995) Figure 7 for details.

Found by Coverity on FreeBSD


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/usr.sbin/makefs/cd9660/cd9660_eltorito.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/makefs/cd9660/cd9660_eltorito.c
diff -u src/usr.sbin/makefs/cd9660/cd9660_eltorito.c:1.25 src/usr.sbin/makefs/cd9660/cd9660_eltorito.c:1.26
--- src/usr.sbin/makefs/cd9660/cd9660_eltorito.c:1.25	Sat Apr  9 06:05:35 2022
+++ src/usr.sbin/makefs/cd9660/cd9660_eltorito.c	Tue Apr 18 19:00:02 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: cd9660_eltorito.c,v 1.25 2022/04/09 10:05:35 riastradh Exp $	*/
+/*	$NetBSD: cd9660_eltorito.c,v 1.26 2023/04/18 23:00:02 christos Exp $	*/
 
 /*
  * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan
@@ -40,7 +40,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: cd9660_eltorito.c,v 1.25 2022/04/09 10:05:35 riastradh Exp $");
+__RCSID("$NetBSD: cd9660_eltorito.c,v 1.26 2023/04/18 23:00:02 christos Exp $");
 #endif  /* !__lint */
 
 #ifdef DEBUG
@@ -377,8 +377,8 @@ cd9660_setup_boot(iso9660_disk *diskStru
 	/* Point to catalog: For now assume it consumes one sector */
 	ELTORITO_DPRINTF(("Boot catalog will go in sector %d\n", first_sector));
 	diskStructure->boot_catalog_sector = first_sector;
-	cd9660_bothendian_dword(first_sector,
-		diskStructure->boot_descriptor->boot_catalog_pointer);
+	cd9660_731(first_sector,
+	diskStructure->boot_descriptor->boot_catalog_pointer);
 
 	/*
 	 * Use system type of default image for validation entry. Fallback to



CVS commit: src/usr.sbin/makefs/cd9660

2023-04-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr 18 23:00:02 UTC 2023

Modified Files:
src/usr.sbin/makefs/cd9660: cd9660_eltorito.c

Log Message:
The boot catalog pointer is a DWord, but we previously populated it via
cd9660_bothendian_dword which overwrote four unused bytes following it.
See El Torito 1.0 (1995) Figure 7 for details.

Found by Coverity on FreeBSD


To generate a diff of this commit:
cvs rdiff -u -r1.25 -r1.26 src/usr.sbin/makefs/cd9660/cd9660_eltorito.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/makefs/cd9660

2023-04-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr 18 22:58:14 UTC 2023

Modified Files:
src/usr.sbin/makefs/cd9660: iso9660_rrip.h

Log Message:
See RRIP 4.1.4 Description of the "NM" System Use Entry for details.

>From FreeBSD


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/makefs/cd9660/iso9660_rrip.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/makefs/cd9660/iso9660_rrip.h
diff -u src/usr.sbin/makefs/cd9660/iso9660_rrip.h:1.7 src/usr.sbin/makefs/cd9660/iso9660_rrip.h:1.8
--- src/usr.sbin/makefs/cd9660/iso9660_rrip.h:1.7	Tue Apr 18 18:56:41 2023
+++ src/usr.sbin/makefs/cd9660/iso9660_rrip.h	Tue Apr 18 18:58:14 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: iso9660_rrip.h,v 1.7 2023/04/18 22:56:41 christos Exp $	*/
+/*	$NetBSD: iso9660_rrip.h,v 1.8 2023/04/18 22:58:14 christos Exp $	*/
 
 /*
  * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan
@@ -58,9 +58,9 @@
 #define	 TF_EFFECTIVE	   0x40
 #define	 TF_LONGFORM	   0x80
 
-#define	 NM_CONTINUE	   0x80
-#define	 NM_CURRENT	   0x100
-#define	 NM_PARENT	   0x200
+#define	 NM_CONTINUE	   0x01
+#define	 NM_CURRENT	   0x02
+#define	 NM_PARENT	   0x04
 
 
 #define	 SUSP_LOC_ENTRY	   0x01



CVS commit: src/usr.sbin/makefs/cd9660

2023-04-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr 18 22:58:14 UTC 2023

Modified Files:
src/usr.sbin/makefs/cd9660: iso9660_rrip.h

Log Message:
See RRIP 4.1.4 Description of the "NM" System Use Entry for details.

>From FreeBSD


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/usr.sbin/makefs/cd9660/iso9660_rrip.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/makefs/cd9660

2023-04-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr 18 22:56:41 UTC 2023

Modified Files:
src/usr.sbin/makefs/cd9660: iso9660_rrip.c iso9660_rrip.h

Log Message:
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.

From: https://reviews.freebsd.org/D39221


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/makefs/cd9660/iso9660_rrip.c
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/makefs/cd9660/iso9660_rrip.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.



CVS commit: src/usr.sbin/makefs/cd9660

2023-04-18 Thread Christos Zoulas
Module Name:src
Committed By:   christos
Date:   Tue Apr 18 22:56:41 UTC 2023

Modified Files:
src/usr.sbin/makefs/cd9660: iso9660_rrip.c iso9660_rrip.h

Log Message:
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.

From: https://reviews.freebsd.org/D39221


To generate a diff of this commit:
cvs rdiff -u -r1.14 -r1.15 src/usr.sbin/makefs/cd9660/iso9660_rrip.c
cvs rdiff -u -r1.6 -r1.7 src/usr.sbin/makefs/cd9660/iso9660_rrip.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.sbin/makefs/cd9660/iso9660_rrip.c
diff -u src/usr.sbin/makefs/cd9660/iso9660_rrip.c:1.14 src/usr.sbin/makefs/cd9660/iso9660_rrip.c:1.15
--- src/usr.sbin/makefs/cd9660/iso9660_rrip.c:1.14	Fri May 30 09:14:47 2014
+++ src/usr.sbin/makefs/cd9660/iso9660_rrip.c	Tue Apr 18 18:56:41 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: iso9660_rrip.c,v 1.14 2014/05/30 13:14:47 martin Exp $	*/
+/*	$NetBSD: iso9660_rrip.c,v 1.15 2023/04/18 22:56:41 christos Exp $	*/
 
 /*
  * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan
@@ -44,7 +44,7 @@
 
 #include 
 #if defined(__RCSID) && !defined(__lint)
-__RCSID("$NetBSD: iso9660_rrip.c,v 1.14 2014/05/30 13:14:47 martin Exp $");
+__RCSID("$NetBSD: iso9660_rrip.c,v 1.15 2023/04/18 22:56:41 christos Exp $");
 #endif  /* !__lint */
 
 static void cd9660_rrip_initialize_inode(cd9660node *);
@@ -697,11 +697,11 @@ cd9660node_rrip_tf(struct ISO_SUSP_ATTRI
 	 */
 
 	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,

Index: src/usr.sbin/makefs/cd9660/iso9660_rrip.h
diff -u src/usr.sbin/makefs/cd9660/iso9660_rrip.h:1.6 src/usr.sbin/makefs/cd9660/iso9660_rrip.h:1.7
--- src/usr.sbin/makefs/cd9660/iso9660_rrip.h:1.6	Mon Jan 28 16:03:28 2013
+++ src/usr.sbin/makefs/cd9660/iso9660_rrip.h	Tue Apr 18 18:56:41 2023
@@ -1,4 +1,4 @@
-/*	$NetBSD: iso9660_rrip.h,v 1.6 2013/01/28 21:03:28 christos Exp $	*/
+/*	$NetBSD: iso9660_rrip.h,v 1.7 2023/04/18 22:56:41 christos Exp $	*/
 
 /*
  * Copyright (c) 2005 Daniel Watt, Walter Deignan, Ryan Gabrys, Alan
@@ -48,15 +48,17 @@
 
 #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  NM_CONTINUE	   0x80
+
+#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_LONGFORM	   0x80
+
+#define	 NM_CONTINUE	   0x80
 #define	 NM_CURRENT	   0x100
 #define	 NM_PARENT	   0x200