From owner-svn-src-stable-7@FreeBSD.ORG Fri Jun 18 18:15:41 2010 Return-Path: Delivered-To: svn-src-stable-7@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 034C41065670; Fri, 18 Jun 2010 18:15:41 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CCFC68FC16; Fri, 18 Jun 2010 18:15:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o5IIFexd033964; Fri, 18 Jun 2010 18:15:40 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o5IIFeuV033961; Fri, 18 Jun 2010 18:15:40 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201006181815.o5IIFeuV033961@svn.freebsd.org> From: Xin LI Date: Fri, 18 Jun 2010 18:15:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r209311 - stable/7/contrib/cpio/src X-BeenThere: svn-src-stable-7@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 7-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jun 2010 18:15:41 -0000 Author: delphij Date: Fri Jun 18 18:15:40 2010 New Revision: 209311 URL: http://svn.freebsd.org/changeset/base/209311 Log: Fix two regressions introduced by GNU cpio 2.8 import: cpio/src/copyout.c: Old behavior is not to strip leading / from symbol link target. By default cpio will replace the symbol link rather than following it so this should not be a risk. cpio/src/util.c: Zero out rdev_{maj,min} for files where they are not applicable. This is a direct commit since GNU cpio has been removed from -HEAD. Sorry for the breakage... Reported by: sbruno Modified: stable/7/contrib/cpio/src/copyout.c stable/7/contrib/cpio/src/util.c Modified: stable/7/contrib/cpio/src/copyout.c ============================================================================== --- stable/7/contrib/cpio/src/copyout.c Fri Jun 18 17:39:56 2010 (r209310) +++ stable/7/contrib/cpio/src/copyout.c Fri Jun 18 18:15:40 2010 (r209311) @@ -836,9 +836,6 @@ process_copy_out () continue; } link_name[link_size] = 0; - cpio_safer_name_suffix (link_name, false, - abs_paths_flag, true); - link_size = strlen (link_name); file_hdr.c_filesize = link_size; if (archive_format == arf_tar || archive_format == arf_ustar) { Modified: stable/7/contrib/cpio/src/util.c ============================================================================== --- stable/7/contrib/cpio/src/util.c Fri Jun 18 17:39:56 2010 (r209310) +++ stable/7/contrib/cpio/src/util.c Fri Jun 18 18:15:40 2010 (r209311) @@ -1252,8 +1252,25 @@ stat_to_cpio (struct cpio_file_stat *hdr hdr->c_uid = CPIO_UID (st->st_uid); hdr->c_gid = CPIO_GID (st->st_gid); hdr->c_nlink = st->st_nlink; - hdr->c_rdev_maj = major (st->st_rdev); - hdr->c_rdev_min = minor (st->st_rdev); + + switch (hdr->c_mode & CP_IFMT) + { + case CP_IFBLK: + case CP_IFCHR: +#ifdef CP_IFIFO + case CP_IFIFO: +#endif +#ifdef CP_IFSOCK + case CP_IFSOCK: +#endif + hdr->c_rdev_maj = major (st->st_rdev); + hdr->c_rdev_min = minor (st->st_rdev); + break; + default: + hdr->c_rdev_maj = 0; + hdr->c_rdev_min = 0; + break; + } hdr->c_mtime = st->st_mtime; hdr->c_filesize = st->st_size; hdr->c_chksum = 0;