automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Pax hangs in case big UID


From: Petr Hracek
Subject: Pax hangs in case big UID
Date: Mon, 28 Jan 2013 16:15:28 +0100
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130110 Thunderbird/17.0.2

Dear folks,

I am trying to solve problem in case that user is created with big UID
and during configuration pax hangs and need user interaction.

Last list are:
http://lists.gnu.org/archive/html/bug-automake/2011-11/msg00014.html
https://bugzilla.redhat.com/show_bug.cgi?id=843376

Patch is bellow and against upstream:

diff --git a/m4/tar.m4 b/m4/tar.m4
index ec8c83e..326b8b9 100644
--- a/m4/tar.m4
+++ b/m4/tar.m4
@@ -33,6 +33,7 @@ _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
 _am_tools=${am_cv_prog_tar_$1-$_am_tools}
 # Do not fold the above two line into one, because Tru64 sh and
 # Solaris sh will not grok spaces in the rhs of '-'.
+ac_returnCode=0
 for _am_tool in $_am_tools
 do
   case $_am_tool in
@@ -79,13 +80,37 @@ do
   mkdir conftest.dir
   echo GrepMe > conftest.dir/file
   AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+  ac_return=$?
   rm -rf conftest.dir
+  if test $ac_return -ne 0; then
+      if test "$_am_tool" = "pax"; then
+            ac_returnCode=$ac_return
+            echo "pax return value is: $ac_returnCode"
+            break;
+    fi
+    if test "$_am_tool" = "gnutar"; then
+            ac_returnCode=$ac_return
+            echo "gnutar return value is: $ac_returnCode"
+            break;
+    fi
+  fi
   if test -s conftest.tar; then
     AM_RUN_LOG([$am__untar <conftest.tar])
     grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
   fi
 done
 rm -rf conftest.dir
+if test $ac_returnCode -ne 0; then
+  # Do not want to print user_id on screen
+  `id -u > /tmp/id 2>/dev/null`
+  user_id=`cat /tmp/id`
+  rm -f /tmp/id
+  #Test if $user_id is greater then 2^21
+  #if yes then failed. This is valid only for pax and gnutar utilities
+  if test $user_id -gt 2097152 ; then
+    AC_MSG_ERROR([UserID $user_id is too big UID],[2])
+  fi
+fi

 AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
 AC_MSG_RESULT([$am_cv_prog_tar_$1])])

Please check and incorporate them if you agree.

--
S pozdravem / Best regards

Petr Hracek




reply via email to

[Prev in Thread] Current Thread [Next in Thread]