[hackers] [ii] workaround, server messages about users dont open a user directory anymore, output will be sent to the server out file

From: Nico Golde <nion_AT_suckless.org>
Date: Sat Jul 14 13:15:08 2007

changeset: 72:b89593cce111
user: Nico Golde <nion_AT_suckless.org>
date: Sat Jul 14 13:11:09 2007 +0200
summary: workaround, server messages about users dont open a user directory anymore, output will be sent to the server out file

diff -r f6b75e501a9e -r b89593cce111 CHANGES
--- a/CHANGES Sat Jun 23 13:37:48 2007 +0200
+++ b/CHANGES Sat Jul 14 13:11:09 2007 +0200
@@ -1,3 +1,9 @@ 1.2 (2007-06-23):
+1.3 (xxxx-xx-xx):
+ - server messages about users (QUIT,JOIN) will no longer
+ go to the user directories but to the server out file to
+ give an easy method to monitor it and to prevent spamming
+ the irc directory.
+
 1.2 (2007-06-23):
     - Exit on channel creation failure, thanks Michael Prokop
     - Implemented joining of password protected channels
diff -r f6b75e501a9e -r b89593cce111 config.mk
--- a/config.mk Sat Jun 23 13:37:48 2007 +0200
+++ b/config.mk Sat Jul 14 13:11:09 2007 +0200
@@ -23,5 +23,5 @@ LIBS = -L${LIBDIR} -L/usr/lib -lc
 
 # compiler
 CC = cc
-CFLAGS = -g -O0 -W -Wall ${INCLUDES} -DVERSION=\"${VERSION}\"
+CFLAGS = -g -O0 -W -Wall -Wextra ${INCLUDES} -DVERSION=\"${VERSION}\"
 LDFLAGS = ${LIBS}
diff -r f6b75e501a9e -r b89593cce111 ii.c
--- a/ii.c Sat Jun 23 13:37:48 2007 +0200
+++ b/ii.c Sat Jul 14 13:11:09 2007 +0200
@@ -201,10 +201,13 @@ static size_t tokenize(char **result, si
 
 static void print_out(char *channel, char *buf) {
         static char outfile[256];
+ static char server[256];
         FILE *out;
         static char buft[18];
         time_t t = time(0);
 
+ snprintf(server, sizeof(server), "-!- %s", channel);
+ if(strstr(buf, server)) channel="";
         create_filepath(outfile, sizeof(outfile), channel, "out");
         if(!(out = fopen(outfile, "a"))) return;
 
Received on Sat Jul 14 2007 - 13:15:08 UTC

This archive was generated by hypermail 2.2.0 : Sun Jul 13 2008 - 15:57:35 UTC