Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 342601 | Differences between
and this patch

Collapse All | Expand All

(-)./sysklogd-1.4.1_orig/klogd.c (-4 / +7 lines)
Lines 246-251 Link Here
246
 * Thu Apr 29 15:24:07 2004: Solar Designer <solar@openwall.com>
246
 * Thu Apr 29 15:24:07 2004: Solar Designer <solar@openwall.com>
247
 *	Prevent potential buffer overflow in reading messages from the
247
 *	Prevent potential buffer overflow in reading messages from the
248
 *	kernel log rinbuffer.
248
 *	kernel log rinbuffer.
249
 *
250
 * Tue Oct 26 20:32:44 GMT 2010 <sgf.dma@gmail.com>
251
 * 	Corresponding corrections due to renaming syslog() and vsyslog() from
252
 * 	syslog.c and moving <stdarg.h> into klogd.h
249
 */
253
 */
250
254
251
255
Lines 258-264 Link Here
258
#if !defined(__GLIBC__)
262
#if !defined(__GLIBC__)
259
#include <linux/time.h>
263
#include <linux/time.h>
260
#endif /* __GLIBC__ */
264
#endif /* __GLIBC__ */
261
#include <stdarg.h>
262
#include <paths.h>
265
#include <paths.h>
263
#include <stdlib.h>
266
#include <stdlib.h>
264
#include <pwd.h>
267
#include <pwd.h>
Lines 637-643 Link Here
637
			}
640
			}
638
			argl += 3;
641
			argl += 3;
639
		}
642
		}
640
		syslog(priority, fmt, argl);
643
		syslog_own(priority, fmt, argl);
641
		va_end(ap);
644
		va_end(ap);
642
#ifdef TESTING
645
#ifdef TESTING
643
		putchar('\n');
646
		putchar('\n');
Lines 646-652 Link Here
646
	}
649
	}
647
650
648
	va_start(ap, fmt);
651
	va_start(ap, fmt);
649
	vsyslog(priority, fmt, ap);
652
	vsyslog_own(priority, fmt, ap);
650
	va_end(ap);
653
	va_end(ap);
651
#ifdef TESTING
654
#ifdef TESTING
652
	printf ("\n");
655
	printf ("\n");
Lines 1205-1211 Link Here
1205
	}
1208
	}
1206
1209
1207
	if (server_user && drop_root()) {
1210
	if (server_user && drop_root()) {
1208
		syslog(LOG_ALERT, "klogd: failed to drop root");
1211
		syslog_own(LOG_ALERT, "klogd: failed to drop root");
1209
		Terminate();
1212
		Terminate();
1210
	}
1213
	}
1211
1214
(-)./sysklogd-1.4.1_orig/klogd.h (+7 lines)
Lines 24-35 Link Here
24
 *
24
 *
25
 * Thu Nov 16 12:45:06 CST 1995:  Dr. Wettstein
25
 * Thu Nov 16 12:45:06 CST 1995:  Dr. Wettstein
26
 *	Initial version.
26
 *	Initial version.
27
 *
28
 * Tue Oct 26 20:32:44 GMT 2010 <sgf.dma@gmail.com>
29
 * 	Move <stdarg.h> here from klogd.c in order to declare vsyslog_own()
30
 * 	here.
27
 */
31
 */
28
32
29
/* Useful include files. */
33
/* Useful include files. */
30
#include <stdio.h>
34
#include <stdio.h>
31
#include <syslog.h>
35
#include <syslog.h>
32
#include <string.h>
36
#include <string.h>
37
#include <stdarg.h>
33
38
34
39
35
/* Function prototypes. */
40
/* Function prototypes. */
Lines 38-40 Link Here
38
extern char * ExpandKadds(char *, char *);
43
extern char * ExpandKadds(char *, char *);
39
extern void SetParanoiaLevel(int);
44
extern void SetParanoiaLevel(int);
40
extern void Syslog(int priority, char *fmt, ...);
45
extern void Syslog(int priority, char *fmt, ...);
46
extern void syslog_own(int, const char *, ...);
47
extern void vsyslog_own(int, const char *, va_list);
(-)./sysklogd-1.4.1_orig/ksym_mod.c (-1 / +3 lines)
Lines 83-88 Link Here
83
 *	Removed references to <linux/module.h> since it doesn't work
