@@ -8,13 +8,15 @@ Pruned pair parser | |||||
Reduced creds struct | Reduced creds struct | ||||
ADDED NVULN=1 build option to remove kill, raw and dump | ADDED NVULN=1 build option to remove kill, raw and dump | ||||
ADDED new -url option | |||||
ADDED option -url | |||||
VERSION X | |||||
VERSION 2 | |||||
Added -identify | |||||
ircmsg is now more useful | |||||
Fixed some error return values being too high | |||||
Changed NVULN to NO_VULN | |||||
Added ENABLE_SSL=1 to enable SSL incomplete support | |||||
Added option -identify | |||||
Added commands !magic, !say | |||||
Added ENABLE_SSL=1 to enable SSL non-functional support | |||||
Added libircclient submodule | Added libircclient submodule | ||||
Fixed some error return values being too high | |||||
Fixed commands with more than 1 argument | |||||
Changed some macro naming | |||||
Fixed Build system to be properly split amongst include/config.h and Makefile |
@@ -1,10 +1,12 @@ | |||||
/* The database file */ | |||||
#define DBFILE "data.sqlite" | #define DBFILE "data.sqlite" | ||||
/* Disables vulnerable commands */ | /* Disables vulnerable commands */ | ||||
/* #define NO_VULN_COMMANDS */ | |||||
#define NO_VULN_COMMANDS | |||||
/* Enables SSL support */ | |||||
/* #define IRC_SSL_SUPPORT */ | |||||
/* Disables all logging */ | |||||
/* #define NO_LOGGING */ | |||||
/* Spits out a message when connected */ | |||||
/* #define INITIAL_ASSIGNMENT_MESSAGE */ | |||||
/* Enables SSL support | |||||
* FIXME broken at the moment */ | |||||
/* #define IRC_SSL_SUPPORT */ |
@@ -137,6 +137,8 @@ event_channel(irc_session_t * lsession, | |||||
/* (void) channel; */ | /* (void) channel; */ | ||||
(void) message; | (void) message; | ||||
(void) count; | (void) count; | ||||
/* Logs the message */ | |||||
printf(message); | |||||
/* parses the command */ | /* parses the command */ | ||||
if (*message == PREFIX_COMMAND_CHAR) | if (*message == PREFIX_COMMAND_CHAR) | ||||
{ current_username = get_username(origin); } | { current_username = get_username(origin); } | ||||
@@ -210,7 +212,7 @@ parse_command(char const * cmd) | |||||
char const * const arg = cmd + i; | char const * const arg = cmd + i; | ||||
printf("argoff: %p; i: %ld; arg: %sEOA\n", cmd + i + 1, i, arg); | printf("argoff: %p; i: %ld; arg: %sEOA\n", cmd + i + 1, i, arg); | ||||
#ifndef NO_VULN_COMMANDS | #ifndef NO_VULN_COMMANDS | ||||
if (strncmp(cmd, "raw", i) == 0) | |||||
if (strncmp(cmd, "raw", 3) == 0) | |||||
{ | { | ||||
printf("RAW\n"); | printf("RAW\n"); | ||||
/* ircmsg(creds.channel, "%s: Executing SQL `%s'.", current_username, arg); */ | /* ircmsg(creds.channel, "%s: Executing SQL `%s'.", current_username, arg); */ | ||||
@@ -218,13 +220,17 @@ parse_command(char const * cmd) | |||||
ircmsg(creds.channel, msgswp); | ircmsg(creds.channel, msgswp); | ||||
} else | } else | ||||
#endif /* !NO_VULN_COMMANDS */ | #endif /* !NO_VULN_COMMANDS */ | ||||
if (strncmp(cmd, "repo", i) == 0) | |||||
if (strncmp(cmd, "repo", 4) == 0) | |||||
{ | { | ||||
/* ircmsg(creds.channel, "%s: Setting project repository...", current_username); */ | /* ircmsg(creds.channel, "%s: Setting project repository...", current_username); */ | ||||
set_repo(creds.channel, arg); | set_repo(creds.channel, arg); | ||||
msgswp = remind(creds.channel); | msgswp = remind(creds.channel); | ||||
ircmsg(creds.channel, "%s: %s", current_username, msgswp); | ircmsg(creds.channel, "%s: %s", current_username, msgswp); | ||||
} | } | ||||
else if (strncmp(cmd, "magic", 5) == 0) | |||||
{ ircmsg(creds.channel, "%s: " IRC_YELLOW "%d" IRC_STOP, current_username, (rand() % atoi(arg)) + 1); } | |||||
else if (strncmp(cmd, "say", 3) == 0) | |||||
{ ircmsg(creds.channel, "%s", arg); } | |||||
} | } | ||||
free(msgswp); | free(msgswp); | ||||
} | } |
@@ -1,6 +1,6 @@ | |||||
/* main.c */ | /* main.c */ | ||||
#define VERSION_STRING "1" | |||||
#define VERSION_STRING "2" | |||||
/* Parses the format username[:password]@server[:port] | /* Parses the format username[:password]@server[:port] | ||||
* user:password@server:port = userNULpasswordNULserverNUL (port N/A) | * user:password@server:port = userNULpasswordNULserverNUL (port N/A) | ||||
@@ -122,6 +122,10 @@ int | |||||
main (int argc, | main (int argc, | ||||
char ** argv) | char ** argv) | ||||
{ | { | ||||
#ifdef NO_LOGGING | |||||
freopen(stdout, "/dev/null"); | |||||
freopen(stderr, "/dev/null"); | |||||
#endif | |||||
if (argc > 1) | if (argc > 1) | ||||
{ | { | ||||
char * arg; | char * arg; | ||||