]>
Commit | Line | Data |
---|---|---|
8787de90 AM |
1 | commit a3f1d933cc5e61037100f5e60eac45764b8b4b50 |
2 | Author: Sergey Poznyakoff <gray@gnu.org.ua> | |
3 | Date: Thu Mar 11 12:19:32 2010 +0200 | |
4 | ||
5 | Bugfix. | |
6 | ||
7 | * src/names.c (collect_and_sort_names): Initialize prev_name. | |
8 | Reported by Dmitry V. Levin. | |
9 | ||
10 | diff --git a/src/names.c b/src/names.c | |
11 | index 1146020..ea2ce76 100644 | |
12 | --- a/src/names.c | |
13 | +++ b/src/names.c | |
14 | @@ -871,7 +871,7 @@ void | |
15 | collect_and_sort_names (void) | |
16 | { | |
17 | struct name *name; | |
18 | - struct name *next_name, *prev_name; | |
19 | + struct name *next_name, *prev_name = NULL; | |
20 | int num_names; | |
21 | struct stat statbuf; | |
22 | Hash_table *nametab; | |
23 | commit 67b4f3519d838c6f16f5b6b63c0b9b8669fb3dd9 | |
24 | Author: Sergey Poznyakoff <gray@gnu.org.ua> | |
25 | Date: Fri Mar 12 09:48:46 2010 +0200 | |
26 | ||
27 | Bugfixes. | |
28 | ||
29 | * src/buffer.c (check_label_pattern): Initialize result. | |
30 | * tests/remfiles01.at: Skip if run with root privileges. | |
31 | ||
32 | diff --git a/src/buffer.c b/src/buffer.c | |
33 | index 8e1bb9b..dfc8456 100644 | |
34 | --- a/src/buffer.c | |
35 | +++ b/src/buffer.c | |
36 | @@ -1374,7 +1374,7 @@ static bool | |
37 | check_label_pattern (const char *label) | |
38 | { | |
39 | char *string; | |
40 | - bool result; | |
41 | + bool result = false; | |
42 | ||
43 | if (fnmatch (volume_label_option, label, 0) == 0) | |
44 | return true; | |
45 | diff --git a/tests/remfiles01.at b/tests/remfiles01.at | |
46 | index 940fd95..73752b4 100644 | |
47 | --- a/tests/remfiles01.at | |
48 | +++ b/tests/remfiles01.at | |
49 | @@ -30,6 +30,7 @@ AT_KEYWORDS([create remove-files remfiles01 gzip]) | |
50 | ||
51 | unset TAR_OPTIONS | |
52 | AT_CHECK([ | |
53 | +AT_UNPRIVILEGED_PREREQ | |
54 | AT_GZIP_PREREQ | |
55 | AT_SORT_PREREQ | |
56 | ||
57 | commit 340dbf5aabfee4e1e657f8ebf202a2fee1750a63 | |
58 | Author: Sergey Poznyakoff <gray@gnu.org.ua> | |
59 | Date: Sat Mar 20 13:14:31 2010 +0200 | |
60 | ||
61 | Fix undesired error exit on receiving SIGPIPE. | |
62 | ||
63 | * src/tar.c: Do not ignore SIGPIPE. | |
64 | * tests/sigpipe.at: New testcase. | |
65 | * tests/Makefile.am, tests/testsuite.at: Add sigpipe.at | |
66 | * tests/remfiles01.at: Fix error code expectation. | |
67 | * NEWS: Update. | |
68 | ||
69 | diff --git a/src/tar.c b/src/tar.c | |
70 | index e3fdf7b..b127963 100644 | |
71 | --- a/src/tar.c | |
72 | +++ b/src/tar.c | |
73 | @@ -2570,8 +2570,6 @@ main (int argc, char **argv) | |
74 | ||
75 | obstack_init (&argv_stk); | |
76 | ||
77 | - /* Ensure default behavior for some signals */ | |
78 | - signal (SIGPIPE, SIG_IGN); | |
79 | /* System V fork+wait does not work if SIGCHLD is ignored. */ | |
80 | signal (SIGCHLD, SIG_DFL); | |
81 | ||
82 | diff --git a/tests/Makefile.am b/tests/Makefile.am | |
83 | index 8f16244..31811b0 100644 | |
84 | --- a/tests/Makefile.am | |
85 | +++ b/tests/Makefile.am | |
86 | @@ -127,6 +127,7 @@ TESTSUITE_AT = \ | |
87 | shortfile.at\ | |
88 | shortupd.at\ | |
89 | shortrec.at\ | |
90 | + sigpipe.at\ | |
91 | sparse01.at\ | |
92 | sparse02.at\ | |
93 | sparse03.at\ | |
94 | diff --git a/tests/remfiles01.at b/tests/remfiles01.at | |
95 | index 73752b4..86b5c03 100644 | |
96 | --- a/tests/remfiles01.at | |
97 | +++ b/tests/remfiles01.at | |
98 | @@ -52,7 +52,9 @@ EC=$? | |
99 | sed -n '/(child)/p' err >&2 | |
100 | rm err | |
101 | find . | sort | |
102 | -exit $EC | |
103 | +# Gzip exit code is propagated to the shell. Usually it is | |
104 | +# 141. We convert all non-zero exits to 2 to make it predictable. | |
105 | +test $EC && exit 2 | |
106 | ], | |
107 | [2], | |
108 | [. | |
109 | diff --git a/tests/sigpipe.at b/tests/sigpipe.at | |
110 | new file mode 100644 | |
111 | index 0000000..9edca77 | |
112 | --- /dev/null | |
113 | +++ b/tests/sigpipe.at | |
114 | @@ -0,0 +1,39 @@ | |
115 | +# Process this file with autom4te to create testsuite. -*- Autotest -*- | |
116 | + | |
117 | +# Test suite for GNU tar. | |
118 | +# Copyright (C) 2010 Free Software Foundation, Inc. | |
119 | + | |
120 | +# This program is free software; you can redistribute it and/or modify | |
121 | +# it under the terms of the GNU General Public License as published by | |
122 | +# the Free Software Foundation; either version 3, or (at your option) | |
123 | +# any later version. | |
124 | + | |
125 | +# This program is distributed in the hope that it will be useful, | |
126 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
127 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
128 | +# GNU General Public License for more details. | |
129 | + | |
130 | +# You should have received a copy of the GNU General Public License | |
131 | +# along with this program. If not, see <http://www.gnu.org/licenses/>. | |
132 | + | |
133 | +AT_SETUP([sigpipe handling]) | |
134 | +AT_KEYWORDS([sigpipe]) | |
135 | + | |
136 | +# Description: Tar 1.23 ignored sigpipe which lead to spurious "write | |
137 | +# error" diagnostics when piping output to another programs. | |
138 | +# Reported-by: "Dmitry V. Levin" <ldv@altlinux.org> | |
139 | +# References: http://lists.gnu.org/archive/html/bug-tar/2010-03/msg00039.html | |
140 | +# <20100319184141.GC30047@wo.int.altlinux.org> | |
141 | + | |
142 | +AT_CHECK([ | |
143 | +genfile --length 2048 --file first | |
144 | +genfile --length 2048 --file second | |
145 | +genfile --length 2049 --file third | |
146 | + | |
147 | +tar cf archive first second third | |
148 | + | |
149 | +tar tf archive | : | |
150 | +], | |
151 | +[0]) | |
152 | + | |
153 | +AT_CLEANUP | |
154 | diff --git a/tests/testsuite.at b/tests/testsuite.at | |
155 | index 3e75ed8..9205d52 100644 | |
156 | --- a/tests/testsuite.at | |
157 | +++ b/tests/testsuite.at | |
158 | @@ -231,6 +231,8 @@ m4_include([remfiles01.at]) | |
159 | m4_include([remfiles02.at]) | |
160 | m4_include([remfiles03.at]) | |
161 | ||
162 | +m4_include([sigpipe.at]) | |
163 | + | |
164 | m4_include([star/gtarfail.at]) | |
165 | m4_include([star/gtarfail2.at]) | |
166 | ||
167 | commit 40dea1ae7fc892a54eae2efd30ddd8559c697525 | |
168 | Author: Sergey Poznyakoff <gray@gnu.org.ua> | |
169 | Date: Sat Mar 27 22:24:19 2010 +0200 | |
170 | ||
171 | Fix coredump. | |
172 | ||
173 | * src/names.c (collect_and_sort_names): Remove | |
174 | entry from the table before freeing it. | |
175 | ||
176 | diff --git a/src/names.c b/src/names.c | |
177 | index 2beaf3e..a3c6f58 100644 | |
178 | --- a/src/names.c | |
179 | +++ b/src/names.c | |
180 | @@ -986,6 +986,7 @@ collect_and_sort_names (void) | |
181 | { | |
182 | if (p->child) | |
183 | rebase_child_list (p->child, name); | |
184 | + hash_delete (nametab, name); | |
185 | /* FIXME: remove_directory (p->caname); ? */ | |
186 | remname (p); | |
187 | free_name (p); |