83
 *	Removed references to <linux/module.h> since it doesn't work
84
 *	anymore with its recent content from Linux 2.4/2.6, created
84
 *	anymore with its recent content from Linux 2.4/2.6, created
85
 *	module.h locally instead.
85
 *	module.h locally instead.
86
 *
87
 * Tue Oct 26 20:32:44 GMT 2010 <sgf.dma@gmail.com>
88
 * 	Remove <stdarg.h> because it included from klogd.h.
86
 */
89
 */
87
90
88
91
Lines 95-101 Link Here
95
#include <sys/fcntl.h>
98
#include <sys/fcntl.h>
96
#include <sys/stat.h>
99
#include <sys/stat.h>
97
#include "module.h"
100
#include "module.h"
98
#include <stdarg.h>
99
#include <paths.h>
101
#include <paths.h>
100
#include <linux/version.h>
102
#include <linux/version.h>
101
103
(-)./sysklogd-1.4.1_orig/syslog.c (-3 / +11 lines)
Lines 50-55 Link Here
50
 * Wed Aug 27 17:48:16 CEST 2003: Martin Schulze <joey@Infodrom.org>
50
 * Wed Aug 27 17:48:16 CEST 2003: Martin Schulze <joey@Infodrom.org>
51
 *	Improved patch by Michael Pomraning <mjp@securepipe.com> to
51
 *	Improved patch by Michael Pomraning <mjp@securepipe.com> to
52
 *	reconnect klogd to the logger after it went away.
52
 *	reconnect klogd to the logger after it went away.
53
 *
54
 * Tue Oct 26 20:32:44 GMT 2010 <sgf.dma@gmail.com>
55
 * 	Rename syslog() and vsyslog() to avoid conflicts with corresponding
56
 * 	C library's functions.
53
 */
57
 */
54
58
55
#include <sys/types.h>
59
#include <sys/types.h>
Lines 75-80 Link Here
75
79
76
#define	_PATH_LOGNAME	"/dev/log"
80
#define	_PATH_LOGNAME	"/dev/log"
77
81
82
83
void syslog_own(int, const char *, ...);
84
void vsyslog_own(int, const char *, va_list);
85
78
static int	LogFile = -1;		/* fd for log */
86
static int	LogFile = -1;		/* fd for log */
79
static int	connected;		/* have done connect */
87
static int	connected;		/* have done connect */
80
static int	LogStat = 0;		/* status bits, set by openlog() */
88
static int	LogStat = 0;		/* status bits, set by openlog() */
Lines 82-98 Link Here
82
static int	LogFacility = LOG_USER;	/* default facility code */
90
static int	LogFacility = LOG_USER;	/* default facility code */
83
91
84
void
92
void
85
syslog(int pri, const char *fmt, ...)
93
syslog_own(int pri, const char *fmt, ...)
86
{
94
{
87
	va_list ap;
95
	va_list ap;
88
96
89
	va_start(ap, fmt);
97
	va_start(ap, fmt);
90
	vsyslog(pri, fmt, ap);
98
	vsyslog_own(pri, fmt, ap);
91
	va_end(ap);
99
	va_end(ap);
92
}
100
}
93
101
94
void
102
void
95
vsyslog(pri, fmt, ap)
103
vsyslog_own(pri, fmt, ap)
96
	int pri;
104
	int pri;
97
	const char *fmt;
105
	const char *fmt;
98
	va_list ap;
106
	va_list ap;

Return to bug 342601