Fri, 03 Aug 2012 20:11:53 +0200
Neutralize buggy code causing OpenPKG to have 'fatal problems' in
spite of correct installation, configuration, and operation. An
administrator suffering from this failure is even unable to
uninstall the flawed software.
1 Index: terminal.c
2 --- terminal.c.orig 1988-11-26 01:40:43.000000000 +0100
3 +++ terminal.c 2009-01-09 18:15:47.583499911 +0100
4 @@ -6,11 +6,11 @@
5 /*
6 * Routines in terminal abstraction:
7 *
8 - * set_term()
9 + * set_cb_term()
10 * Initialize terminal, clear the screen.
11 *
12 - * unset_term()
13 - * Return terminal to state before set_term().
14 + * unset_cb_term()
15 + * Return terminal to state before set_cb_term().
16 *
17 * char2sym(char)
18 * Return the symbol used to display the given char in the
19 @@ -97,6 +97,14 @@
20 */
23 +#include <stdio.h>
24 +#include <stdlib.h>
25 +#include <termios.h>
26 +#if (defined(sun) && defined(__svr4__))
27 +#include <sys/ttold.h>
28 +#else
29 +#include <sys/ioctl.h>
30 +#endif
31 #include <curses.h>
32 #include <sgtty.h>
33 #include <strings.h>
34 @@ -216,7 +224,7 @@
35 * and termcap subroutine packages, although the old code is used
36 * for screen refresh.
37 */
38 -set_term()
39 +set_cb_term()
40 {
41 printf("\n\nInitializing terminal ...");
42 fflush(stdout);
43 @@ -609,7 +617,7 @@
45 /* Restore the terminal to its original mode.
46 */
47 -unset_term()
48 +unset_cb_term()
49 {
50 enter_mode(SMNORMAL);
51 Puts(end_kp); /* Can't tell if this is original. */
52 Index: tritab.c
53 --- tritab.c.orig 1988-11-26 01:39:37.000000000 +0100
54 +++ tritab.c 2009-01-09 17:44:48.411457903 +0100
55 @@ -4,6 +4,7 @@
57 #include <math.h>
58 #include <stdio.h>
59 +#include <stdlib.h>
60 #include "window.h"
61 #include "specs.h"
62 #include "cipher.h"
63 Index: cipher.c
64 --- cipher.c.orig 1988-11-26 01:40:22.000000000 +0100
65 +++ cipher.c 2009-01-09 17:54:12.811182642 +0100
66 @@ -6,6 +6,7 @@
69 #include <stdio.h>
70 +#include <stdlib.h>
71 #include <math.h>
72 #include "window.h"
73 #include "specs.h"
74 Index: start.c
75 --- start.c.orig 1988-11-26 01:39:45.000000000 +0100
76 +++ start.c 2009-01-09 18:05:43.601774154 +0100
77 @@ -11,6 +11,7 @@
80 #include <stdio.h>
81 +#include <stdlib.h>
82 #include <signal.h>
83 #include <setjmp.h>
84 #include "window.h"
85 @@ -109,13 +110,13 @@
86 {
87 setcursor(MAXHEIGHT, 1);
88 fflush(stdout);
89 - unset_term();
90 + unset_cb_term();
92 kill(getpid(), SIGSTOP);
94 /* Return here when/if program restarted. */
95 /* Note that the signal mask is restored by longjmp. */
96 - set_term();
97 + set_cb_term();
98 longjmp(saved_stack, 0);
99 }
101 @@ -128,7 +129,7 @@
102 setcursor(MAXHEIGHT, 1);
103 printf("\n");
104 fflush(stdout);
105 - unset_term();
106 + unset_cb_term();
108 kill(getpid(), SIGKILL);
109 }
110 @@ -192,7 +193,7 @@
111 done(status)
112 int status;
113 {
114 - unset_term();
115 + unset_cb_term();
116 printf("\n");
117 exit(status);
118 }
119 Index: stats.c
120 --- stats.c.orig 1988-11-26 01:40:42.000000000 +0100
121 +++ stats.c 2009-01-09 17:54:22.235822458 +0100
122 @@ -7,6 +7,7 @@
125 #include <stdio.h>
126 +#include <stdlib.h>
127 #include <math.h>
128 #include "window.h"
129 #include "specs.h"
130 Index: cdblocks.c
131 --- cblocks.c.orig 1988-11-26 01:39:27.000000000 +0100
132 +++ cblocks.c 2009-01-09 17:58:13.630695396 +0100
133 @@ -10,6 +10,7 @@
136 #include <stdio.h>
137 +#include <stdlib.h>
138 #include "window.h"
139 #include "layout.h"
140 #include "specs.h"
141 Index: perm.c
142 --- perm.c.orig 1988-11-26 01:39:44.000000000 +0100
143 +++ perm.c 2009-01-09 17:58:19.870669485 +0100
144 @@ -7,6 +7,7 @@
147 #include <stdio.h>
148 +#include <stdlib.h>
149 #include "window.h"
150 #include "specs.h"