From owner-svn-src-all@FreeBSD.ORG Wed Aug 10 08:21:39 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F53D1065675; Wed, 10 Aug 2011 08:21:39 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6ECC78FC17; Wed, 10 Aug 2011 08:21:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p7A8LdQH032071; Wed, 10 Aug 2011 08:21:39 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p7A8LdJo032069; Wed, 10 Aug 2011 08:21:39 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201108100821.p7A8LdJo032069@svn.freebsd.org> From: Martin Matuska Date: Wed, 10 Aug 2011 08:21:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r224748 - in stable/8/usr.sbin/makefs: . ffs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Aug 2011 08:21:39 -0000 Author: mm Date: Wed Aug 10 08:21:39 2011 New Revision: 224748 URL: http://svn.freebsd.org/changeset/base/224748 Log: MFC r224690: Fix NetBSD PR bin/44114: makefs with -t cd9660 -o rockridge against directories with deep structure creates a corrupted cd9660 image. http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=44114 Fix NetBSD PR bin/45217: makefs creates ISO9660 images that violate the ECMA-119 (ISO9660) specification. This is caused by erroneously writing 32 bytes with value 0x20 to the volume_set_id field and 128 bytes with value 0x20 to the the following 37-byte fields in the PVD: copyright_file_id, abstract_file_id, bibliographic_file_id This causes, among other unwanted results the reserved4 field to be overwritten with the value 0x20. To comply with the specification, this field muse be zero. As a result, all FreeBSD distribution ISO images created with makefs have not been 100% valid ISO9660 files. http://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=45217 Reviewed by: kientzle Obtained from: NetBSD Modified: stable/8/usr.sbin/makefs/cd9660.c Directory Properties: stable/8/usr.sbin/makefs/ (props changed) stable/8/usr.sbin/makefs/ffs/ffs_bswap.c (props changed) stable/8/usr.sbin/makefs/ffs/ffs_subr.c (props changed) stable/8/usr.sbin/makefs/ffs/ufs_bswap.h (props changed) stable/8/usr.sbin/makefs/getid.c (props changed) Modified: stable/8/usr.sbin/makefs/cd9660.c ============================================================================== --- stable/8/usr.sbin/makefs/cd9660.c Wed Aug 10 06:17:06 2011 (r224747) +++ stable/8/usr.sbin/makefs/cd9660.c Wed Aug 10 08:21:39 2011 (r224748) @@ -223,13 +223,12 @@ cd9660_set_defaults(void) /* Make sure the PVD is clear */ memset(&diskStructure.primaryDescriptor, 0, 2048); - memset(diskStructure.primaryDescriptor.volume_set_id, 0x20,32); memset(diskStructure.primaryDescriptor.publisher_id, 0x20,128); memset(diskStructure.primaryDescriptor.preparer_id, 0x20,128); memset(diskStructure.primaryDescriptor.application_id, 0x20,128); - memset(diskStructure.primaryDescriptor.copyright_file_id, 0x20,128); - memset(diskStructure.primaryDescriptor.abstract_file_id, 0x20,128); - memset(diskStructure.primaryDescriptor.bibliographic_file_id, 0x20,128); + memset(diskStructure.primaryDescriptor.copyright_file_id, 0x20,37); + memset(diskStructure.primaryDescriptor.abstract_file_id, 0x20,37); + memset(diskStructure.primaryDescriptor.bibliographic_file_id, 0x20,37); strcpy(diskStructure.primaryDescriptor.system_id,"NetBSD"); @@ -669,11 +668,11 @@ cd9660_finalize_PVD(void) cd9660_pad_string_spaces(diskStructure.primaryDescriptor.application_id, 128); cd9660_pad_string_spaces( - diskStructure.primaryDescriptor.copyright_file_id, 128); + diskStructure.primaryDescriptor.copyright_file_id, 37); cd9660_pad_string_spaces( - diskStructure.primaryDescriptor.abstract_file_id, 128); + diskStructure.primaryDescriptor.abstract_file_id, 37); cd9660_pad_string_spaces( - diskStructure.primaryDescriptor.bibliographic_file_id, 128); + diskStructure.primaryDescriptor.bibliographic_file_id, 37); /* Setup dates */ time(&tim); @@ -1307,6 +1306,8 @@ cd9660_rrip_move_directory(cd9660node *d /* Set the new name */ memset(dir->isoDirRecord->name, 0, ISO_FILENAME_MAXLENGTH_WITH_PADDING); strncpy(dir->isoDirRecord->name, newname, 8); + dir->isoDirRecord->length[0] = 34 + 8; + dir->isoDirRecord->name_len[0] = 8; return dir; }