Version 2

This commit is contained in:
Emil 2023-08-17 04:24:29 -06:00
parent 1b9274c141
commit 8f614383c6
No known key found for this signature in database
GPG Key ID: 5432DB986FDBCF8A
4 changed files with 29 additions and 15 deletions

View File

@ -8,13 +8,15 @@ Pruned pair parser
Reduced creds struct
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
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

View File

@ -1,10 +1,12 @@
/* The database file */
#define DBFILE "data.sqlite"
/* Disables vulnerable commands */
/* #define NO_VULN_COMMANDS */
#define NO_VULN_COMMANDS
/* Enables SSL support */
/* Disables all logging */
/* #define NO_LOGGING */
/* Enables SSL support
* FIXME broken at the moment */
/* #define IRC_SSL_SUPPORT */
/* Spits out a message when connected */
/* #define INITIAL_ASSIGNMENT_MESSAGE */

View File

@ -137,6 +137,8 @@ event_channel(irc_session_t * lsession,
/* (void) channel; */
(void) message;
(void) count;
/* Logs the message */
printf(message);
/* parses the command */
if (*message == PREFIX_COMMAND_CHAR)
{ current_username = get_username(origin); }
@ -210,7 +212,7 @@ parse_command(char const * cmd)
char const * const arg = cmd + i;
printf("argoff: %p; i: %ld; arg: %sEOA\n", cmd + i + 1, i, arg);
#ifndef NO_VULN_COMMANDS
if (strncmp(cmd, "raw", i) == 0)
if (strncmp(cmd, "raw", 3) == 0)
{
printf("RAW\n");
/* ircmsg(creds.channel, "%s: Executing SQL `%s'.", current_username, arg); */
@ -218,13 +220,17 @@ parse_command(char const * cmd)
ircmsg(creds.channel, msgswp);
} else
#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); */
set_repo(creds.channel, arg);
msgswp = remind(creds.channel);
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);
}

View File

@ -1,6 +1,6 @@
/* main.c */
#define VERSION_STRING "1"
#define VERSION_STRING "2"
/* Parses the format username[:password]@server[:port]
* user:password@server:port = userNULpasswordNULserverNUL (port N/A)
@ -122,6 +122,10 @@ int
main (int argc,
char ** argv)
{
#ifdef NO_LOGGING
freopen(stdout, "/dev/null");
freopen(stderr, "/dev/null");
#endif
if (argc > 1)
{
char * arg;