diff options
author | Simo Sorce <simo@redhat.com> | 2012-04-15 14:57:16 -0400 |
---|---|---|
committer | Simo Sorce <simo@redhat.com> | 2012-04-15 15:00:50 -0400 |
commit | 375ed9210ce229ed05e38f92b86488787a60edd7 (patch) | |
tree | 819deb56290a2b248d087f1ffd3619f9bb5a9ba7 /proxy/src | |
parent | 06fed0b0f3e2d1c0f1dfc548ce6f92d87a37a0a0 (diff) | |
download | gss-proxy-375ed9210ce229ed05e38f92b86488787a60edd7.tar.gz gss-proxy-375ed9210ce229ed05e38f92b86488787a60edd7.tar.xz gss-proxy-375ed9210ce229ed05e38f92b86488787a60edd7.zip |
Replace direct syslog calls with logging macros
Diffstat (limited to 'proxy/src')
-rw-r--r-- | proxy/src/gp_config.c | 22 | ||||
-rw-r--r-- | proxy/src/gp_init.c | 4 | ||||
-rw-r--r-- | proxy/src/gp_socket.c | 9 | ||||
-rw-r--r-- | proxy/src/gp_workers.c | 3 |
4 files changed, 15 insertions, 23 deletions
diff --git a/proxy/src/gp_config.c b/proxy/src/gp_config.c index 9336802..bae52e1 100644 --- a/proxy/src/gp_config.c +++ b/proxy/src/gp_config.c @@ -27,7 +27,6 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <syslog.h> #include <errno.h> #include "gp_proxy.h" #include "iniparser.h" @@ -156,8 +155,7 @@ static int load_services(struct gp_config *cfg, dictionary *dict) valnum = get_int_value(dict, secname, "euid"); if (valnum == -1) { /* malformed section, mech is missing */ - syslog(LOG_INFO, - "Euid missing from [%s], ignoring.", secname); + GPDEBUG("Euid missing from [%s], ignoring.", secname); gp_service_free(cfg->svcs[n]); cfg->num_svcs--; continue; @@ -177,8 +175,7 @@ static int load_services(struct gp_config *cfg, dictionary *dict) value = get_char_value(dict, secname, "mechs"); if (value == NULL) { /* malformed section, mech is missing */ - syslog(LOG_INFO, - "Mechs missing from [%s], ignoring.", secname); + GPDEBUG("Mechs missing from [%s], ignoring.", secname); gp_service_free(cfg->svcs[n]); cfg->num_svcs--; continue; @@ -193,13 +190,11 @@ static int load_services(struct gp_config *cfg, dictionary *dict) if (ret == 0) { cfg->svcs[n]->mechs |= GP_CRED_KRB5; } else { - syslog(LOG_INFO, - "Failed to read krb5 config for %s, ignoring.", - secname); + GPDEBUG("Failed to read krb5 config for %s, ignoring.", + secname); } } else { - syslog(LOG_INFO, - "Unknown mech: %s in [%s], ignoring.", + GPDEBUG("Unknown mech: %s in [%s], ignoring.", token, secname); } @@ -207,8 +202,7 @@ static int load_services(struct gp_config *cfg, dictionary *dict) } while (token != NULL); if (cfg->svcs[n]->mechs == 0) { - syslog(LOG_INFO, - "No mechs found for [%s], ignoring.", secname); + GPDEBUG("No mechs found for [%s], ignoring.", secname); gp_service_free(cfg->svcs[n]); cfg->num_svcs--; continue; @@ -217,7 +211,7 @@ static int load_services(struct gp_config *cfg, dictionary *dict) } if (cfg->num_svcs == 0) { - syslog(LOG_ERR, "No service sections configured!"); + GPERROR("No service sections configured!"); return ENOENT; } @@ -309,7 +303,7 @@ struct gp_config *read_config(char *config_file, int opt_daemonize) ret = load_config(cfg); if (ret) { - syslog(LOG_INFO, "Config file not found! Proceeding with defaults."); + GPDEBUG("Config file not found! Proceeding with defaults."); } return cfg; diff --git a/proxy/src/gp_init.c b/proxy/src/gp_init.c index a4a488f..4d5f9db 100644 --- a/proxy/src/gp_init.c +++ b/proxy/src/gp_init.c @@ -75,13 +75,13 @@ void fini_server(void) static void break_loop(verto_ctx *vctx, verto_ev *ev) { - syslog(LOG_WARNING, "Exiting after receiving a signal"); + GPDEBUG("Exiting after receiving a signal"); verto_break(vctx); } static void reload_conf(verto_ctx *vctx, verto_ev *ev) { - syslog(LOG_INFO, "Reloading configuration after receiving a signal"); + GPDEBUG("Reloading configuration after receiving a signal"); /* TODO */ } diff --git a/proxy/src/gp_socket.c b/proxy/src/gp_socket.c index a51119a..b2f15fb 100644 --- a/proxy/src/gp_socket.c +++ b/proxy/src/gp_socket.c @@ -31,7 +31,6 @@ #include <sys/stat.h> #include <sys/socket.h> #include <sys/un.h> -#include <syslog.h> #include <errno.h> #include <netinet/in.h> #include "gp_proxy.h" @@ -161,8 +160,8 @@ int init_unix_socket(const char *file_name) done: if (ret) { - syslog(LOG_ERR, "Failed to create Unix Socket! (%d:%s)", - ret, strerror(ret)); + GPERROR("Failed to create Unix Socket! (%d:%s)", + ret, strerror(ret)); if (fd != -1) { close(fd); fd = -1; @@ -492,8 +491,8 @@ void accept_sock_conn(verto_ctx *vctx, verto_ev *ev) done: if (ret) { - syslog(LOG_WARNING, "Error connecting client: (%d:%s)", - ret, strerror(ret)); + GPERROR("Error connecting client: (%d:%s)", + ret, strerror(ret)); gp_conn_free(conn); } } diff --git a/proxy/src/gp_workers.c b/proxy/src/gp_workers.c index 0e388d6..095dbac 100644 --- a/proxy/src/gp_workers.c +++ b/proxy/src/gp_workers.c @@ -30,7 +30,6 @@ #include <unistd.h> #include <string.h> #include <fcntl.h> -#include <syslog.h> #include <errno.h> #include "gp_proxy.h" @@ -419,7 +418,7 @@ static void *gp_worker_main(void *pvt) /* and wake up dispatcher so it will handle it */ ret = write(t->pool->sig_pipe[1], &dummy, 1); if (ret == -1) { - syslog(LOG_ERR, "Failed to signal dispatcher!"); + GPERROR("Failed to signal dispatcher!"); } } |