X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;ds=sidebyside;f=log.c;h=55f1ee125cbfba848002f1c536e8ad89e3bb3247;hb=59230b9b9fc44453f24c6b3cf33a0f4c570a3563;hp=32aed704b06e20e595ef366661426103fac6342f;hpb=040ee979539e88ef71fb21a80d4a05d24961ae70;p=secnet.git diff --git a/log.c b/log.c index 32aed70..55f1ee1 100644 --- a/log.c +++ b/log.c @@ -8,6 +8,7 @@ #include #include #include "process.h" +#include "util.h" bool_t secnet_is_daemon=False; uint32_t message_level=M_WARNING|M_ERR|M_SECURITY|M_FATAL; @@ -24,11 +25,12 @@ static void vMessage(uint32_t class, const char *message, va_list args) if (secnet_is_daemon) { /* Messages go to the system log interface */ bp=strlen(buff); + assert(bp < MESSAGE_BUFLEN); vsnprintf(buff+bp,MESSAGE_BUFLEN-bp,message,args); /* Each line is sent separately */ while ((nlp=strchr(buff,'\n'))) { *nlp=0; - slilog(system_log,class,buff); + slilog(system_log,class,"%s",buff); memmove(buff,nlp+1,strlen(nlp+1)+1); } } else { @@ -554,7 +556,6 @@ void log_from_fd(int fd, cstring_t prefix, struct log_if *log) prefix); } -init_module log_module; void log_module(dict_t *dict) { add_closure(dict,"logfile",logfile_apply);