diff options
Diffstat (limited to 'proxy/src')
-rw-r--r-- | proxy/src/gp_common.h | 1 | ||||
-rw-r--r-- | proxy/src/gp_init.c | 5 | ||||
-rw-r--r-- | proxy/src/gp_log.c | 33 | ||||
-rw-r--r-- | proxy/src/gp_log.h | 36 |
4 files changed, 71 insertions, 4 deletions
diff --git a/proxy/src/gp_common.h b/proxy/src/gp_common.h index 89c7827..981eb75 100644 --- a/proxy/src/gp_common.h +++ b/proxy/src/gp_common.h @@ -27,6 +27,7 @@ #define _GP_COMMON_H_ #include "gp_debug.h" +#include "gp_log.h" /* add element to list head */ #define LIST_ADD(list, elem) do { \ diff --git a/proxy/src/gp_init.c b/proxy/src/gp_init.c index 6c9c5ef..a4a488f 100644 --- a/proxy/src/gp_init.c +++ b/proxy/src/gp_init.c @@ -27,7 +27,6 @@ #include <sys/types.h> #include <sys/stat.h> #include <locale.h> -#include <syslog.h> #include <signal.h> #include "gp_proxy.h" @@ -66,9 +65,7 @@ void init_server(bool daemonize) /* Set up neutral locale */ setlocale(LC_ALL, ""); - openlog("gssproxy", - LOG_CONS|LOG_NDELAY|LOG_NOWAIT|LOG_PERROR|LOG_PID, - LOG_AUTHPRIV); + gp_logging_init(); } void fini_server(void) diff --git a/proxy/src/gp_log.c b/proxy/src/gp_log.c new file mode 100644 index 0000000..31006f6 --- /dev/null +++ b/proxy/src/gp_log.c @@ -0,0 +1,33 @@ +/* + GSS-PROXY + + Copyright (C) 2012 Red Hat, Inc. + Copyright (C) 2012 Simo Sorce <simo.sorce@redhat.com> + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +#include "gp_log.h" + +void gp_logging_init(void) +{ + openlog("gssproxy", + LOG_CONS|LOG_NDELAY|LOG_NOWAIT|LOG_PERROR|LOG_PID, + LOG_AUTHPRIV); +} diff --git a/proxy/src/gp_log.h b/proxy/src/gp_log.h new file mode 100644 index 0000000..f3549d1 --- /dev/null +++ b/proxy/src/gp_log.h @@ -0,0 +1,36 @@ +/* + GSS-PROXY + + Copyright (C) 2012 Red Hat, Inc. + Copyright (C) 2012 Simo Sorce <simo.sorce@redhat.com> + + Permission is hereby granted, free of charge, to any person obtaining a + copy of this software and associated documentation files (the "Software"), + to deal in the Software without restriction, including without limitation + the rights to use, copy, modify, merge, publish, distribute, sublicense, + and/or sell copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. +*/ + +#ifndef _GP_LOG_H_ +#define _GP_LOG_H_ + +#include <syslog.h> + +#define GPERROR(...) syslog(LOG_ERR, __VA_ARGS__); +#define GPAUDIT(...) syslog(LOG_INFO, __VA_ARGS__); + +void gp_logging_init(void); + +#endif /* _GP_LOG_H_ */ |