Subject: bug#13588: Pax hangs in case big UID

From: Petr Hracek <[email-masked]>
Date: Wed, 20 Mar 2013 12:45:59 +0100

Hello Stefano,

one more time. wrong patch file name.

[stone@kiasportyw automake(master)]$ cat 
0001-maint-pax-hangs-in-case-big-UID.patch
 From af7d2d01b363914ce22628dae06f87065649d402 Mon Sep 17 00:00:00 2001
From: Petr Hracek <[email-masked]>
Date: Wed, 20 Mar 2013 12:41:30 +0100
Subject: [PATCH] maint: pax hangs in case big UID

See automake bug #13588

* m4/tar.m4: check for ustar V7 archive format. Maximum value for user 
or group ID
is limited to 2097151
---
  m4/tar.m4 | 21 +++++++++++++++++++++
  1 file changed, 21 insertions(+)

diff --git a/m4/tar.m4 b/m4/tar.m4
index ec8c83e..a7f41d6 100644
--- a/m4/tar.m4
+++ b/m4/tar.m4
@@ -81,6 +81,27 @@ do
    AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
    rm -rf conftest.dir
    if test -s conftest.tar; then
+    AC_CHECK_PROG([ID_TEST], id, [yes], [no])
+    if test x"$ID_TEST" = x"yes"; then
+      if test x"$1" = x"ustar" ; then
+         user_id=`id -u`
+         if test $? -eq 0; then
+           # Maximum allowed UID in case ustar format is 2097151
+           if test $user_id -ge 2097152; then
+             AC_MSG_ERROR([The uid is big and not allowed in case of 
ustar format. Change format in configure.ac],[2])
+             exit 1
+           fi
+         fi
+         group_id=`id -g`
+         if test $? -eq 0; then
+           # Maximum allowed GID in case ustar format is 2097151
+           if test $group_id -ge 2097152; then
+             AC_MSG_ERROR([The gid is big and not allowed in case of 
ustar format. Change format in configure.ac],[2])
+             exit 1
+           fi
+         fi
+      fi
+    fi
      AM_RUN_LOG([$am__untar <conftest.tar])
      grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
    fi
-- 
1.8.1.4

[stone@kiasportyw automake(master)]$
On 03/20/2013 12:06 PM, Petr Hracek wrote:
>
> diff --git a/m4/tar.m4 b/m4/tar.m4 

-- 
S pozdravem / Best regards

Petr Hracek

Red Hat Czech s.r.o.
BaseOS Core Services Brno

Email: [email-masked]
Web: www.cz.redhat.com