pike.git / src / modules / system / syslog.c

version» Context lines:

pike.git/src/modules/system/syslog.c:20:   #include "system.h"      #ifdef HAVE_SYSLOG      #include "interpret.h"   #include "svalue.h"   #include "stralloc.h"   #include "threads.h"   #include "module_support.h"   #include "builtin_functions.h" - #include "pike_security.h" +       #ifdef HAVE_SYSLOG_H   #include <syslog.h>   #elif defined(HAVE_SYS_SYSLOG_H)   #include <sys/syslog.h>   #endif      #ifndef LOG_PID   #define LOG_PID 0   #endif
pike.git/src/modules/system/syslog.c:101:   #ifndef LOG_NDELAY   #define LOG_NDELAY 0   #endif   #ifndef LOG_PERROR   #define LOG_PERROR 0   #endif      /*! @module System    */    - /*! @decl void openlog(string ident, int options, facility) + /*! @decl void openlog(string ident, int options, int facility)    *!    *! Initializes the connection to syslogd.    *!    *! @param ident.    *! The @[ident] argument specifies an identifier to tag all logentries    *! with.    *!    *! @param options    *! A bitfield specifying the behaviour of the message    *! logging. Valid options are:
pike.git/src/modules/system/syslog.c:177:    *!    *! @seealso    *! @[syslog], @[closelog]    */   void f_openlog(INT32 args)   {    char *ident;    INT_TYPE p_option, p_facility;    INT_TYPE option=0, facility=0;    -  ASSERT_SECURITY_ROOT("System.openlog"); +  get_all_args(NULL, args, "%s%i%i", &ident, &p_option, &p_facility);    -  get_all_args("openlog", args, "%s%i%i", &ident, &p_option, &p_facility); -  +     if(p_option & (1<<0)) option |= LOG_CONS;    if(p_option & (1<<1)) option |= LOG_NDELAY;    if(p_option & (1<<2)) option |= LOG_PERROR;    if(p_option & (1<<3)) option |= LOG_PID;       if(p_facility & (1<<0)) facility |= LOG_AUTH; /* Don't use */    if(p_facility & (1<<1)) facility |= LOG_AUTHPRIV;    if(p_facility & (1<<2)) facility |= LOG_CRON;    if(p_facility & (1<<3)) facility |= LOG_DAEMON;    if(p_facility & (1<<4)) facility |= LOG_KERN;
pike.git/src/modules/system/syslog.c:252:    *! LOG_INFO, informational message.    *! @value 7    *! LOG_DEBUG, debug-level message.    *! @endint    */   void f_syslog(INT32 args)   {    struct pike_string *s;    INT_TYPE pri=0, i;    - #ifdef PIKE_SECURITY -  int errno; - #define EPERM 0 - #endif -  VALID_FILE_IO("System.syslog","write"); +  get_all_args(NULL, args, "%i%S", &i, &s);    -  get_all_args("syslog", args, "%i%S", &i, &s); -  +     if(i & (1<<0)) pri |= LOG_EMERG;    if(i & (1<<1)) pri |= LOG_ALERT;    if(i & (1<<2)) pri |= LOG_CRIT;    if(i & (1<<3)) pri |= LOG_ERR;    if(i & (1<<4)) pri |= LOG_WARNING;    if(i & (1<<5)) pri |= LOG_NOTICE;    if(i & (1<<6)) pri |= LOG_INFO;    if(i & (1<<7)) pri |= LOG_DEBUG;      #ifndef MIGHT_HAVE_SYSLOG_RACES
pike.git/src/modules/system/syslog.c:299:    pop_n_elems(args);   }      /*! @decl void closelog()    *!    *! @fixme    *! Document this function.    */   void f_closelog(INT32 args)   { -  ASSERT_SECURITY_ROOT("System.closelog"); +     closelog();    pop_n_elems(args);   }      /*! @endmodule    */      #endif /* HAVE_SYSLOG */