Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 252073 Details for
Bug 342601
app-admin/sysklogd-1.4.2_pre20061230-r2 uses incorrect log level due to conflict between C library's syslog()
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Resolve conflict with C library's syslog() and vsyslog(). (fix some typo from previous patch)
sysklogd-1.4.1-resolve-glibc-syslog-conflict.diff (text/plain), 3.97 KB, created by
Dmitriy Matrosov
on 2010-10-26 17:48:54 UTC
(
hide
)
Description:
Resolve conflict with C library's syslog() and vsyslog(). (fix some typo from previous patch)
Filename:
MIME Type:
Creator:
Dmitriy Matrosov
Created:
2010-10-26 17:48:54 UTC
Size:
3.97 KB
patch
obsolete
>diff -Naur ./sysklogd-1.4.1_orig/klogd.c ./sysklogd-1.4.1/klogd.c >--- ./sysklogd-1.4.1_orig/klogd.c 2010-10-25 12:24:07.000000000 +0000 >+++ ./sysklogd-1.4.1/klogd.c 2010-10-26 20:37:04.000000000 +0000 >@@ -246,6 +246,10 @@ > * Thu Apr 29 15:24:07 2004: Solar Designer <solar@openwall.com> > * Prevent potential buffer overflow in reading messages from the > * kernel log rinbuffer. >+ * >+ * Tue Oct 26 20:32:44 GMT 2010 <sgf.dma@gmail.com> >+ * Corresponding corrections due to renaming syslog() and vsyslog() from >+ * syslog.c and moving <stdarg.h> into klogd.h > */ > > >@@ -258,7 +262,6 @@ > #if !defined(__GLIBC__) > #include <linux/time.h> > #endif /* __GLIBC__ */ >-#include <stdarg.h> > #include <paths.h> > #include <stdlib.h> > #include <pwd.h> >@@ -637,7 +640,7 @@ > } > argl += 3; > } >- syslog(priority, fmt, argl); >+ syslog_own(priority, fmt, argl); > va_end(ap); > #ifdef TESTING > putchar('\n'); >@@ -646,7 +649,7 @@ > } > > va_start(ap, fmt); >- vsyslog(priority, fmt, ap); >+ vsyslog_own(priority, fmt, ap); > va_end(ap); > #ifdef TESTING > printf ("\n"); >@@ -1205,7 +1208,7 @@ > } > > if (server_user && drop_root()) { >- syslog(LOG_ALERT, "klogd: failed to drop root"); >+ syslog_own(LOG_ALERT, "klogd: failed to drop root"); > Terminate(); > } > >diff -Naur ./sysklogd-1.4.1_orig/klogd.h ./sysklogd-1.4.1/klogd.h >--- ./sysklogd-1.4.1_orig/klogd.h 1997-06-13 09:35:54.000000000 +0000 >+++ ./sysklogd-1.4.1/klogd.h 2010-10-26 20:39:40.000000000 +0000 >@@ -24,12 +24,17 @@ > * > * Thu Nov 16 12:45:06 CST 1995: Dr. Wettstein > * Initial version. >+ * >+ * Tue Oct 26 20:32:44 GMT 2010 <sgf.dma@gmail.com> >+ * Move <stdarg.h> here from klogd.c in order to declare vsyslog_own() >+ * here. > */ > > /* Useful include files. */ > #include <stdio.h> > #include <syslog.h> > #include <string.h> >+#include <stdarg.h> > > > /* Function prototypes. */ >@@ -38,3 +43,5 @@ > extern char * ExpandKadds(char *, char *); > extern void SetParanoiaLevel(int); > extern void Syslog(int priority, char *fmt, ...); >+extern void syslog_own(int, const char *, ...); >+extern void vsyslog_own(int, const char *, va_list); >diff -Naur ./sysklogd-1.4.1_orig/ksym_mod.c ./sysklogd-1.4.1/ksym_mod.c >--- ./sysklogd-1.4.1_orig/ksym_mod.c 2010-10-25 12:24:08.000000000 +0000 >+++ ./sysklogd-1.4.1/ksym_mod.c 2010-10-26 20:42:04.000000000 +0000 >@@ -83,6 +83,9 @@ > * Removed references to <linux/module.h> since it doesn't work > * anymore with its recent content from Linux 2.4/2.6, created > * module.h locally instead. >+ * >+ * Tue Oct 26 20:32:44 GMT 2010 <sgf.dma@gmail.com> >+ * Remove <stdarg.h> because it included from klogd.h. > */ > > >@@ -95,7 +98,6 @@ > #include <sys/fcntl.h> > #include <sys/stat.h> > #include "module.h" >-#include <stdarg.h> > #include <paths.h> > #include <linux/version.h> > >diff -Naur ./sysklogd-1.4.1_orig/syslog.c ./sysklogd-1.4.1/syslog.c >--- ./sysklogd-1.4.1_orig/syslog.c 2010-10-25 12:23:46.000000000 +0000 >+++ ./sysklogd-1.4.1/syslog.c 2010-10-26 20:37:04.000000000 +0000 >@@ -50,6 +50,10 @@ > * Wed Aug 27 17:48:16 CEST 2003: Martin Schulze <joey@Infodrom.org> > * Improved patch by Michael Pomraning <mjp@securepipe.com> to > * reconnect klogd to the logger after it went away. >+ * >+ * Tue Oct 26 20:32:44 GMT 2010 <sgf.dma@gmail.com> >+ * Rename syslog() and vsyslog() to avoid conflicts with corresponding >+ * C library's functions. > */ > > #include <sys/types.h> >@@ -75,6 +79,10 @@ > > #define _PATH_LOGNAME "/dev/log" > >+ >+void syslog_own(int, const char *, ...); >+void vsyslog_own(int, const char *, va_list); >+ > static int LogFile = -1; /* fd for log */ > static int connected; /* have done connect */ > static int LogStat = 0; /* status bits, set by openlog() */ >@@ -82,17 +90,17 @@ > static int LogFacility = LOG_USER; /* default facility code */ > > void >-syslog(int pri, const char *fmt, ...) >+syslog_own(int pri, const char *fmt, ...) > { > va_list ap; > > va_start(ap, fmt); >- vsyslog(pri, fmt, ap); >+ vsyslog_own(pri, fmt, ap); > va_end(ap); > } > > void >-vsyslog(pri, fmt, ap) >+vsyslog_own(pri, fmt, ap) > int pri; > const char *fmt; > va_list ap;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 342601
:
252063
| 252073