From 90f8c4d6729b6903f0a067c2112488d651af4f0a Mon Sep 17 00:00:00 2001 From: epoch Date: Mon, 30 Jun 2014 01:32:37 -0500 Subject: first commit from new setup. don't remember what I changed. --- .gitignore | 2 ++ runme.sh | 5 +++-- segfault.c | 32 ++++++++++++++++++++++++++------ shell | 2 +- 4 files changed, 32 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index db7cf1b..4464909 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ segfault +libirc/libirc.o +libirc/libirc.so diff --git a/runme.sh b/runme.sh index 3b76b31..ffc77c6 100755 --- a/runme.sh +++ b/runme.sh @@ -1,5 +1,6 @@ #!/bin/sh export LD_LIBRARY_PATH=`pwd`/libirc -./shell& -./segfault Seg +cd /home/segfault +while true;do /root/services/segfault/shell;done& 2>&1 > /dev/null +while true;do su segfault -c /root/services/segfault/segfault;done 2>&1 > /dev/null wait diff --git a/segfault.c b/segfault.c index 938c385..58e27ca 100644 --- a/segfault.c +++ b/segfault.c @@ -7,17 +7,17 @@ #include #include #include -#include //epoch's libirc. should be included with segfault. +#include "libirc/irc.h" //epoch's libirc. should be included with segfault. //might want to change some of these. -#define SERVER "192.168.0.2" +#define SERVER "127.0.0.1" #define PORT "6667" #define NICK "SegFault" //override with argv[0] #define LINE_LIMIT line_limit #define LINES_SENT_LIMIT 1 #define LINELEN 400 -#define RAWLOG "/home/segfault/files/rawlog" -#define LOG "/home/segfault/files/log" +#define RAWLOG "/home/epoch/segfault/files/rawlog" +#define LOG "/home/epoch/segfault/files/log" #define MAXTAILS 400 //just to have it more than the system default. #define BS 502 #define TSIZE 65536 //size of hashtable. 65k isn't bad, right? @@ -102,6 +102,14 @@ void ircmode(int fd,char *channel,char *mode,char *nick) { free(hrm); } +/*#ifndef strndup +char *strndup(char *s,int l) { + char *r=strdup(s); + r[l]=0; + return r; +} +#endif*/ + void privmsg(int fd,char *who,char *msg) { int i=0; char *chunk,*hrm; @@ -467,7 +475,7 @@ void c_aliases_h(int fd,char *from,char *line) { struct alias *m; int i,j=0,k=0; if(!line){ - privmsg(fd,from,"usage: !aliases_h [search-term]"); + privmsg(fd,from,"usage: !aliases [search-term]"); return; } for(i=0;ioriginal)+strlen(m->target)+1); redo=format_magic(fd,from,nick,m->target,*(msg+strlen(m->original)+1)=='\n'?"":(msg+strlen(m->original)+1)); diff --git a/shell b/shell index f493979..507407d 100755 --- a/shell +++ b/shell @@ -4,4 +4,4 @@ kill `pgrep -P 1 -f "tail -f /home/segfault/files/cmd_in"` mkdir -p /home/segfault/files mkfifo /home/segfault/files/cmd_in mkfifo /home/segfault/files/cmd_out -tail -f /home/segfault/files/cmd_in | su -l segfault > /home/segfault/files/cmd_out 2>&1 +tail -f /home/segfault/files/cmd_in | su -l segfault 2>&1 > /home/segfault/files/cmd_out 2>&1 -- cgit v1.2.3