1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
|
diff -Nru mgetty-1.1.36.orig/Makefile mgetty-1.1.36/Makefile
--- mgetty-1.1.36.orig/Makefile 2009-08-22 10:37:19.000000000 +0200
+++ mgetty-1.1.36/Makefile 2009-08-22 10:43:31.000000000 +0200
@@ -617,15 +617,15 @@
# fax spool directories
#
test -d $(spool) || \
- ( mkdir $(spool) && chmod 755 $(spool) )
+ ( ./mkidirs $(spool) && chmod 755 $(spool) )
test -d $(FAX_SPOOL) || \
- ( mkdir $(FAX_SPOOL) && \
+ ( ./mkidirs $(FAX_SPOOL) && \
chown $(FAX_OUT_USER) $(FAX_SPOOL) && \
chmod 755 $(FAX_SPOOL) )
test -d $(FAX_SPOOL_IN) || \
- ( mkdir $(FAX_SPOOL_IN) && chmod 755 $(FAX_SPOOL_IN) )
+ ( ./mkidirs $(FAX_SPOOL_IN) && chmod 755 $(FAX_SPOOL_IN) )
test -d $(FAX_SPOOL_OUT) || \
- mkdir $(FAX_SPOOL_OUT)
+ ./mkidirs $(FAX_SPOOL_OUT)
chown $(FAX_OUT_USER) $(FAX_SPOOL_OUT)
chmod 755 $(FAX_SPOOL_OUT)
#
diff -Nru mgetty-1.1.36.orig/doc/Makefile mgetty-1.1.36/doc/Makefile
--- mgetty-1.1.36.orig/doc/Makefile 2009-08-22 09:25:53.000000000 +0200
+++ mgetty-1.1.36/doc/Makefile 2009-08-22 09:35:54.000000000 +0200
@@ -63,7 +63,7 @@
*.man *.[1-9] mgetty.texi
install: $(MANSRC) mgetty.info
- -mkdir `dirname $(MAN1DIR)` $(MAN1DIR) $(MAN4DIR) $(MAN5DIR) $(MAN8DIR) 2>/dev/null
+ mkdir -p $(MAN1DIR) $(MAN4DIR) $(MAN5DIR) $(MAN8DIR)
for i in $(MAN1PAGES) ; do \
$(INSTALL) -m 644 $$i $(MAN1DIR) ; \
done
@@ -120,16 +120,16 @@
#
.SUFFIXES: .1in .4in .5in .8in .1 .4 .5 .8
-.1in.1:
+.1in.1: ../sedscript
../sedscript <$< >$*.1
-.4in.4:
+.4in.4: ../sedscript
../sedscript <$< >$*.4
-.5in.5:
+.5in.5: ../sedscript
../sedscript <$< >$*.5
-.8in.8:
+.8in.8: ../sedscript
../sedscript <$< >$*.8
#
diff -Nru mgetty-1.1.36.orig/frontends/www/Makefile mgetty-1.1.36/frontends/www/Makefile
--- mgetty-1.1.36.orig/frontends/www/Makefile 2006-02-22 18:25:32.000000000 +0100
+++ mgetty-1.1.36/frontends/www/Makefile 2009-08-22 09:39:03.000000000 +0200
@@ -125,12 +125,12 @@
#
.SUFFIXES: .in .cgi .html
-.in.cgi:
+.in.cgi: ../../sedscript
rm -f $*.cgi
../../sedscript <$< >$*.cgi
chmod +x $*.cgi
-.in.html:
+.in.html: ../../sedscript
rm -f $*.html
../../sedscript <$< | \
sed -e "s!@CGI_HREF@!$(CGI_HREF)!" >$*.html
diff -Nru mgetty-1.1.36.orig/fax/Makefile mgetty-1.1.36/fax/Makefile
--- mgetty-1.1.36.orig/fax/Makefile 2006-02-22 19:25:30.000000000 +0200
+++ mgetty-1.1.36/fax/Makefile 2007-09-14 23:02:58.000000000 +0300
@@ -36,7 +36,7 @@
@cd .. ; $(MAKE) sedscript
faxq-helper: faxq-helper.o
- $(CC) $(CFLAGS) -o faxq-helper faxq-helper.o
+ $(CC) $(LDLAGS) -o faxq-helper faxq-helper.o
faxq-helper.o: faxq-helper.c ../sedscript
$(CC) $(CFLAGS) -DFAX_SPOOL_OUT=\"$(FAX_SPOOL_OUT)\" \
diff -Nru mgetty-1.1.36.orig/fax_lib.h mgetty-1.1.36/fax_lib.h
--- mgetty-1.1.36.orig/fax_lib.h 2007-06-15 09:44:36.000000000 +0300
+++ mgetty-1.1.36/fax_lib.h 2007-09-14 22:29:47.000000000 +0300
@@ -41,6 +41,7 @@
int fax_set_fdcc _PROTO(( int fd, int fine, int maxsp, int minsp ));
int fax_set_bor _PROTO(( int fd, int bit_order ));
int fax_set_flowcontrol _PROTO(( int fd, int hw_flow ));
+void fax_init_swaptable _PROTO(( int direct, unsigned char byte_tab[] ));
int mdm_identify _PROTO(( int fd ));
void fax2_incoming_nsf _PROTO(( char * nsf_hex ));
void fax1_incoming_nsf _PROTO(( uch * nsf_bin, int len ));
diff -Nru mgetty-1.1.36.orig/logfile.c mgetty-1.1.36/logfile.c
--- mgetty-1.1.36.orig/logfile.c 2005-11-26 15:48:16.000000000 +0200
+++ mgetty-1.1.36/logfile.c 2007-09-14 22:25:13.000000000 +0300
@@ -58,10 +58,10 @@
/* Most systems have these variables but do not declare them. On many
of those systems that _do_ declare them, it won't hurt */
-#if !defined(__NetBSD__) && !defined( __FreeBSD__ ) && !defined(__OpenBSD__) && !defined(__GLIBC__) && !defined(__MACH__)
+/*#if !defined(__NetBSD__) && !defined( __FreeBSD__ ) && !defined(__OpenBSD__) && !defined(__GLIBC__) && !defined(__MACH__)
extern int sys_nerr;
extern char *sys_errlist[];
-#endif
+#endif*/
/* Interactive Unix is a little bit braindead - does not have atexit(),
*/
@@ -211,6 +211,7 @@
va_list pvar;
int errnr;
char * p;
+char *error_string;
static int first_open = TRUE;
if ( level > log_level ) /* log level high enough? */
@@ -327,12 +328,20 @@
}
else /* ERROR or FATAL */
{
+ error_string = strerror (errnr);
+ if ( error_string == NULL )
+ {
+ if ( errno == EINVAL )
+ error_string = "<error not in list>";
+ else
+ error_string = "<error calling strerror()>";
+ }
+
fprintf(log_fp, "\n%02d/%02d %02d:%02d:%02d %s %s: %s",
tm->tm_mon+1, tm->tm_mday,
tm->tm_hour, tm->tm_min, tm->tm_sec,
log_infix, ws,
- ( errnr <= sys_nerr ) ? sys_errlist[errnr]:
- "<error not in list>" );
+ strerror (errnr));
#ifdef SYSLOG
syslog( level == L_FATAL? LOG_ALERT: LOG_ERR, "%s: %m", ws );
#endif
diff -Nru mgetty-1.1.36.orig/t/t_g3f_c.c mgetty-1.1.36/t/t_g3f_c.c
--- mgetty-1.1.36.orig/t/t_g3f_c.c 2007-05-05 15:03:03.000000000 +0300
+++ mgetty-1.1.36/t/t_g3f_c.c 2007-09-14 22:26:36.000000000 +0300
@@ -19,6 +19,7 @@
#include "fax_lib.h"
#include <stdio.h>
+#include <unistd.h>
#include <signal.h>
#include <errno.h>
#include <stdlib.h>
diff -Nru mgetty-1.1.36.orig/t/t_ring.c mgetty-1.1.36/t/t_ring.c
--- mgetty-1.1.36.orig/t/t_ring.c 2005-03-23 11:56:21.000000000 +0200
+++ mgetty-1.1.36/t/t_ring.c 2007-09-14 22:25:07.000000000 +0300
@@ -24,6 +24,7 @@
#include "mgetty.h"
#include <stdio.h>
+#include <string.h>
#include <signal.h>
#include <errno.h>
#ifdef T_LOG_VERBOSE
|