Ticket #13631: 13631_untar.patch

File 13631_untar.patch, 1.1 KB (added by jdemeyer, 8 years ago)
  • spkg/base/prereq-1.1-install

    # HG changeset patch
    # User Jeroen Demeyer <jdemeyer@cage.ugent.be>
    # Date 1351547747 -3600
    # Node ID a39ecc151ae55978415ed685827216ef56b7315e
    # Parent  b85bd1f2f9977c3ed55da02f6ff77958d3e44b8d
    Extract with tar --no-same-owner which is safer when building as root
    
    diff --git a/spkg/base/prereq-1.1-install b/spkg/base/prereq-1.1-install
    a b  
    131131# test.
    132132prereq_tarball="$SAGE_ROOT/spkg/base/$TARGET.tar.gz"
    133133if [ -f "$prereq_tarball" ]; then
    134     gzip -cd "$prereq_tarball" | tar xf -
     134    gzip -cd "$prereq_tarball" | tar xf - --no-same-owner
    135135    if [ $? -ne 0 ]; then
    136136        echo >&2 "Error: failed to extract '$prereq_tarball'"
    137137        exit 1
  • spkg/bin/sage-spkg

    diff --git a/spkg/bin/sage-spkg b/spkg/bin/sage-spkg
    a b  
    374374echo "Extracting package $PKG_SRC"
    375375ls -l "$PKG_SRC"
    376376
    377 uncompress_spkg "$PKG_SRC" | tar x${UNTAR_VERBOSE}f -
     377uncompress_spkg "$PKG_SRC" | tar x${UNTAR_VERBOSE}f - --no-same-owner
    378378if [ $? -ne 0 ]; then
    379379    echo >&2 "Error: failed to extract $PKG_SRC"
    380380    exit 1