svn commit: r209311 - stable/7/contrib/cpio/src

Tim Kientzle kientzle at freebsd.org
Sat Jun 19 05:36:22 UTC 2010


Could you also take a look at bin/147969:

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

I looked at it and came up with a tentative fix
(attached), but haven't had a chance to test it yet.

Cheers,

Tim

Xin LI wrote:
> 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;
> 
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gnu-cpio.patch
Type: text/x-patch
Size: 970 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/svn-src-stable-7/attachments/20100619/eac8d3ec/gnu-cpio.bin


More information about the svn-src-stable-7 mailing list