From f0fba6ec25482b9922e4c627cbffae08f54a6d31 Mon Sep 17 00:00:00 2001 From: Art Cancro Date: Mon, 17 Jan 2011 12:48:20 -0500 Subject: [PATCH] Fixed bugs related to last three commits Conflicts: webcit/auth.c webcit/openid.c webcit/sysdep.c webcit/tcp_sockets.c --- citadel/textclient/citadel.c | 15 --------------- webcit/auth.c | 2 +- webcit/openid.c | 6 +++--- webcit/sysdep.c | 10 +++++----- webcit/tcp_sockets.c | 2 +- 5 files changed, 10 insertions(+), 25 deletions(-) diff --git a/citadel/textclient/citadel.c b/citadel/textclient/citadel.c index 94ca65341..ef2685eda 100644 --- a/citadel/textclient/citadel.c +++ b/citadel/textclient/citadel.c @@ -127,21 +127,6 @@ CtdlIPC *ipc_for_signal_handlers; /* KLUDGE cover your eyes */ int enable_syslog = 0; -/* - * syslog() ... Write logging information; - * simple here to have the same - * symbols in the client. - */ - -void syslog(enum LogLevel loglevel, const char *format, ...) { - va_list arg_ptr; - - va_start(arg_ptr, format); - vfprintf(stderr, format, arg_ptr); - va_end(arg_ptr); - fflush(stderr); -} - /* * here is our 'clean up gracefully and exit' routine */ diff --git a/webcit/auth.c b/webcit/auth.c index 80f7ddbb0..d35df874c 100644 --- a/webcit/auth.c +++ b/webcit/auth.c @@ -322,7 +322,7 @@ void do_openid_login(void) serv_puts(buf); serv_getln(buf, sizeof buf); if (buf[0] == '2') { - lprintf(CTDL_DEBUG, "OpenID server contacted; redirecting to %s\n", &buf[4]); + syslog(LOG_DEBUG, "OpenID server contacted; redirecting to %s\n", &buf[4]); http_redirect(&buf[4]); return; } diff --git a/webcit/openid.c b/webcit/openid.c index efe4280ca..ff358e347 100644 --- a/webcit/openid.c +++ b/webcit/openid.c @@ -64,7 +64,7 @@ void openid_attach(void) { if (havebstr("attach_button")) { - lprintf(CTDL_DEBUG, "Attempting to attach %s\n", bstr("openid_url")); + syslog(LOG_DEBUG, "Attempting to attach %s\n", bstr("openid_url")); snprintf(buf, sizeof buf, "OIDS %s|%s/finalize_openid_login|%s", @@ -76,12 +76,12 @@ void openid_attach(void) { serv_puts(buf); serv_getln(buf, sizeof buf); if (buf[0] == '2') { - lprintf(CTDL_DEBUG, "OpenID server contacted; redirecting to %s\n", &buf[4]); + syslog(LOG_DEBUG, "OpenID server contacted; redirecting to %s\n", &buf[4]); http_redirect(&buf[4]); return; } else { - lprintf(CTDL_DEBUG, "OpenID attach failed: %s\n", &buf[4]); + syslog(LOG_DEBUG, "OpenID attach failed: %s\n", &buf[4]); } } diff --git a/webcit/sysdep.c b/webcit/sysdep.c index 0657b8110..47487177e 100644 --- a/webcit/sysdep.c +++ b/webcit/sysdep.c @@ -1,7 +1,7 @@ /* * WebCit "system dependent" code. * - * Copyright (c) 1996-2010 by the citadel.org team + * Copyright (c) 1996-2011 by the citadel.org team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -524,18 +524,18 @@ void drop_root(uid_t UID) #endif // HAVE_GETPWUID_R if (pwp == NULL) - lprintf(CTDL_CRIT, "WARNING: getpwuid(%ld): %s\n" + syslog(LOG_CRIT, "WARNING: getpwuid(%ld): %s\n" "Group IDs will be incorrect.\n", UID, strerror(errno)); else { initgroups(pw.pw_name, pw.pw_gid); if (setgid(pw.pw_gid)) - lprintf(CTDL_CRIT, "setgid(%ld): %s\n", (long)pw.pw_gid, + syslog(LOG_CRIT, "setgid(%ld): %s\n", (long)pw.pw_gid, strerror(errno)); } - lprintf(CTDL_INFO, "Changing uid to %ld\n", (long)UID); + syslog(LOG_INFO, "Changing uid to %ld\n", (long)UID); if (setuid(UID) != 0) { - lprintf(CTDL_CRIT, "setuid() failed: %s\n", strerror(errno)); + syslog(LOG_CRIT, "setuid() failed: %s\n", strerror(errno)); } #if defined (HAVE_SYS_PRCTL_H) && defined (PR_SET_DUMPABLE) prctl(PR_SET_DUMPABLE, 1); diff --git a/webcit/tcp_sockets.c b/webcit/tcp_sockets.c index 696dfc3ae..b9849f339 100644 --- a/webcit/tcp_sockets.c +++ b/webcit/tcp_sockets.c @@ -738,7 +738,7 @@ long end_burst(void) if (CompressBuffer(WCC->WBuf) > 0) hprintf("Content-encoding: gzip\r\n"); else { - lprintf(CTDL_ALERT, "Compression failed: %d [%s] sending uncompressed\n", errno, strerror(errno)); + syslog(LOG_ALERT, "Compression failed: %d [%s] sending uncompressed\n", errno, strerror(errno)); wc_backtrace(); } } -- 2.30.2