2 # Copyright (C) 2013-2017 Free Software Foundation, Inc.
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 2, or (at your option)
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <https://www.gnu.org/licenses/>.
17 # Check that UID or GID too high for the ustar format are correctly
18 # rwcognized and diagnosed by configure. See bug#8343 and bug#13588.
22 cat > configure.ac
<<END
24 AM_INIT_AUTOMAKE([tar-ustar])
25 AC_CONFIG_FILES([Makefile])
33 st
=0; .
/configure
${1+"$@"} >stdout || st
=$?
35 test $st -eq 0 ||
exit 1
40 grep "^checking $1\.\.\. $2$" stdout
51 -u) echo "${am_uid-1000}";;
52 -g) echo "${am_gid-1000}";;
53 *) echo "id: bad/unexpected usage" >&2; exit 1;;
58 PATH
=$
(pwd)/bin
$PATH_SEPARATOR$PATH
60 # Problematic ID reported in
61 # <https://bugzilla.redhat.com/show_bug.cgi?id=843376>.
62 am_uid
=16777216; export am_uid
63 am_gid
=1000; export am_gid
65 checked
"whether UID '$am_uid' is supported by ustar format" "no"
66 checked
"whether GID '1000' is supported by ustar format" "yes"
67 checked
"how to create a ustar tar archive" "none"
69 # Another problematic ID reported in
70 # <https://bugzilla.redhat.com/show_bug.cgi?id=843376>.
71 am_uid
=1000; export am_uid
72 am_gid
=17000000; export am_gid
74 checked
"whether UID '1000' is supported by ustar format" "yes"
75 checked
"whether GID '$am_gid' is supported by ustar format" "no"
76 checked
"how to create a ustar tar archive" "none"
78 # The minimal ID that is too big.
79 two_to_twentyone
=$
((32 * 32 * 32 * 32 * 2))
80 # <https://bugzilla.redhat.com/show_bug.cgi?id=843376>.
81 am_uid
=$two_to_twentyone; export am_uid
82 am_gid
=$two_to_twentyone; export am_gid
84 checked
"whether UID '$two_to_twentyone' is supported by ustar format" "no"
85 checked
"whether GID '$two_to_twentyone' is supported by ustar format" "no"
86 checked
"how to create a ustar tar archive" "none"