Bug 99693

Summary: [patch] add magic(5)/file(1) support for FreeBSD 6.1 dump(8) format
Product: Base System Reporter: pri vate <nobody>
Component: binAssignee: Antoine Brodin <antoine>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Unspecified   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file-4.23-dump-ufs2.diff none

Description pri vate 2006-07-01 17:40:18 UTC
file(1) does not grok 6.1's new dump format (ufs2).

Fix: 

the fix is ugly because it does not support the 64 bit date stamps, but here it goes anyway:

+ 
+ ##############################################################################
+ 
+ 24    belong  0x19540119      new-fs dump file (ufs2, big endian),
+ >12   belong  >0              Volume %ld,
+ >692  belong  0               Level zero, type:
+ >692  belong  >0              Level %d, type:
+ >0    belong  1               tape header,
+ >0    belong  2               beginning of file record,
+ >0    belong  3               map of inodes on tape,
+ >0    belong  4               continuation of file record,
+ >0    belong  5               end of volume,
+ >0    belong  6               map of inodes deleted,
+ >0    belong  7               end of medium (for floppy),
+ >676  string  >\0             Label %s,
+ >696  string  >\0             Filesystem %s,
+ >760  string  >\0             Device %s,
+ >824  string  >\0             Host %s,
+ >888  belong  >0              Flags %x
+ # next two are actually 64-bit times, we use only the lowermost 32 bits
+ >900  bedate  x               This dump %s,
+ >908  bedate  x               Previous dump %s,
+ 
+ 24    lelong  0x19540119      new-fs dump file (ufs2, little endian),
+ >12   lelong  >0              Volume %ld,
+ >692  lelong  0               Level zero, type:
+ >692  lelong  >0              Level %d, type:
+ >0    lelong  1               tape header,
+ >0    lelong  2               beginning of file record,
+ >0    lelong  3               map of inodes on tape,
+ >0    lelong  4               continuation of file record,
+ >0    lelong  5               end of volume,
+ >0    lelong  6               map of inodes deleted,
+ >0    lelong  7               end of medium (for floppy),
+ >676  string  >\0             Label %s,
+ >696  string  >\0             Filesystem %s,
+ >760  string  >\0             Device %s,
+ >824  string  >\0             Host %s,
+ >888  lelong  >0              Flags %x
+ # next two are actually 64-bit times, we use only the lowermost 32 bits
+ >896  ledate  x               This dump %s,
+ >904  ledate  x               Previous dump %s,
Comment 1 Martin Birgmeier 2006-07-02 08:58:30 UTC
The 'Previous' and 'This' dump date lines should go directly after the
'new-fs' dump lines
Comment 2 Kris Kennaway 2006-08-19 21:34:26 UTC
> the fix is ugly because it does not support the 64 bit date stamps, but here it goes anyway:

This should probably be submitted to the file maintainers since that
utility is not separately maintained by FreeBSD (and perhaps
"de-uglified" first).

Kris
Comment 3 Kris Kennaway freebsd_committer freebsd_triage 2006-08-19 21:39:39 UTC
State Changed
From-To: open->suspended

Submitter address is invalid
Comment 4 Antoine Brodin freebsd_committer freebsd_triage 2008-02-07 18:35:03 UTC
The attached patch has been submitted upstream.
It handles 64bit dates correctly.
Comment 5 Antoine Brodin freebsd_committer freebsd_triage 2008-02-07 19:21:29 UTC
Responsible Changed
From-To: freebsd-bugs->antoine

Take this PR.  Hopefully it can be fixed with next vendor release/import. 
Approved by:	rwatson (mentor)
Comment 6 Antoine Brodin freebsd_committer freebsd_triage 2009-01-02 11:01:18 UTC
State Changed
From-To: suspended->closed

Close: this is fixed in head with file 4.26 import. 
If you don't use head, you can take file 4.26 from the ports tree.