source: cpio/vendor/current/tests/symlink-bad-length.at@ 1964

Last change on this file since 1964 was 1964, checked in by Silvan Scherrer, 8 years ago

cpio: update vendor to version 2.12

File size: 2.6 KB
Line 
1# Process this file with autom4te to create testsuite. -*- Autotest -*-
2# Copyright (C) 2014-2015 Free Software Foundation, Inc.
3
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 3, or (at your option)
7# any later version.
8
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.
13
14# You should have received a copy of the GNU General Public License
15# along with this program; if not, write to the Free Software
16# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17# 02110-1301 USA.
18
19# Cpio v2.11 did segfault with badly set symlink length.
20# References:
21# http://lists.gnu.org/archive/html/bug-cpio/2014-11/msg00007.html
22
23AT_SETUP([symlink-bad-length])
24AT_KEYWORDS([symlink-long copyout])
25
26AT_DATA([ARCHIVE.base64],
27[x3EjAIBAtIEtJy8nAQAAAHRUYW0FAAAADQBGSUxFAABzb21lIGNvbnRlbnQKAMdxIwBgQ/+hLScv
28JwEAAAB0VEhuBQD/////TElOSwAARklMRcdxAAAAAAAAAAAAAAEAAAAAAAAACwAAAAAAVFJBSUxF
29UiEhIQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
30AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
31AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
32AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
33AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
34AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
35AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
36])
37
38# The exact error message and exit status depend on the host architecture,
39# therefore strderr is filtered out and error code is not checked.
40
41# So far the only case when cpio would exit with code 0 is when it skips
42# several bytes and encounters a valid record header. Perhaps it should
43# exit with code 2 (non-critical error), if at least one byte was skipped,
44# but that could hurt backward compatibility.
45
46AT_CHECK([
47base64 -d ARCHIVE.base64 > ARCHIVE || AT_SKIP_TEST
48TZ=UTC cpio -ntv < ARCHIVE 2>stderr
49cat stderr | grep -v \
50 -e 'stored filename length is out of range' \
51 -e 'premature end of file' \
52 -e 'archive header has reverse byte-order' \
53 -e 'memory exhausted' \
54 -e 'skipped [[0-9][0-9]*] bytes of junk' \
55 -e '[[0-9][0-9]*] block' \
56 >&2
57echo >&2 STDERR
58],
59[0],
60[-rw-rw-r-- 1 10029 10031 13 Nov 25 2014 FILE
61],[STDERR
62])
63
64AT_CLEANUP
Note: See TracBrowser for help on using the repository browser.