summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authormaxim <maxim@FreeBSD.org>2006-12-03 19:04:26 +0000
committermaxim <maxim@FreeBSD.org>2006-12-03 19:04:26 +0000
commitb3ab8f2011574fefd4ad8097c011e62a3edc5111 (patch)
treec3a64cd63051c6cca965810f8be9828aad5b1506 /sys/fs
parentaf51ff22340d96d114f2e3775d320add25977611 (diff)
downloadFreeBSD-src-b3ab8f2011574fefd4ad8097c011e62a3edc5111.zip
FreeBSD-src-b3ab8f2011574fefd4ad8097c011e62a3edc5111.tar.gz
o Do not leave uninitialized birthtime: in MSDOSFSMNT_LONGNAME
set birthtime to FAT CTime (creation time) and in the other cases set birthtime to -1. o Set ctime to mtime instead of FAT CTime which has completely different meaning. PR: kern/106018 Submitted by: Oliver Fromme MFC after: 1 month
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/msdosfs/msdosfs_vnops.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/fs/msdosfs/msdosfs_vnops.c b/sys/fs/msdosfs/msdosfs_vnops.c
index ae17f89..57b0ec8 100644
--- a/sys/fs/msdosfs/msdosfs_vnops.c
+++ b/sys/fs/msdosfs/msdosfs_vnops.c
@@ -343,13 +343,15 @@ msdosfs_getattr(ap)
vap->va_rdev = 0;
vap->va_size = dep->de_FileSize;
fattime2timespec(dep->de_MDate, dep->de_MTime, 0, 0, &vap->va_mtime);
+ vap->va_ctime = vap->va_mtime;
if (pmp->pm_flags & MSDOSFSMNT_LONGNAME) {
fattime2timespec(dep->de_ADate, 0, 0, 0, &vap->va_atime);
fattime2timespec(dep->de_CDate, dep->de_CTime, dep->de_CHun,
- 0, &vap->va_ctime);
+ 0, &vap->va_birthtime);
} else {
vap->va_atime = vap->va_mtime;
- vap->va_ctime = vap->va_mtime;
+ vap->va_birthtime.tv_sec = -1;
+ vap->va_birthtime.tv_nsec = 0;
}
vap->va_flags = 0;
if ((dep->de_Attributes & ATTR_ARCHIVE) == 0)
OpenPOWER on IntegriCloud