#include <sys/types.h>
#include <dirent.h>
+#include "../lib/strlfunc.h"
+
#include "hcommands.h"
#include "hcommand.h"
}
else
{
- strcpy(hchan->welcome, ostr);
+ strlcpy(hchan->welcome, ostr, HCHANNEL_WELCOME_LEN);
helpmod_reply(sender, returntype, "Welcome message for channel %s (%s) is now: %s", hchan->real_channel->index->name->content, hchannel_get_state(hchan, H_WELCOME), hchan->welcome);
}
}
}
if (strregexp(htrm->description->content, pattern) || strregexp(htrm->name->content, pattern))
{
- sprintf(buffer+strlen(buffer) /* :) */, "%s(%ld) ", htrm->name->content, strlen(htrm->description->content));
+ sprintf(buffer+strlen(buffer) /* :) */, "%s(%u) ", htrm->name->content, (unsigned int)strlen(htrm->description->content));
count++;
}
}
husr = huser_get(getnickbynick(argv[i]));
if (husr == NULL)
{
- helpmod_reply(sender, returntype, "Cannot change mode: User %s not found", argv[i], hchannel_get_name(hchan));
+ helpmod_reply(sender, returntype, "Cannot change mode: User %s not found", argv[i]);
continue;
}
huserchan = huser_on_channel(husr, hchan);
if (IsAccount(nck))
authed_count++;
- if (IsOper(nck) && strlen(nck->nick) > 1)
+ if (IsOper(nck) && strlen(nck->nick) > 1 && (IsSecret(chan) || IsPrivate(chan) || IsKey(chan) || IsInviteOnly(chan)))
{
- helpmod_reply(sender, returntype, "Cannot check channel: Permission denied. Channel %s has an oper on it", argv[0]);
+ helpmod_reply(sender, returntype, "Cannot check channel: Permission denied. Channel %s has an oper on it and one or more of +i/+k/+p/+s", argv[0]);
return;
}
}
helpmod_reply(sender, returntype, "Channels %d", hchannel_count());
helpmod_reply(sender, returntype, "Accounts %d", haccount_count(H_ANY));
helpmod_reply(sender, returntype, "Users %d", huser_count());
- helpmod_reply(sender, returntype, "Help entries %d", helpmod_entry_count(helpmod_base));
+ helpmod_reply(sender, returntype, "Help entries %ld", helpmod_entry_count(helpmod_base));
helpmod_reply(sender, returntype, "Bans %d", hban_count());
- helpmod_reply(sender, returntype, "Help provided %d", helpmod_usage);
+ helpmod_reply(sender, returntype, "Help provided %ld", helpmod_usage);
helpmod_reply(sender, returntype, "Tickets %d", hticket_count());
}
{
int argc = 0, useless_var;
char args_copy[512];
- char *parsed_args[H_CMD_MAX_ARGS + 3], *ptr = args_copy;
+ char *parsed_args[H_CMD_MAX_ARGS + 4], *ptr = args_copy;
/* only accept commands from valid sources */
if (huser_get_level(sender) > H_ADMIN)
if (*args == '-' || *args == '?')
args++;
- strcpy(args_copy, args);
+ strncpy(args_copy, args, (sizeof(args_copy) - 1));
+ args_copy[sizeof(args_copy) - 1] = '\0';
+
/* FIX stringituki */
- while (argc < 10)
+ while (argc < (H_CMD_MAX_ARGS + 4))
{
while (isspace(*ptr) && *ptr)
ptr++;
if (hcom == NULL)
{
+ controlwall(NO_DEVELOPER, NL_ALL_COMMANDS, "(G) From: %s!%s@%s%s%s: %s",
+ sender->real_user->nick, sender->real_user->ident,
+ sender->real_user->host->name->content, IsAccount(sender->real_user)?"/":"",
+ IsAccount(sender->real_user)?sender->real_user->authname:"", args);
if ((returntype == NULL) ||
(sender->account != NULL && !(sender->account->flags & H_NO_CMD_ERROR)))
helpmod_reply(sender, returntype, "Unknown command '%s', please see showcommands for a list of all commands available to you", parsed_args[0]);