Files
tar/tests/onetop07.at
Paul Eggert 94391c4bf1 tar: reject -C x --one-top-dir=/abs/olute
It’s not clear what ‘-C x --one-top-dir=/abs/olute’ should mean,
so for now let’s play it safe and reject that combination.
* src/misc.c (chdir_arg): Diagnose attempts to combine
-C with --one-top-level=/abs/olute.
* tests/onetop06.at: Move last test to onetop07.at,
since it now differs in behavior and it’s better to
test it separately.
* tests/onetop07.at: New file.
* tests/Makefile.am (TESTSUITE_AT): Add it.
* tests/testsuite.at: Include it.
2026-08-20 15:46:21 -07:00

36 lines
1.1 KiB
Plaintext

# Process this file with autom4te to create testsuite. -*- Autotest -*-
#
# Test suite for GNU tar.
# Copyright 2026 Free Software Foundation, Inc.
#
# This file is part of GNU tar.
#
# GNU tar is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# GNU tar is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
AT_SETUP([tar -C and --one-top-level=/abs/olute])
AT_KEYWORDS([extract onetop onetop07])
AT_TAR_CHECK([
mkdir d f && genfile --file d/file || framework_failure_
tar -cf test.tar d || exit
tar -xf test.tar -C f --one-top-level=$PWD/g
],
[2],
[],
[tar: -C and --one-top-level='/...' are incompatible
tar: Error is not recoverable: exiting now
])
AT_CLEANUP