if ((d->chans[i].channel != NULL) && (chan != NULL))
if (!strcasecmp(d->chans[i].channel->name,chan->name))
{
- if (d->chans[i].uc_modes & UCMODE_OP)
+ if (d->chans[i].uc_modes & UCMODE_OP)
{
/* mode already set on user, dont allow multiple */
- log(DEFAULT,"The target user given to GiveOps was already opped on the channel");
return NULL;
}
d->chans[i].uc_modes = d->chans[i].uc_modes | UCMODE_OP;
b.set_time = TIME;
strlcpy(b.data,dest,MAXBUF);
- strlcpy(b.set_by,user->nick,NICKMAX);
+ if (*user->nick)
+ {
+ strlcpy(b.set_by,user->nick,NICKMAX-1);
+ }
+ else
+ {
+ strlcpy(b.set_by,Config->ServerName,NICKMAX-1);
+ }
chan->bans.push_back(b);
return dest;
}
{
r = NULL;
+ /* If we have more than MAXMODES changes in one line,
+ * drop all after the MAXMODES
+ */
+ if (pc > MAXMODES-1)
+ break;
+
{
switch (*modechar)
{
log(DEBUG,"Ops");
if ((param >= pcnt)) break;
log(DEBUG,"Enough parameters left");
+ r = NULL;
if (mdir == 1)
{
MOD_RESULT = 0;
case 'h':
if (((param >= pcnt)) || (!Config->AllowHalfop)) break;
+ r = NULL;
if (mdir == 1)
{
MOD_RESULT = 0;
case 'v':
if ((param >= pcnt)) break;
+ r = NULL;
if (mdir == 1)
{
MOD_RESULT = 0;
case 'b':
if ((param >= pcnt)) break;
+ r = NULL;
if (mdir == 1)
{
MOD_RESULT = 0;
if (!source)
{
s2 = new userrec;
- strlcpy(s2->nick,Config->ServerName,NICKMAX);
+ strlcpy(s2->nick,Config->ServerName,NICKMAX-1);
strlcpy(s2->modes,"o",52);
s2->fd = -1;
source = s2;