Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F115871220
D49531.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D49531.diff
View Options
diff --git a/usr.sbin/makefs/makefs.8 b/usr.sbin/makefs/makefs.8
--- a/usr.sbin/makefs/makefs.8
+++ b/usr.sbin/makefs/makefs.8
@@ -259,9 +259,13 @@
.Pa pathname ,
where the timestamps are derived from that file, or an integer
value interpreted as the number of seconds from the Epoch.
-Note that timestamps specified in an
+Timestamps in a
.Xr mtree 5
-spec file, override the default timestamp.
+specfile (specified with
+.Fl F )
+are used even if a default timestamp is specified.
+However, the timestamps in an mtree manifest are ignored
+if a default timestamp is specified.
.It Fl t Ar fs-type
Create an
.Ar fs-type
diff --git a/usr.sbin/makefs/mtree.c b/usr.sbin/makefs/mtree.c
--- a/usr.sbin/makefs/mtree.c
+++ b/usr.sbin/makefs/mtree.c
@@ -633,6 +633,9 @@
}
/* Ignore. */
} else if (strcmp(keyword, "time") == 0) {
+ /* Ignore if a default timestamp is present. */
+ if (stampst.st_ino != 0)
+ break;
if (value == NULL) {
error = ENOATTR;
break;
@@ -722,7 +725,17 @@
return (error);
st->st_mode = (st->st_mode & ~S_IFMT) | node->type;
-
+ /* Store default timestamp, if present. */
+ if (stampst.st_ino != 0) {
+ st->st_atime = stampst.st_atime;
+ st->st_ctime = stampst.st_ctime;
+ st->st_mtime = stampst.st_mtime;
+#if HAVE_STRUCT_STAT_ST_MTIMENSEC
+ st->st_atimensec = stampst.st_atimensec;
+ st->st_mtimensec = stampst.st_mtimensec;
+ st->st_ctimensec = stampst.st_ctimensec;
+#endif
+ }
/* Nothing more to do for the global defaults. */
if (node->name == NULL)
return (0);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Apr 30, 8:07 PM (11 h, 54 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17864128
Default Alt Text
D49531.diff (1 KB)
Attached To
Mode
D49531: makefs: Honor -T timestamps when creating images from mtree manifests
Attached
Detach File
Event Timeline
Log In to Comment