From nobody@FreeBSD.org  Mon Dec 23 15:40:36 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115])
	(using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by hub.freebsd.org (Postfix) with ESMTPS id B2AA8E1D
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 23 Dec 2013 15:40:36 +0000 (UTC)
Received: from oldred.freebsd.org (oldred.freebsd.org [IPv6:2001:1900:2254:206a::50:4])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mx1.freebsd.org (Postfix) with ESMTPS id 8745A1626
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 23 Dec 2013 15:40:36 +0000 (UTC)
Received: from oldred.freebsd.org ([127.0.1.6])
	by oldred.freebsd.org (8.14.5/8.14.7) with ESMTP id rBNFeZmF066658
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 23 Dec 2013 15:40:35 GMT
	(envelope-from nobody@oldred.freebsd.org)
Received: (from nobody@localhost)
	by oldred.freebsd.org (8.14.5/8.14.5/Submit) id rBNFeZeT066603;
	Mon, 23 Dec 2013 15:40:35 GMT
	(envelope-from nobody)
Message-Id: <201312231540.rBNFeZeT066603@oldred.freebsd.org>
Date: Mon, 23 Dec 2013 15:40:35 GMT
From: Kurt Lidl <lidl@pix.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: makefs doesn't record serial numbers in rock ridge extensions
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         185138
>Category:       bin
>Synopsis:       makefs(8) doesn't record serial numbers in rock ridge extensions
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    marius
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec 23 15:50:00 UTC 2013
>Closed-Date:    Fri Apr 25 21:41:46 UTC 2014
>Last-Modified:  Fri Apr 25 21:41:46 UTC 2014
>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:
Responsible-Changed-From-To: freebsd-bugs->marius 
Responsible-Changed-By: marius 
Responsible-Changed-When: Tue Dec 24 07:57:31 UTC 2013 
Responsible-Changed-Why:  
grab 

http://www.freebsd.org/cgi/query-pr.cgi?pr=185138 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/185138: commit references a PR
Date: Sun, 29 Dec 2013 16:43:43 +0000 (UTC)

 Author: marius
 Date: Sun Dec 29 16:43:35 2013
 New Revision: 260041
 URL: http://svnweb.freebsd.org/changeset/base/260041
 
 Log:
   Record the IEEE P1282 Rock Ridge version 1.12 POSIX File Serial Number,
   i. e. the POSIX:5.6.1 st_ino field, which can be used to detect hard links
   in the file system. This is also the default in mkisofs(8) and according to
   its man page, no system only being able to cope with Rock Ridge version 1.10
   is known to exist.
   
   PR:		185138
   Submitted by:	Kurt Lidl
   MFC after:	1 week
 
 Modified:
   head/usr.sbin/makefs/cd9660/iso9660_rrip.c
   head/usr.sbin/makefs/cd9660/iso9660_rrip.h
 
 Modified: head/usr.sbin/makefs/cd9660/iso9660_rrip.c
 ==============================================================================
 --- head/usr.sbin/makefs/cd9660/iso9660_rrip.c	Sun Dec 29 16:28:37 2013	(r260040)
 +++ head/usr.sbin/makefs/cd9660/iso9660_rrip.c	Sun Dec 29 16:43:35 2013	(r260041)
 @@ -634,7 +634,7 @@ 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);
 @@ -644,8 +644,9 @@ cd9660node_rrip_px(struct ISO_SUSP_ATTRI
  	    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;
  }
  
 
 Modified: head/usr.sbin/makefs/cd9660/iso9660_rrip.h
 ==============================================================================
 --- head/usr.sbin/makefs/cd9660/iso9660_rrip.h	Sun Dec 29 16:28:37 2013	(r260040)
 +++ head/usr.sbin/makefs/cd9660/iso9660_rrip.h	Sun Dec 29 16:43:35 2013	(r260041)
 @@ -103,7 +103,7 @@ typedef struct {
  	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 {
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: open->patched 
State-Changed-By: linimon 
State-Changed-When: Sun Apr 20 03:27:15 UTC 2014 
State-Changed-Why:  
over to committer as possible MFC reminder. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=185138 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/185138: commit references a PR
Date: Fri, 25 Apr 2014 21:20:32 +0000 (UTC)

 Author: marius
 Date: Fri Apr 25 21:20:28 2014
 New Revision: 264937
 URL: http://svnweb.freebsd.org/changeset/base/264937
 
 Log:
   MFC: r260041
   
   Record the IEEE P1282 Rock Ridge version 1.12 POSIX File Serial Number,
   i. e. the POSIX:5.6.1 st_ino field, which can be used to detect hard links
   in the file system. This is also the default in mkisofs(8) and according to
   its man page, no system only being able to cope with Rock Ridge version 1.10
   is known to exist.
   
   PR:		185138
   Submitted by:	Kurt Lidl
 
 Modified:
   stable/9/usr.sbin/makefs/cd9660/iso9660_rrip.c
   stable/9/usr.sbin/makefs/cd9660/iso9660_rrip.h
 Directory Properties:
   stable/9/usr.sbin/makefs/   (props changed)
 
 Modified: stable/9/usr.sbin/makefs/cd9660/iso9660_rrip.c
 ==============================================================================
 --- stable/9/usr.sbin/makefs/cd9660/iso9660_rrip.c	Fri Apr 25 21:20:22 2014	(r264936)
 +++ stable/9/usr.sbin/makefs/cd9660/iso9660_rrip.c	Fri Apr 25 21:20:28 2014	(r264937)
 @@ -634,7 +634,7 @@ 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);
 @@ -644,8 +644,9 @@ cd9660node_rrip_px(struct ISO_SUSP_ATTRI
  	    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;
  }
  
 
 Modified: stable/9/usr.sbin/makefs/cd9660/iso9660_rrip.h
 ==============================================================================
 --- stable/9/usr.sbin/makefs/cd9660/iso9660_rrip.h	Fri Apr 25 21:20:22 2014	(r264936)
 +++ stable/9/usr.sbin/makefs/cd9660/iso9660_rrip.h	Fri Apr 25 21:20:28 2014	(r264937)
 @@ -103,7 +103,7 @@ typedef struct {
  	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 {
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: bin/185138: commit references a PR
Date: Fri, 25 Apr 2014 21:20:30 +0000 (UTC)

 Author: marius
 Date: Fri Apr 25 21:20:22 2014
 New Revision: 264936
 URL: http://svnweb.freebsd.org/changeset/base/264936
 
 Log:
   MFC: r260041
   
   Record the IEEE P1282 Rock Ridge version 1.12 POSIX File Serial Number,
   i. e. the POSIX:5.6.1 st_ino field, which can be used to detect hard links
   in the file system. This is also the default in mkisofs(8) and according to
   its man page, no system only being able to cope with Rock Ridge version 1.10
   is known to exist.
   
   PR:		185138
   Submitted by:	Kurt Lidl
 
 Modified:
   stable/10/usr.sbin/makefs/cd9660/iso9660_rrip.c
   stable/10/usr.sbin/makefs/cd9660/iso9660_rrip.h
 Directory Properties:
   stable/10/   (props changed)
 
 Modified: stable/10/usr.sbin/makefs/cd9660/iso9660_rrip.c
 ==============================================================================
 --- stable/10/usr.sbin/makefs/cd9660/iso9660_rrip.c	Fri Apr 25 21:11:00 2014	(r264935)
 +++ stable/10/usr.sbin/makefs/cd9660/iso9660_rrip.c	Fri Apr 25 21:20:22 2014	(r264936)
 @@ -634,7 +634,7 @@ 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);
 @@ -644,8 +644,9 @@ cd9660node_rrip_px(struct ISO_SUSP_ATTRI
  	    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;
  }
  
 
 Modified: stable/10/usr.sbin/makefs/cd9660/iso9660_rrip.h
 ==============================================================================
 --- stable/10/usr.sbin/makefs/cd9660/iso9660_rrip.h	Fri Apr 25 21:11:00 2014	(r264935)
 +++ stable/10/usr.sbin/makefs/cd9660/iso9660_rrip.h	Fri Apr 25 21:20:22 2014	(r264936)
 @@ -103,7 +103,7 @@ typedef struct {
  	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 {
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
State-Changed-From-To: patched->closed 
State-Changed-By: marius 
State-Changed-When: Fri Apr 25 21:41:19 UTC 2014 
State-Changed-Why:  
close 

http://www.freebsd.org/cgi/query-pr.cgi?pr=185138 
>Unformatted:
