]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/conf.c
New option to scrub incoming CTCP commands
[ngircd-alex.git] / src / ngircd / conf.c
index 4da5b9e0742ac55ccc6c2c3276ce3d184443c751..6bd224f3c11ea58189d081beb361d97783bf721f 100644 (file)
@@ -374,6 +374,7 @@ Conf_Test( void )
 #ifndef STRICT_RFC
        printf("  RequireAuthPing = %s\n", yesno_to_str(Conf_AuthPing));
 #endif
+       printf("  ScrubCTCP = %s\n", yesno_to_str(Conf_ScrubCTCP));
 #ifdef SSL_SUPPORT
        printf("  SSLCertFile = %s\n", Conf_SSLOptions.CertFile);
        printf("  SSLDHFile = %s\n", Conf_SSLOptions.DHFile);
@@ -687,6 +688,7 @@ Set_Defaults(bool InitServers)
 #endif
        Conf_PredefChannelsOnly = false;
 #ifdef SYSLOG
+       Conf_ScrubCTCP = false;
 #ifdef LOG_LOCAL5
        Conf_SyslogFacility = LOG_LOCAL5;
 #else
@@ -1459,6 +1461,10 @@ Handle_OPTIONS(int Line, char *Var, char *Arg)
                return;
        }
 #endif
+       if (strcasecmp(Var, "ScrubCTCP") == 0) {
+               Conf_ScrubCTCP = Check_ArgIsTrue(Arg);
+               return;
+       }
 #ifdef SSL_SUPPORT
        if (strcasecmp(Var, "SSLCertFile") == 0) {
                assert(Conf_SSLOptions.CertFile == NULL);
@@ -1933,8 +1939,13 @@ va_dcl
        vsnprintf( msg, MAX_LOG_MSG_LEN, Format, ap );
        va_end( ap );
 
-       if (Use_Log) Log( Level, "%s", msg );
-       else puts( msg );
+       if (!Use_Log) {
+               if (Level <= LOG_WARNING)
+                       printf(" - %s\n", msg);
+               else
+                       puts(msg);
+       } else
+               Log(Level, "%s", msg);
 }
 
 #ifdef DEBUG