git: 16056a0ac98b - stable/14 - cd9660: Adjust parsing of timestamps in the extended atttributes record
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 09 Oct 2026 00:20:36 UTC
The branch stable/14 has been updated by jhb:
URL: https://cgit.FreeBSD.org/src/commit/?id=16056a0ac98b1b94b47dce0c2e2fa1cc3ab9493c
commit 16056a0ac98b1b94b47dce0c2e2fa1cc3ab9493c
Author: John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2026-06-23 15:51:43 +0000
Commit: John Baldwin <jhb@FreeBSD.org>
CommitDate: 2026-10-08 18:23:53 +0000
cd9660: Adjust parsing of timestamps in the extended atttributes record
The extended attribute record includes four different timestamps: file
creation, file modification, file expiration, and file effective date.
Only the first two are meaningful for stat(2). The latter two (if
handled) would presumably affect if a file is visible for not.
Previously, the logic here was a bit contorted and made use of the
effective time. It also seemed to treat the creation time as a change
time timestamp.
Instead, simplify the logic such that the modification time is set to
either the modification time (if present), or the creation time. The
access and change times are then set to the modification time.
NB: This is not used if RockRidge extensions are present, and makefs
does not generate the extended attributes record.
Differential Revision: https://reviews.freebsd.org/D57748
(cherry picked from commit f6dd01b417dcf247904b4653063f5fb7f22a0878)
---
sys/fs/cd9660/cd9660_node.c | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/sys/fs/cd9660/cd9660_node.c b/sys/fs/cd9660/cd9660_node.c
index 0fbd9916a17a..0b2d2e820e03 100644
--- a/sys/fs/cd9660/cd9660_node.c
+++ b/sys/fs/cd9660/cd9660_node.c
@@ -180,12 +180,22 @@ cd9660_deftstamp(struct iso_directory_record *isodir, struct iso_node *inop,
if (ftype != ISO_FTYPE_HIGH_SIERRA
&& isonum_711(ap->version) == 1) {
- if (!cd9660_tstamp_conv17(ap->ftime,&inop->inode.iso_atime))
- cd9660_tstamp_conv17(ap->ctime,&inop->inode.iso_atime);
- if (!cd9660_tstamp_conv17(ap->ctime,&inop->inode.iso_ctime))
- inop->inode.iso_ctime = inop->inode.iso_atime;
- if (!cd9660_tstamp_conv17(ap->mtime,&inop->inode.iso_mtime))
- inop->inode.iso_mtime = inop->inode.iso_ctime;
+ /*
+ * The extended attributes include create
+ * (ctime), modify (mtime), expiration
+ * (xtime), and effective (ftime) timstamps.
+ * Only the first two are meaningful for struct
+ * stat.
+ */
+ struct timespec birthtime;
+
+ if (!cd9660_tstamp_conv17(ap->ctime, &birthtime))
+ memset(&birthtime, 0, sizeof(birthtime));
+ if (!cd9660_tstamp_conv17(ap->mtime,
+ &inop->inode.iso_mtime))
+ inop->inode.iso_mtime = birthtime;
+ inop->inode.iso_ctime = inop->inode.iso_mtime;
+ inop->inode.iso_atime = inop->inode.iso_mtime;
} else
ap = NULL;
}