Created
December 17, 2012 08:53
-
-
Save thwarted/4316789 to your computer and use it in GitHub Desktop.
lame attempt at redirecting syslog to stderr with LD_PRELOAD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <stdlib.h> | |
| #include <stdarg.h> | |
| void openlog(const char *ident, int option, int facility) { | |
| return; | |
| } | |
| void syslog(int priority, const char *format, ...) { | |
| va_list va; | |
| va_start(va, format); | |
| vfprintf(stderr, format, va); | |
| va_end(va); | |
| } | |
| void closelog(void) { | |
| return; | |
| } | |
| /* gcc -fPIC -shared -Wl,-soname,libsyslogtostderr.so.1 -ldl -o libsyslogtostderr.so.1.0 */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment