Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 244307 Details for
Bug 309001
GNOME tarballs with 99+ char filenames cause troubles with app-arch/tar-1.21+ when piped into
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
handle SIGPIPE from decompressor
portage-sigpipe.patch (text/plain), 2.33 KB, created by
Zac Medico
on 2010-08-23 22:40:06 UTC
(
hide
)
Description:
handle SIGPIPE from decompressor
Filename:
MIME Type:
Creator:
Zac Medico
Created:
2010-08-23 22:40:06 UTC
Size:
2.33 KB
patch
obsolete
>From 426be813048c87951c441d5b6b8c8020a2e801cd Mon Sep 17 00:00:00 2001 >From: Zac Medico <zmedico@gentoo.org> >Date: Mon, 23 Aug 2010 15:26:13 -0700 >Subject: [PATCH] Handle SIGPIPE when unpack() extracts tar files through a pipe. > >When checking ${PIPESTATUS[@]} for extraction of tar files in unpack(), >use a new assert_tar_extract() function which behaves the same as the >existing assert() function except that it tolerates pipe writers being >killed by SIGPIPE. >--- > bin/ebuild.sh | 4 ++-- > bin/isolated-functions.sh | 29 +++++++++++++++++++++++++++++ > 2 files changed, 31 insertions(+), 2 deletions(-) > >diff --git a/bin/ebuild.sh b/bin/ebuild.sh >index 84a83fe..d69408e 100755 >--- a/bin/ebuild.sh >+++ b/bin/ebuild.sh >@@ -348,7 +348,7 @@ unpack() { > _unpack_tar() { > if [ "${y}" == "tar" ]; then > $1 -dc "$srcdir$x" | tar xof - >- assert "$myfail" >+ assert_tar_extract "$myfail" > else > $1 -dc "${srcdir}${x}" > ${x%.*} || die "$myfail" > fi >@@ -364,7 +364,7 @@ unpack() { > ;; > tbz|tbz2) > bzip2 -dc "$srcdir$x" | tar xof - >- assert "$myfail" >+ assert_tar_extract "$myfail" > ;; > ZIP|zip|jar) > unzip -qo "${srcdir}${x}" || die "$myfail" >diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh >index 53312db..d0df9b1 100644 >--- a/bin/isolated-functions.sh >+++ b/bin/isolated-functions.sh >@@ -15,6 +15,35 @@ assert() { > done > } > >+assert_tar_extract() { >+ # When extracting a tar file like this: >+ # >+ # bzip2 -dc foo.tar.bz2 | tar xof - >+ # >+ # For some tar files (see bug #309001), tar will >+ # close its stdin pipe when the decompressor still has >+ # remaining data to be written to its stdout pipe. This >+ # causes the decompressor to be killed by SIGPIPE. In >+ # this case, we want to ignore pipe writers killed by >+ # SIGPIPE, and trust the exit status of tar. We borrow >+ # WIFSIGNALED and WTERMSIG bitwise operations from >+ # glibc's bits/waitstatus.h. >+ >+ local x pipestatus=${PIPESTATUS[*]} >+ for x in $pipestatus ; do >+ if [[ $x -ne 0 ]] ; then >+ # WIFSIGNALED(status) >+ (( ( ( ( x & 0x7f ) + 1 ) >> 1 ) > 0 )) || die "$@" >+ >+ # WTERMSIG(status) == SIGPIPE >+ (( ( x & 0x7f ) == 13 )) || die "$@" >+ fi >+ done >+ >+ # Require normal success for the last process (tar). >+ [[ $x -eq 0 ]] || die "$@" >+} >+ > shopt -s extdebug > > # dump_trace([number of funcs on stack to skip], >-- >1.7.1.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 309001
:
223165
|
223167
|
223235
|
223303
|
244307
|
244315