From c50904d3d0dbc95588eccdf147d9e33b6edece58 Mon Sep 17 00:00:00 2001 From: Miloslav Trmač Date: Tue, 24 Jul 2012 14:04:33 +0200 Subject: Initialize [UG]ID to "no value cached" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now syslog () without openlog () will include a correct [UG]ID value instead of 0. Also reset the cache on closelog (). Signed-off-by: Miloslav Trmač --- lib/umberlog.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/umberlog.c') diff --git a/lib/umberlog.c b/lib/umberlog.c index 7231065..877818a 100644 --- a/lib/umberlog.c +++ b/lib/umberlog.c @@ -77,7 +77,7 @@ static struct } ul_process_data = { PTHREAD_MUTEX_INITIALIZER, 0, LOG_USER, NULL, - -1, 0, 0, { 0, } + -1, (uid_t)-1, (gid_t)-1, { 0, } }; static __thread ul_buffer_t ul_buffer; @@ -134,8 +134,8 @@ ul_closelog (void) ul_process_data.ident = NULL; ul_process_data.pid = -1; - ul_process_data.gid = 0; - ul_process_data.uid = 0; + ul_process_data.gid = (gid_t)-1; + ul_process_data.uid = (uid_t)-1; ul_process_data.hostname[0] = '\0'; pthread_mutex_unlock (&ul_process_data.lock); } -- cgit