The following commit has been merged in the master branch:
commit 2cb48285655b56ea84ca6373ac3e7a06dccb9c3f
Author: Christian Kastner <[email protected]>
Date:   Sun Mar 20 21:43:06 2011 +0100

    uscan: ZIP repacking fixes
    
    Don't include the current working directory in the tarball, and give 
ownership
    to root instead of leaking the user's UID
    
    Signed-off-by: James Vega <[email protected]>

diff --git a/scripts/uscan.pl b/scripts/uscan.pl
index 5814d3c..47b8380 100755
--- a/scripts/uscan.pl
+++ b/scripts/uscan.pl
@@ -1372,8 +1372,14 @@ EOF
 
        my $newfile_base_gz = "$1.tar.gz";
        my $tempdir = tempdir ( "uscanXXXX", TMPDIR => 1, CLEANUP => 1 );
-       system("unzip -q -a -d $tempdir $destdir/$newfile_base; GZIP=-9 tar -C 
$tempdir -czf $destdir/$newfile_base_gz .") == 0 
-         or die("Repacking from zip to tar.gz failed\n");
+       my $globpattern = "*";
+       system("unzip -q -a -d $tempdir $destdir/$newfile_base") == 0
+         or die("Repacking from zip to tar.gz failed (could not unzip)\n");
+       if (system("ls -d $tempdir/.[!.]* >/dev/null 2>&1") == 0) {
+           $globpattern .= " .[!.]*";
+       }
+       system("cd $tempdir; GZIP=-9 tar --owner=root --group=root --mode=a+rX 
-czf $destdir/$newfile_base_gz $globpattern") == 0
+         or die("Repacking from zip to tar.gz failed (could not create 
tarball)\n");
        unlink "$destdir/$newfile_base";
        $newfile_base = $newfile_base_gz;
     }

-- 
Git repository for devscripts


-- 
To unsubscribe, send mail to [email protected].

Reply via email to