Hanno Böck commited on 2023-12-21 11:54:46
Zeige 6 geänderte Dateien mit 13 Einfügungen und 820 Löschungen.
... | ... |
@@ -1 +1 @@ |
1 |
-DIST screen-4.9.0.tar.gz 798229 BLAKE2B 0f64a14ce9a719bd4a6d045c55069769045a09ee2086c44c2e3d9da6d1e5ada2f094e00e16029767e1155ce35d4f360d0e2879995eefa052f3214ced71b7617c SHA512 18bbb085d77ecd02cbc02fa88a945c39f06e0c6de4eeaa16b278440dac5c9896811abbe0838144e997cd344ae08b9530399fa8fcb31a65fc571ead90e8307f84 |
|
1 |
+DIST screen-4.9.1.tar.gz 1040785 BLAKE2B 27d9c100bc1f747e39e109a4957702388d943c7d3b75b4c59dfc3894456d5249257742106fb24cf6f07a36764db0a1c5f7e0a44123edda1c570d771d7f46c638 SHA512 1f278313528815f4246bb162ced611c5d77321d11055e8d853168dc804c75d5f78568056a23e46db0640e1605e5cad4a5ce05e95e50cf02bb322cb6f57e5a126 |
... | ... |
@@ -1,33 +0,0 @@ |
1 |
-From e9ad41bfedb4537a6f0de20f00b27c7739f168f7 Mon Sep 17 00:00:00 2001 |
|
2 |
-From: Alexander Naumov <alexander_naumov@opensuse.org> |
|
3 |
-Date: Mon, 30 Jan 2023 17:22:25 +0200 |
|
4 |
-Subject: fix: missing signal sending permission check on failed query messages |
|
5 |
- |
|
6 |
-Signed-off-by: Alexander Naumov <alexander_naumov@opensuse.org> |
|
7 |
---- |
|
8 |
- socket.c | 9 +++++++-- |
|
9 |
- 1 file changed, 7 insertions(+), 2 deletions(-) |
|
10 |
- |
|
11 |
-diff --git a/socket.c b/socket.c |
|
12 |
-index 147dc54..54d8cb8 100644 |
|
13 |
---- a/socket.c |
|
14 |
-+++ b/socket.c |
|
15 |
-@@ -1285,11 +1285,16 @@ ReceiveMsg() |
|
16 |
- else |
|
17 |
- queryflag = -1; |
|
18 |
- |
|
19 |
-- Kill(m.m.command.apid, |
|
20 |
-+ if (CheckPid(m.m.command.apid)) { |
|
21 |
-+ Msg(0, "Query attempt with bad pid(%d)!", m.m.command.apid); |
|
22 |
-+ } |
|
23 |
-+ else { |
|
24 |
-+ Kill(m.m.command.apid, |
|
25 |
- (queryflag >= 0) |
|
26 |
- ? SIGCONT |
|
27 |
- : SIG_BYE); /* Send SIG_BYE if an error happened */ |
|
28 |
-- queryflag = -1; |
|
29 |
-+ queryflag = -1; |
|
30 |
-+ } |
|
31 |
- } |
|
32 |
- break; |
|
33 |
- case MSG_COMMAND: |
... | ... |
@@ -1,12 +0,0 @@ |
1 |
-Bug: https://bugs.gentoo.org/894562 |
|
2 |
-Taken from: https://git.savannah.gnu.org/cgit/screen.git/commit/?id=7f320d3a643ec95682a7213b7e991e27038d8a57 |
|
3 |
---- a/display.c |
|
4 |
-+++ b/display.c |
|
5 |
-@@ -27,6 +27,7 @@ |
|
6 |
- */ |
|
7 |
- |
|
8 |
- #include <sys/types.h> |
|
9 |
-+#include <sys/stat.h> |
|
10 |
- #include <signal.h> |
|
11 |
- #include <fcntl.h> |
|
12 |
- #ifndef sun |
... | ... |
@@ -1,747 +0,0 @@ |
1 |
-https://bugs.gentoo.org/869371 |
|
2 |
- |
|
3 |
-Upstream variant: https://lists.gnu.org/archive/html/screen-devel/2022-08/msg00000.html |
|
4 |
---- a/configure.ac |
|
5 |
-+++ b/configure.ac |
|
6 |
-@@ -157,10 +157,11 @@ if test -n "$ULTRIX"; then |
|
7 |
- fi |
|
8 |
- AC_CHECKING(for POSIX.1) |
|
9 |
- AC_EGREP_CPP(YES_IS_DEFINED, |
|
10 |
- [#include <sys/types.h> |
|
11 |
- #include <unistd.h> |
|
12 |
-+int |
|
13 |
- main () { |
|
14 |
- #ifdef _POSIX_VERSION |
|
15 |
- YES_IS_DEFINED; |
|
16 |
- #endif |
|
17 |
- ], AC_NOTE(- you have a POSIX system) AC_DEFINE(POSIX) posix=1) |
|
18 |
-@@ -231,10 +232,11 @@ dnl |
|
19 |
- |
|
20 |
- AC_CHECKING(BSD job jontrol) |
|
21 |
- AC_TRY_LINK( |
|
22 |
- [#include <sys/types.h> |
|
23 |
- #include <sys/ioctl.h> |
|
24 |
-+#include <unistd.h> |
|
25 |
- ], [ |
|
26 |
- #ifdef POSIX |
|
27 |
- tcsetpgrp(0, 0); |
|
28 |
- #else |
|
29 |
- int x = TIOCSPGRP; |
|
30 |
-@@ -248,48 +250,64 @@ int y = TIOCNOTTY; |
|
31 |
- |
|
32 |
- dnl |
|
33 |
- dnl **** setresuid(), setreuid(), seteuid() **** |
|
34 |
- dnl |
|
35 |
- AC_CHECKING(setresuid) |
|
36 |
--AC_TRY_LINK(,[ |
|
37 |
-+AC_TRY_LINK( |
|
38 |
-+[#include <unistd.h> |
|
39 |
-+], [ |
|
40 |
- setresuid(0, 0, 0); |
|
41 |
- ], AC_DEFINE(HAVE_SETRESUID)) |
|
42 |
- AC_CHECKING(setreuid) |
|
43 |
--AC_TRY_LINK(,[ |
|
44 |
-+AC_TRY_LINK( |
|
45 |
-+[#include <unistd.h> |
|
46 |
-+], [ |
|
47 |
- setreuid(0, 0); |
|
48 |
- ], AC_DEFINE(HAVE_SETREUID)) |
|
49 |
- dnl |
|
50 |
- dnl seteuid() check: |
|
51 |
- dnl linux seteuid was broken before V1.1.11 |
|
52 |
- dnl NeXT, AUX, ISC, and ultrix are still broken (no saved uid support) |
|
53 |
- dnl Solaris seteuid doesn't change the saved uid, bad for |
|
54 |
- dnl multiuser screen sessions |
|
55 |
- AC_CHECKING(seteuid) |
|
56 |
--AC_TRY_LINK(,[ |
|
57 |
-+AC_TRY_LINK( |
|
58 |
-+[#include <unistd.h> |
|
59 |
-+],[ |
|
60 |
- #if defined(linux) || defined(NeXT) || defined(_AUX_SOURCE) || defined(AUX) || defined(ultrix) || (defined(sun) && defined(SVR4)) || defined(ISC) || defined(sony_news) |
|
61 |
--seteuid_is_broken(0); |
|
62 |
-+int seteuid_is_broken(int); seteuid_is_broken(0); |
|
63 |
- #else |
|
64 |
- seteuid(0); |
|
65 |
- #endif |
|
66 |
- ], AC_DEFINE(HAVE_SETEUID)) |
|
67 |
- |
|
68 |
- dnl execvpe |
|
69 |
- AC_CHECKING(execvpe) |
|
70 |
--AC_TRY_LINK(,[ |
|
71 |
-+AC_TRY_LINK( |
|
72 |
-+[#include <unistd.h> |
|
73 |
-+],[ |
|
74 |
- execvpe(0, 0, 0); |
|
75 |
- ], AC_DEFINE(HAVE_EXECVPE) |
|
76 |
- CFLAGS="$CFLAGS -D_GNU_SOURCE") |
|
77 |
- |
|
78 |
- dnl |
|
79 |
- dnl **** select() **** |
|
80 |
- dnl |
|
81 |
- |
|
82 |
- AC_CHECKING(select) |
|
83 |
--AC_TRY_LINK(,[select(0, 0, 0, 0, 0);],, |
|
84 |
-+AC_TRY_LINK( |
|
85 |
-+[#include <sys/select.h> |
|
86 |
-+],[ |
|
87 |
-+ select(0, 0, 0, 0, 0); |
|
88 |
-+],, |
|
89 |
- LIBS="$LIBS -lnet -lnsl" |
|
90 |
- AC_CHECKING(select with $LIBS) |
|
91 |
--AC_TRY_LINK(,[select(0, 0, 0, 0, 0);],, |
|
92 |
-+AC_TRY_LINK( |
|
93 |
-+[#include <sys/select.h> |
|
94 |
-+],[ |
|
95 |
-+ select(0, 0, 0, 0, 0); |
|
96 |
-+],, |
|
97 |
- AC_MSG_ERROR(!!! no select - no screen)) |
|
98 |
- ) |
|
99 |
- dnl |
|
100 |
- dnl **** FIFO tests **** |
|
101 |
- dnl |
|
102 |
-@@ -314,11 +332,11 @@ AC_TRY_RUN([ |
|
103 |
- #define S_IFIFO 0010000 |
|
104 |
- #endif |
|
105 |
- |
|
106 |
- char *fin = "/tmp/conftest$$"; |
|
107 |
- |
|
108 |
--main() |
|
109 |
-+int main() |
|
110 |
- { |
|
111 |
- struct stat stb; |
|
112 |
- fd_set f; |
|
113 |
- |
|
114 |
- (void)alarm(5); |
|
115 |
-@@ -326,40 +344,40 @@ main() |
|
116 |
- #ifdef POSIX |
|
117 |
- if (mkfifo(fin, 0777)) |
|
118 |
- #else |
|
119 |
- if (mknod(fin, S_IFIFO|0777, 0)) |
|
120 |
- #endif |
|
121 |
-- exit(1); |
|
122 |
-+ return 1; |
|
123 |
- if (stat(fin, &stb) || (stb.st_mode & S_IFIFO) != S_IFIFO) |
|
124 |
-- exit(1); |
|
125 |
-+ return 1; |
|
126 |
- close(0); |
|
127 |
- #ifdef __386BSD__ |
|
128 |
- /* |
|
129 |
- * The next test fails under 386BSD, but screen works using fifos. |
|
130 |
- * Fifos in O_RDWR mode are only used for the BROKEN_PIPE case and for |
|
131 |
- * the select() configuration test. |
|
132 |
- */ |
|
133 |
-- exit(0); |
|
134 |
-+ return 0; |
|
135 |
- #endif |
|
136 |
- if (open(fin, O_RDONLY | O_NONBLOCK)) |
|
137 |
-- exit(1); |
|
138 |
-+ return 1; |
|
139 |
- if (fork() == 0) |
|
140 |
- { |
|
141 |
- close(0); |
|
142 |
- if (open(fin, O_WRONLY | O_NONBLOCK)) |
|
143 |
-- exit(1); |
|
144 |
-+ return 1; |
|
145 |
- close(0); |
|
146 |
- if (open(fin, O_WRONLY | O_NONBLOCK)) |
|
147 |
-- exit(1); |
|
148 |
-+ return 1; |
|
149 |
- if (write(0, "TEST", 4) == -1) |
|
150 |
-- exit(1); |
|
151 |
-- exit(0); |
|
152 |
-+ return 1; |
|
153 |
-+ return 0; |
|
154 |
- } |
|
155 |
- FD_SET(0, &f); |
|
156 |
- if (select(1, &f, 0, 0, 0) == -1) |
|
157 |
-- exit(1); |
|
158 |
-- exit(0); |
|
159 |
-+ return 1; |
|
160 |
-+ return 0; |
|
161 |
- } |
|
162 |
- ], AC_NOTE(- your fifos are usable) fifo=1, |
|
163 |
- AC_NOTE(- your fifos are not usable), |
|
164 |
- AC_NOTE(- skipping check because we are cross compiling; assuming fifos are usable) fifo=1) |
|
165 |
- rm -f /tmp/conftest* |
|
166 |
-@@ -385,30 +403,31 @@ AC_TRY_RUN([ |
|
167 |
- #define S_IFIFO 0010000 |
|
168 |
- #endif |
|
169 |
- |
|
170 |
- char *fin = "/tmp/conftest$$"; |
|
171 |
- |
|
172 |
-+int |
|
173 |
- main() |
|
174 |
- { |
|
175 |
- struct timeval tv; |
|
176 |
- fd_set f; |
|
177 |
- |
|
178 |
- #ifdef POSIX |
|
179 |
- if (mkfifo(fin, 0600)) |
|
180 |
- #else |
|
181 |
- if (mknod(fin, S_IFIFO|0600, 0)) |
|
182 |
- #endif |
|
183 |
-- exit(1); |
|
184 |
-+ return 1; |
|
185 |
- close(0); |
|
186 |
- if (open(fin, O_RDONLY|O_NONBLOCK)) |
|
187 |
-- exit(1); |
|
188 |
-+ return 1; |
|
189 |
- FD_SET(0, &f); |
|
190 |
- tv.tv_sec = 1; |
|
191 |
- tv.tv_usec = 0; |
|
192 |
- if (select(1, &f, 0, 0, &tv)) |
|
193 |
-- exit(1); |
|
194 |
-- exit(0); |
|
195 |
-+ return 1; |
|
196 |
-+ return 0; |
|
197 |
- } |
|
198 |
- ], AC_NOTE(- your implementation is ok), |
|
199 |
- AC_NOTE(- you have a broken implementation) AC_DEFINE(BROKEN_PIPE) fifobr=1, |
|
200 |
- AC_NOTE(- skipping check because we are cross compiling; assuming fifo implementation is ok)) |
|
201 |
- rm -f /tmp/conftest* |
|
202 |
-@@ -432,46 +455,48 @@ AC_TRY_RUN([ |
|
203 |
- |
|
204 |
- #include <sys/stat.h> |
|
205 |
- #include <fcntl.h> |
|
206 |
- #include <sys/socket.h> |
|
207 |
- #include <sys/un.h> |
|
208 |
-+#include <signal.h> |
|
209 |
- |
|
210 |
- char *son = "/tmp/conftest$$"; |
|
211 |
- |
|
212 |
-+int |
|
213 |
- main() |
|
214 |
- { |
|
215 |
- int s1, s2, l; |
|
216 |
- struct sockaddr_un a; |
|
217 |
- fd_set f; |
|
218 |
- |
|
219 |
- (void)alarm(5); |
|
220 |
- if ((s1 = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) |
|
221 |
-- exit(1); |
|
222 |
-+ return 1; |
|
223 |
- a.sun_family = AF_UNIX; |
|
224 |
- strcpy(a.sun_path, son); |
|
225 |
- (void) unlink(son); |
|
226 |
- if (bind(s1, (struct sockaddr *) &a, strlen(son)+2) == -1) |
|
227 |
-- exit(1); |
|
228 |
-+ return 1; |
|
229 |
- if (listen(s1, 2)) |
|
230 |
-- exit(1); |
|
231 |
-+ return 1; |
|
232 |
- if (fork() == 0) |
|
233 |
- { |
|
234 |
- if ((s2 = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) |
|
235 |
- kill(getppid(), 3); |
|
236 |
- (void)connect(s2, (struct sockaddr *)&a, strlen(son) + 2); |
|
237 |
- if (write(s2, "HELLO", 5) == -1) |
|
238 |
- kill(getppid(), 3); |
|
239 |
-- exit(0); |
|
240 |
-+ return 0; |
|
241 |
- } |
|
242 |
- l = sizeof(a); |
|
243 |
- close(0); |
|
244 |
- if (accept(s1, &a, &l)) |
|
245 |
-- exit(1); |
|
246 |
-+ return 1; |
|
247 |
- FD_SET(0, &f); |
|
248 |
- if (select(1, &f, 0, 0, 0) == -1) |
|
249 |
-- exit(1); |
|
250 |
-- exit(0); |
|
251 |
-+ return 1; |
|
252 |
-+ return 0; |
|
253 |
- } |
|
254 |
- ], AC_NOTE(- your sockets are usable) sock=1, |
|
255 |
- AC_NOTE(- your sockets are not usable), |
|
256 |
- AC_NOTE(- skipping check because we are cross compiling; assuming sockets are usable) sock=1) |
|
257 |
- rm -f /tmp/conftest* |
|
258 |
-@@ -491,26 +516,27 @@ AC_TRY_RUN([ |
|
259 |
- #include <sys/socket.h> |
|
260 |
- #include <sys/un.h> |
|
261 |
- |
|
262 |
- char *son = "/tmp/conftest$$"; |
|
263 |
- |
|
264 |
-+int |
|
265 |
- main() |
|
266 |
- { |
|
267 |
- int s; |
|
268 |
- struct stat stb; |
|
269 |
- struct sockaddr_un a; |
|
270 |
- if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) |
|
271 |
-- exit(0); |
|
272 |
-+ return 0; |
|
273 |
- a.sun_family = AF_UNIX; |
|
274 |
- strcpy(a.sun_path, son); |
|
275 |
- (void) unlink(son); |
|
276 |
- if (bind(s, (struct sockaddr *) &a, strlen(son)+2) == -1) |
|
277 |
-- exit(0); |
|
278 |
-+ return 0; |
|
279 |
- if (stat(son, &stb)) |
|
280 |
-- exit(1); |
|
281 |
-+ return 1; |
|
282 |
- close(s); |
|
283 |
-- exit(0); |
|
284 |
-+ return 0; |
|
285 |
- } |
|
286 |
- ],AC_NOTE(- you are normal), |
|
287 |
- AC_NOTE(- unix domain sockets are not kept in the filesystem) |
|
288 |
- AC_DEFINE(SOCK_NOT_IN_FS) socknofs=1, |
|
289 |
- AC_NOTE(- skipping check because we are cross compiling; assuming sockets are normal)) |
|
290 |
-@@ -545,122 +571,167 @@ char *nam = "/tmp/conftest$$"; |
|
291 |
- #endif |
|
292 |
- #ifndef S_IFIFO |
|
293 |
- #define S_IFIFO 0010000 |
|
294 |
- #endif |
|
295 |
- |
|
296 |
-+int |
|
297 |
- main() |
|
298 |
- { |
|
299 |
- fd_set f; |
|
300 |
- |
|
301 |
- #ifdef __FreeBSD__ |
|
302 |
- /* From Andrew A. Chernov (ache@astral.msk.su): |
|
303 |
- * opening RDWR fifo fails in BSD 4.4, but select return values are |
|
304 |
- * right. |
|
305 |
- */ |
|
306 |
-- exit(0); |
|
307 |
-+ return 0; |
|
308 |
- #endif |
|
309 |
- (void)alarm(5); |
|
310 |
- #ifdef POSIX |
|
311 |
- if (mkfifo(nam, 0777)) |
|
312 |
- #else |
|
313 |
- if (mknod(nam, S_IFIFO|0777, 0)) |
|
314 |
- #endif |
|
315 |
-- exit(1); |
|
316 |
-+ return 1; |
|
317 |
- close(0); |
|
318 |
- if (open(nam, O_RDWR | O_NONBLOCK)) |
|
319 |
-- exit(1); |
|
320 |
-+ return 1; |
|
321 |
- if (write(0, "TEST", 4) == -1) |
|
322 |
-- exit(1); |
|
323 |
-+ return 1; |
|
324 |
- |
|
325 |
- #else |
|
326 |
- |
|
327 |
- #include <sys/types.h> |
|
328 |
- #include <sys/socket.h> |
|
329 |
- #include <sys/un.h> |
|
330 |
-+#include <signal.h> |
|
331 |
- |
|
332 |
-+int |
|
333 |
- main() |
|
334 |
- { |
|
335 |
- int s1, s2, l; |
|
336 |
- struct sockaddr_un a; |
|
337 |
- fd_set f; |
|
338 |
- |
|
339 |
- (void)alarm(5); |
|
340 |
- if ((s1 = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) |
|
341 |
-- exit(1); |
|
342 |
-+ return 1; |
|
343 |
- a.sun_family = AF_UNIX; |
|
344 |
- strcpy(a.sun_path, nam); |
|
345 |
- (void) unlink(nam); |
|
346 |
- if (bind(s1, (struct sockaddr *) &a, strlen(nam)+2) == -1) |
|
347 |
-- exit(1); |
|
348 |
-+ return 1; |
|
349 |
- if (listen(s1, 2)) |
|
350 |
-- exit(1); |
|
351 |
-+ return 1; |
|
352 |
- if (fork() == 0) |
|
353 |
- { |
|
354 |
- if ((s2 = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) |
|
355 |
- kill(getppid(), 3); |
|
356 |
- (void)connect(s2, (struct sockaddr *)&a, strlen(nam) + 2); |
|
357 |
- if (write(s2, "HELLO", 5) == -1) |
|
358 |
- kill(getppid(), 3); |
|
359 |
-- exit(0); |
|
360 |
-+ return 0; |
|
361 |
- } |
|
362 |
- l = sizeof(a); |
|
363 |
- close(0); |
|
364 |
- if (accept(s1, (struct sockaddr *)&a, &l)) |
|
365 |
-- exit(1); |
|
366 |
-+ return 1; |
|
367 |
- #endif |
|
368 |
- |
|
369 |
- |
|
370 |
- FD_SET(0, &f); |
|
371 |
- if (select(1, &f, 0, 0, 0) == -1) |
|
372 |
-- exit(1); |
|
373 |
-+ return 1; |
|
374 |
- if (select(1, &f, &f, 0, 0) != 2) |
|
375 |
-- exit(1); |
|
376 |
-- exit(0); |
|
377 |
-+ return 1; |
|
378 |
-+ return 0; |
|
379 |
- } |
|
380 |
- ],AC_NOTE(- select is ok), |
|
381 |
- AC_NOTE(- select can't count) AC_DEFINE(SELECT_BROKEN), |
|
382 |
- AC_NOTE(- skipping check because we are cross compiling; assuming select is ok)) |
|
383 |
- |
|
384 |
- dnl |
|
385 |
- dnl **** termcap or terminfo **** |
|
386 |
- dnl |
|
387 |
- AC_CHECKING(for tgetent) |
|
388 |
--AC_TRY_LINK(,tgetent((char *)0, (char *)0);,, |
|
389 |
-+AC_TRY_LINK([ |
|
390 |
-+ #include <curses.h> |
|
391 |
-+ #include <term.h> |
|
392 |
-+], [ |
|
393 |
-+ tgetent((char *)0, (char *)0); |
|
394 |
-+],, |
|
395 |
- olibs="$LIBS" |
|
396 |
- LIBS="-lcurses $olibs" |
|
397 |
- AC_CHECKING(libcurses) |
|
398 |
--AC_TRY_LINK(,[ |
|
399 |
-+AC_TRY_LINK([#include <curses.h> |
|
400 |
-+ #include <term.h> |
|
401 |
-+],[ |
|
402 |
- #ifdef __hpux |
|
403 |
- __sorry_hpux_libcurses_is_totally_broken_in_10_10(); |
|
404 |
- #else |
|
405 |
- tgetent((char *)0, (char *)0); |
|
406 |
- #endif |
|
407 |
- ],, |
|
408 |
- LIBS="-ltermcap $olibs" |
|
409 |
- AC_CHECKING(libtermcap) |
|
410 |
--AC_TRY_LINK(,tgetent((char *)0, (char *)0);,, |
|
411 |
-+AC_TRY_LINK( |
|
412 |
-+[#include <curses.h> |
|
413 |
-+ #include <term.h> |
|
414 |
-+],[ |
|
415 |
-+ tgetent((char *)0, (char *)0); |
|
416 |
-+],, |
|
417 |
- LIBS="-ltermlib $olibs" |
|
418 |
- AC_CHECKING(libtermlib) |
|
419 |
--AC_TRY_LINK(,tgetent((char *)0, (char *)0);,, |
|
420 |
-+AC_TRY_LINK( |
|
421 |
-+[#include <curses.h> |
|
422 |
-+ #include <term.h> |
|
423 |
-+],[ |
|
424 |
-+ tgetent((char *)0, (char *)0); |
|
425 |
-+],, |
|
426 |
- LIBS="-lncursesw $olibs" |
|
427 |
- AC_CHECKING(libncursesw) |
|
428 |
--AC_TRY_LINK(,tgetent((char *)0, (char *)0);,, |
|
429 |
-+AC_TRY_LINK( |
|
430 |
-+[#include <curses.h> |
|
431 |
-+ #include <term.h> |
|
432 |
-+],[ |
|
433 |
-+ tgetent((char *)0, (char *)0); |
|
434 |
-+],, |
|
435 |
- LIBS="-ltinfow $olibs" |
|
436 |
- AC_CHECKING(libtinfow) |
|
437 |
--AC_TRY_LINK(,tgetent((char *)0, (char *)0);,, |
|
438 |
-+AC_TRY_LINK( |
|
439 |
-+[#include <curses.h> |
|
440 |
-+ #include <term.h> |
|
441 |
-+],[ |
|
442 |
-+ tgetent((char *)0, (char *)0); |
|
443 |
-+],, |
|
444 |
- LIBS="-lncurses $olibs" |
|
445 |
- AC_CHECKING(libncurses) |
|
446 |
--AC_TRY_LINK(,tgetent((char *)0, (char *)0);,, |
|
447 |
-+AC_TRY_LINK( |
|
448 |
-+[#include <curses.h> |
|
449 |
-+ #include <term.h> |
|
450 |
-+],[ |
|
451 |
-+ tgetent((char *)0, (char *)0); |
|
452 |
-+],, |
|
453 |
- LIBS="-ltinfo $olibs" |
|
454 |
- AC_CHECKING(libtinfo) |
|
455 |
--AC_TRY_LINK(,tgetent((char *)0, (char *)0);,, |
|
456 |
-+AC_TRY_LINK( |
|
457 |
-+[#include <curses.h> |
|
458 |
-+ #include <term.h> |
|
459 |
-+],[ |
|
460 |
-+ tgetent((char *)0, (char *)0); |
|
461 |
-+],, |
|
462 |
- AC_MSG_ERROR(!!! no tgetent - no screen))))))))) |
|
463 |
- |
|
464 |
- AC_TRY_RUN([ |
|
465 |
-+#include <curses.h> |
|
466 |
-+#include <string.h> |
|
467 |
-+#include <term.h> |
|
468 |
-+ |
|
469 |
-+int |
|
470 |
- main() |
|
471 |
- { |
|
472 |
-- exit(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1); |
|
473 |
-+ return(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1); |
|
474 |
- }], AC_NOTE(- you use the termcap database), |
|
475 |
- AC_NOTE(- you use the terminfo database) AC_DEFINE(TERMINFO), |
|
476 |
- AC_NOTE(- skipping check because we are cross compiling; assuming terminfo database is used) AC_DEFINE(TERMINFO)) |
|
477 |
- AC_CHECKING(ospeed) |
|
478 |
- AC_TRY_LINK(extern short ospeed;,ospeed=5;,,AC_DEFINE(NEED_OSPEED)) |
|
479 |
-@@ -677,11 +748,15 @@ fi |
|
480 |
- |
|
481 |
- if test "$cross_compiling" = no ; then |
|
482 |
- AC_CHECKING(for SVR4 ptys) |
|
483 |
- sysvr4ptys= |
|
484 |
- if test -c /dev/ptmx ; then |
|
485 |
--AC_TRY_LINK([],[ptsname(0);grantpt(0);unlockpt(0);],[AC_DEFINE(HAVE_SVR4_PTYS) |
|
486 |
-+AC_TRY_LINK([ |
|
487 |
-+ #include <stdlib.h> |
|
488 |
-+], [ |
|
489 |
-+ ptsname(0);grantpt(0);unlockpt(0); |
|
490 |
-+],[AC_DEFINE(HAVE_SVR4_PTYS) |
|
491 |
- sysvr4ptys=1]) |
|
492 |
- fi |
|
493 |
- fi |
|
494 |
- |
|
495 |
- AC_CHECK_FUNCS(getpt) |
|
496 |
-@@ -733,33 +808,36 @@ AC_CHECKING(default tty permissions/group) |
|
497 |
- rm -f conftest_grp |
|
498 |
- AC_TRY_RUN([ |
|
499 |
- #include <sys/types.h> |
|
500 |
- #include <sys/stat.h> |
|
501 |
- #include <stdio.h> |
|
502 |
-+#include <stdlib.h> |
|
503 |
-+#include <unistd.h> |
|
504 |
-+int |
|
505 |
- main() |
|
506 |
- { |
|
507 |
- struct stat sb; |
|
508 |
- char *x,*ttyname(); |
|
509 |
- int om, m; |
|
510 |
- FILE *fp; |
|
511 |
- |
|
512 |
-- if (!(x = ttyname(0))) exit(1); |
|
513 |
-- if (stat(x, &sb)) exit(1); |
|
514 |
-+ if (!(x = ttyname(0))) return 1; |
|
515 |
-+ if (stat(x, &sb)) return 1; |
|
516 |
- om = sb.st_mode; |
|
517 |
-- if (om & 002) exit(0); |
|
518 |
-+ if (om & 002) return 0; |
|
519 |
- m = system("mesg y"); |
|
520 |
-- if (m == -1 || m == 127) exit(1); |
|
521 |
-- if (stat(x, &sb)) exit(1); |
|
522 |
-+ if (m == -1 || m == 127) return 1; |
|
523 |
-+ if (stat(x, &sb)) return 1; |
|
524 |
- m = sb.st_mode; |
|
525 |
-- if (chmod(x, om)) exit(1); |
|
526 |
-- if (m & 002) exit(0); |
|
527 |
-- if (sb.st_gid == getgid()) exit(1); |
|
528 |
-+ if (chmod(x, om)) return 1; |
|
529 |
-+ if (m & 002) return 0; |
|
530 |
-+ if (sb.st_gid == getgid()) return 1; |
|
531 |
- if (!(fp=fopen("conftest_grp", "w"))) |
|
532 |
-- exit(1); |
|
533 |
-+ return 1; |
|
534 |
- fprintf(fp, "%d\n", sb.st_gid); |
|
535 |
- fclose(fp); |
|
536 |
-- exit(0); |
|
537 |
-+ return 0; |
|
538 |
- } |
|
539 |
- ],[ |
|
540 |
- if test -f conftest_grp; then |
|
541 |
- ptygrp=`cat conftest_grp` |
|
542 |
- AC_NOTE([- pty mode: $ptymode, group: $ptygrp]) |
|
543 |
-@@ -869,17 +942,25 @@ AC_CHECKING(for libutil(s)) |
|
544 |
- test -f /usr/lib/libutils.a && LIBS="$LIBS -lutils" |
|
545 |
- test -f /usr/lib/libutil.a && LIBS="$LIBS -lutil" |
|
546 |
- fi |
|
547 |
- |
|
548 |
- AC_CHECKING(getloadavg) |
|
549 |
--AC_TRY_LINK(,[getloadavg((double *)0, 0);], |
|
550 |
-+AC_TRY_LINK( |
|
551 |
-+[ |
|
552 |
-+ #include <stdlib.h> |
|
553 |
-+],[ |
|
554 |
-+ getloadavg((double *)0, 0);], |
|
555 |
- AC_DEFINE(LOADAV_GETLOADAVG) load=1, |
|
556 |
- if test "$cross_compiling" = no && test -f /usr/lib/libkvm.a ; then |
|
557 |
- olibs="$LIBS" |
|
558 |
- LIBS="$LIBS -lkvm" |
|
559 |
- AC_CHECKING(getloadavg with -lkvm) |
|
560 |
--AC_TRY_LINK(,[getloadavg((double *)0, 0);], |
|
561 |
-+AC_TRY_LINK( |
|
562 |
-+[ |
|
563 |
-+ #include <stdlib.h> |
|
564 |
-+],[ |
|
565 |
-+ getloadavg((double *)0, 0);], |
|
566 |
- AC_DEFINE(LOADAV_GETLOADAVG) load=1, LIBS="$olibs") |
|
567 |
- fi |
|
568 |
- ) |
|
569 |
- |
|
570 |
- if test -z "$load" ; then |
|
571 |
-@@ -931,10 +1012,11 @@ else |
|
572 |
- |
|
573 |
- $nlist64 |
|
574 |
- |
|
575 |
- struct nlist nl[2]; |
|
576 |
- |
|
577 |
-+int |
|
578 |
- main() |
|
579 |
- { |
|
580 |
- #if !defined(_AUX_SOURCE) && !defined(AUX) |
|
581 |
- # ifdef NLIST_NAME_UNION |
|
582 |
- nl[0].n_un.n_name = "$av"; |
|
583 |
-@@ -944,12 +1026,12 @@ main() |
|
584 |
- #else |
|
585 |
- strncpy(nl[0].n_name, "$av", sizeof(nl[0].n_name)); |
|
586 |
- #endif |
|
587 |
- nlist(LOADAV_UNIX, nl); |
|
588 |
- if (nl[0].n_value == 0) |
|
589 |
-- exit(1); |
|
590 |
-- exit(0); |
|
591 |
-+ return 1; |
|
592 |
-+ return 0; |
|
593 |
- } |
|
594 |
- ],avensym=$av;break) |
|
595 |
- if test "$av" = _Loadavg; then |
|
596 |
- nlist64='#define nlist nlist64' |
|
597 |
- fi |
|
598 |
-@@ -1068,21 +1150,22 @@ void |
|
599 |
- hand() |
|
600 |
- { |
|
601 |
- got++; |
|
602 |
- } |
|
603 |
- |
|
604 |
-+int |
|
605 |
- main() |
|
606 |
- { |
|
607 |
- /* on hpux we use sigvec to get bsd signals */ |
|
608 |
- #ifdef __hpux |
|
609 |
- (void)signal(SIGCLD, hand); |
|
610 |
- kill(getpid(), SIGCLD); |
|
611 |
- kill(getpid(), SIGCLD); |
|
612 |
- if (got < 2) |
|
613 |
-- exit(1); |
|
614 |
-+ return 1; |
|
615 |
- #endif |
|
616 |
-- exit(0); |
|
617 |
-+ return 0; |
|
618 |
- } |
|
619 |
- ],,AC_DEFINE(SYSVSIGS),:) |
|
620 |
- |
|
621 |
- fi |
|
622 |
- |
|
623 |
-@@ -1107,14 +1190,22 @@ oldlibs="$LIBS" |
|
624 |
- LIBS="$LIBS -lsun" |
|
625 |
- AC_CHECKING(IRIX sun library) |
|
626 |
- AC_TRY_LINK(,,,LIBS="$oldlibs") |
|
627 |
- |
|
628 |
- AC_CHECKING(syslog) |
|
629 |
--AC_TRY_LINK(,[closelog();], , [oldlibs="$LIBS" |
|
630 |
-+AC_TRY_LINK( |
|
631 |
-+[#include <syslog.h> |
|
632 |
-+], [ |
|
633 |
-+ closelog(); |
|
634 |
-+], , [oldlibs="$LIBS" |
|
635 |
- LIBS="$LIBS -lbsd" |
|
636 |
- AC_CHECKING(syslog in libbsd.a) |
|
637 |
--AC_TRY_LINK(, [closelog();], AC_NOTE(- found.), [LIBS="$oldlibs" |
|
638 |
-+AC_TRY_LINK( |
|
639 |
-+[#include <syslog.h> |
|
640 |
-+], [ |
|
641 |
-+ closelog(); |
|
642 |
-+], AC_NOTE(- found.), [LIBS="$oldlibs" |
|
643 |
- AC_NOTE(- bad news: syslog missing.) AC_DEFINE(NOSYSLOG)])]) |
|
644 |
- |
|
645 |
- AC_EGREP_CPP(YES_IS_DEFINED, |
|
646 |
- [#ifdef M_UNIX |
|
647 |
- YES_IS_DEFINED; |
|
648 |
-@@ -1147,66 +1238,87 @@ fi |
|
649 |
- dnl AC_CHECK_HEADER(shadow.h, AC_DEFINE(SHADOWPW)) |
|
650 |
- AC_CHECKING(getspnam) |
|
651 |
- AC_TRY_LINK([#include <shadow.h>], [getspnam("x");],AC_DEFINE(SHADOWPW)) |
|
652 |
- |
|
653 |
- AC_CHECKING(getttyent) |
|
654 |
--AC_TRY_LINK(,[getttyent();], AC_DEFINE(GETTTYENT)) |
|
655 |
-+AC_TRY_LINK( |
|
656 |
-+[ |
|
657 |
-+ #include <ttyent.h> |
|
658 |
-+],[ |
|
659 |
-+ getttyent(); |
|
660 |
-+], AC_DEFINE(GETTTYENT)) |
|
661 |
- |
|
662 |
- AC_CHECKING(fdwalk) |
|
663 |
- AC_TRY_LINK([#include <stdlib.h>], [fdwalk(NULL, NULL);],AC_DEFINE(HAVE_FDWALK)) |
|
664 |
- |
|
665 |
- AC_CHECKING(whether memcpy/memmove/bcopy handles overlapping arguments) |
|
666 |
- AC_TRY_RUN([ |
|
667 |
-+#include <string.h> |
|
668 |
-+ |
|
669 |
-+int |
|
670 |
- main() { |
|
671 |
- char buf[10]; |
|
672 |
- strcpy(buf, "abcdefghi"); |
|
673 |
- bcopy(buf, buf + 2, 3); |
|
674 |
- if (strncmp(buf, "ababcf", 6)) |
|
675 |
-- exit(1); |
|
676 |
-+ return 1; |
|
677 |
- strcpy(buf, "abcdefghi"); |
|
678 |
- bcopy(buf + 2, buf, 3); |
|
679 |
- if (strncmp(buf, "cdedef", 6)) |
|
680 |
-- exit(1); |
|
681 |
-- exit(0); /* libc version works properly. */ |
|
682 |
-+ return 1; |
|
683 |
-+ return 0; /* libc version works properly. */ |
|
684 |
- }], AC_DEFINE(USEBCOPY),,:) |
|
685 |
- |
|
686 |
- AC_TRY_RUN([ |
|
687 |
-+#include <string.h> |
|
688 |
-+ |
|
689 |
- #define bcopy(s,d,l) memmove(d,s,l) |
|
690 |
-+int |
|
691 |
- main() { |
|
692 |
- char buf[10]; |
|
693 |
- strcpy(buf, "abcdefghi"); |
|
694 |
- bcopy(buf, buf + 2, 3); |
|
695 |
- if (strncmp(buf, "ababcf", 6)) |
|
696 |
-- exit(1); |
|
697 |
-+ return 1; |
|
698 |
- strcpy(buf, "abcdefghi"); |
|
699 |
- bcopy(buf + 2, buf, 3); |
|
700 |
- if (strncmp(buf, "cdedef", 6)) |
|
701 |
-- exit(1); |
|
702 |
-- exit(0); /* libc version works properly. */ |
|
703 |
-+ return 1; |
|
704 |
-+ return 0; /* libc version works properly. */ |
|
705 |
- }], AC_DEFINE(USEMEMMOVE),, |
|
706 |
- AC_NOTE(- skipping check because we are cross compiling; use memmove) AC_DEFINE(USEMEMMOVE)) |
|
707 |
- |
|
708 |
- |
|
709 |
- AC_TRY_RUN([ |
|
710 |
-+#include <string.h> |
|
711 |
-+ |
|
712 |
- #define bcopy(s,d,l) memcpy(d,s,l) |
|
713 |
-+int |
|
714 |
- main() { |
|
715 |
- char buf[10]; |
|
716 |
- strcpy(buf, "abcdefghi"); |
|
717 |
- bcopy(buf, buf + 2, 3); |
|
718 |
- if (strncmp(buf, "ababcf", 6)) |
|
719 |
-- exit(1); |
|
720 |
-+ return 1; |
|
721 |
- strcpy(buf, "abcdefghi"); |
|
722 |
- bcopy(buf + 2, buf, 3); |
|
723 |
- if (strncmp(buf, "cdedef", 6)) |
|
724 |
-- exit(1); |
|
725 |
-- exit(0); /* libc version works properly. */ |
|
726 |
-+ return 1; |
|
727 |
-+ return 0; /* libc version works properly. */ |
|
728 |
- }], AC_DEFINE(USEMEMCPY),,:) |
|
729 |
- |
|
730 |
- AC_SYS_LONG_FILE_NAMES |
|
731 |
- |
|
732 |
- AC_MSG_CHECKING(for vsprintf) |
|
733 |
--AC_TRY_LINK([#include <stdarg.h>],[va_list valist; vsprintf(0,0,valist);], AC_MSG_RESULT(yes);AC_DEFINE(USEVARARGS), AC_MSG_RESULT(no)) |
|
734 |
-+AC_TRY_LINK( |
|
735 |
-+[ |
|
736 |
-+ #include <stdarg.h> |
|
737 |
-+ #include <stdio.h> |
|
738 |
-+], |
|
739 |
-+[ |
|
740 |
-+ va_list valist; vsprintf(0,0,valist); |
|
741 |
-+], AC_MSG_RESULT(yes);AC_DEFINE(USEVARARGS), AC_MSG_RESULT(no)) |
|
742 |
- |
|
743 |
- AC_HEADER_DIRENT |
|
744 |
- |
|
745 |
- AC_MSG_CHECKING(for setenv) |
|
746 |
- if test -z "$ac_setenv_args"; then |
|
747 |
- |
... | ... |
@@ -3,35 +3,25 @@ From: =?UTF-8?q?Amadeusz=20S=C5=82awi=C5=84ski?= <amade@asmblr.net> |
3 | 3 |
Date: Tue, 5 Apr 2016 12:47:08 +0200 |
4 | 4 |
Subject: [PATCH] check if we have ut_exit in utmpx struct |
5 | 5 |
|
6 |
---- |
|
7 |
- acconfig.h | 5 +++++ |
|
8 |
- configure.ac | 4 ++++ |
|
9 |
- utmp.c | 2 ++ |
|
10 |
- 3 files changed, 11 insertions(+) |
|
11 |
- |
|
12 |
-diff --git a/acconfig.h b/acconfig.h |
|
13 |
-index 656e117..d173c9c 100644 |
|
14 | 6 |
--- a/acconfig.h |
15 | 7 |
+++ b/acconfig.h |
16 |
-@@ -215,6 +215,11 @@ |
|
17 |
- #undef HAVE_UTEMPTER |
|
8 |
+@@ -430,6 +430,11 @@ |
|
9 |
+ */ |
|
10 |
+ #undef BUGGYGETLOGIN |
|
18 | 11 |
|
19 |
- /* |
|
12 |
++/* |
|
20 | 13 |
+ * Define if your utmpx has ut_exit struct |
21 | 14 |
+ */ |
22 | 15 |
+#undef HAVE_UT_EXIT |
23 | 16 |
+ |
24 |
-+/* |
|
17 |
+ /* |
|
25 | 18 |
* If your system has the calls setreuid() and setregid(), |
26 | 19 |
* define HAVE_SETREUID. Otherwise screen will use a forked process to |
27 |
- * safely create output files without retaining any special privileges. |
|
28 |
-diff --git a/configure.ac b/configure.ac |
|
29 |
-index 1a75020..8457619 100644 |
|
30 | 20 |
--- a/configure.ac |
31 | 21 |
+++ b/configure.ac |
32 |
-@@ -374,6 +374,10 @@ if test "$have_utempter" = yes; then |
|
33 |
- AC_DEFINE(HAVE_UTEMPTER) |
|
34 |
- LIBS="$LIBS -lutempter" |
|
22 |
+@@ -438,6 +438,10 @@ AC_NOTE(- you have a broken implementation) AC_DEFINE(BROKEN_PIPE) fifobr=1, |
|
23 |
+ AC_NOTE(- skipping check because we are cross compiling; assuming fifo implementation is ok)) |
|
24 |
+ rm -f /tmp/conftest* |
|
35 | 25 |
fi |
36 | 26 |
+AC_CHECKING(ut_exit) |
37 | 27 |
+AC_TRY_COMPILE([ |
... | ... |
@@ -39,12 +29,10 @@ index 1a75020..8457619 100644 |
39 | 29 |
+],[struct utmpx u; u.ut_exit.e_exit;], AC_DEFINE(HAVE_UT_EXIT)) |
40 | 30 |
|
41 | 31 |
dnl |
42 |
- dnl **** signal handling **** |
|
43 |
-diff --git a/utmp.c b/utmp.c |
|
44 |
-index da8d7ff..c864d07 100644 |
|
32 |
+ dnl **** SOCKET tests **** |
|
45 | 33 |
--- a/utmp.c |
46 | 34 |
+++ b/utmp.c |
47 |
-@@ -381,7 +381,7 @@ static int pututslot(slot_t slot, struct utmpx *u, char *host, Window *win) |
|
35 |
+@@ -607,7 +607,7 @@ makedead(u) |
|
48 | 36 |
struct utmp *u; |
49 | 37 |
{ |
50 | 38 |
u->ut_type = DEAD_PROCESS; |
... | ... |
@@ -10,7 +10,7 @@ HOMEPAGE="https://www.gnu.org/software/screen/" |
10 | 10 |
|
11 | 11 |
if [[ ${PV} != 9999 ]] ; then |
12 | 12 |
SRC_URI="mirror://gnu/${PN}/${P}.tar.gz" |
13 |
- KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ~ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" |
|
13 |
+ KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" |
|
14 | 14 |
else |
15 | 15 |
inherit git-r3 |
16 | 16 |
EGIT_REPO_URI="https://git.savannah.gnu.org/git/screen.git" |
... | ... |
@@ -33,10 +33,7 @@ BDEPEND="sys-apps/texinfo" |
33 | 33 |
PATCHES=( |
34 | 34 |
# Don't use utempter even if it is found on the system. |
35 | 35 |
"${FILESDIR}"/${PN}-4.3.0-no-utempter.patch |
36 |
- "${FILESDIR}"/${PN}-4.6.2-utmp-exit.patch |
|
37 |
- "${FILESDIR}"/${PN}-4.9.0-configure-implicit-function-decls.patch |
|
38 |
- "${FILESDIR}"/${P}-CVE-2023-24626.patch |
|
39 |
- "${FILESDIR}"/${PN}-4.9.0-clang16-chmod.patch |
|
36 |
+ "${FILESDIR}"/${PN}-4.9.1-utmp-exit.patch |
|
40 | 37 |
) |
41 | 38 |
|
42 | 39 |
src_prepare() { |
43 | 40 |