>Number:         185138
>Category:       misc
>Synopsis:       makefs doesn't record serial numbers in rock ridge extensions
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 23 15:50:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Kurt Lidl
>Release:        9.2-RELEASE
>Organization:
>Environment:
FreeBSD host.pix.net 9.2-RELEASE-p1 FreeBSD 9.2-RELEASE-p1 #0: Fri Nov 29 
23:01:31 PST 2013     [redacted]:/usr/obj/usr/src/sys/GENERIC  amd64

>Description:
Makefs, used to generated the cd9660 filesystem for boot media, does not record 
the serial number in the rock ridge extensions.

This can be used, when extracting a filesystem from the cd9660 filesystem, to 
detect hard links in the filesystem.

This was pointed out several months ago:

http://lists.freebsd.org/pipermail/freebsd-stable/2013-April/073050.html

Other bugs were also listed in the followup to that thread -- it looks like all 
the other issues have been addressed.


>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff --git a/usr.sbin/makefs/cd9660/iso9660_rrip.c 
b/usr.sbin/makefs/cd9660/iso9660_rrip.c
--- a/usr.sbin/makefs/cd9660/iso9660_rrip.c
+++ b/usr.sbin/makefs/cd9660/iso9660_rrip.c
@@ -629,28 +629,29 @@ cd9660_createSL(cd9660node *node)
                        }
                }
        }
 }
 
 int
 cd9660node_rrip_px(struct ISO_SUSP_ATTRIBUTES *v, fsnode *pxinfo)
 {
-       v->attr.rr_entry.PX.h.length[0] = 36;
+       v->attr.rr_entry.PX.h.length[0] = 44;
        v->attr.rr_entry.PX.h.version[0] = 1;
        cd9660_bothendian_dword(pxinfo->inode->st.st_mode,
            v->attr.rr_entry.PX.mode);
        cd9660_bothendian_dword(pxinfo->inode->st.st_nlink,
            v->attr.rr_entry.PX.links);
        cd9660_bothendian_dword(pxinfo->inode->st.st_uid,
            v->attr.rr_entry.PX.uid);
        cd9660_bothendian_dword(pxinfo->inode->st.st_gid,
            v->attr.rr_entry.PX.gid);
+       cd9660_bothendian_dword(pxinfo->inode->st.st_ino,
+           v->attr.rr_entry.PX.serial);
 
-       /* Ignoring the serial number for now */
        return 1;
 }
 
 int
 cd9660node_rrip_pn(struct ISO_SUSP_ATTRIBUTES *pn_field, fsnode *fnode)
 {
        pn_field->attr.rr_entry.PN.h.length[0] = 20;
        pn_field->attr.rr_entry.PN.h.version[0] = 1;
diff --git a/usr.sbin/makefs/cd9660/iso9660_rrip.h 
b/usr.sbin/makefs/cd9660/iso9660_rrip.h
--- a/usr.sbin/makefs/cd9660/iso9660_rrip.h
+++ b/usr.sbin/makefs/cd9660/iso9660_rrip.h
@@ -98,17 +98,17 @@
 #define SL_FLAGS_ROOT          8
 
 typedef struct {
        ISO_SUSP_HEADER          h;
        u_char mode             [ISODCL(5,12)];
        u_char links            [ISODCL(13,20)];
        u_char uid              [ISODCL(21,28)];
        u_char gid              [ISODCL(29,36)];
-       u_char serial           [ISODCL(37,44)];/* Not used */
+       u_char serial           [ISODCL(37,44)];
 } ISO_RRIP_PX;
 
 typedef struct {
        ISO_SUSP_HEADER          h;
        u_char high             [ISODCL(5,12)];
        u_char low              [ISODCL(13,20)];
 } ISO_RRIP_PN;
 


>Release-Note:
>Audit-Trail:
>Unformatted:
_______________________________________________
freebsd-bugs@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"

Reply via email to