}
int checkpassword(reguser *rup, const char *pass) {
+ if (!(*rup->password))
+ return 0;
+
if (!strncmp(rup->password, pass, PASSLEN))
return 1;
return 0;
int checkresponse(reguser *rup, const unsigned char *entropy, const char *response, CRAlgorithm algorithm) {
char usernamel[NICKLEN+1], *dp, *up;
+ if (!(*rup->password))
+ return 0;
+
for(up=rup->username,dp=usernamel;*up;)
*dp++ = ToLower(*up++);
*dp = '\0';
continue;
if ((np=getnickbynumeric(cp->users->content[i]))==NULL) {
- Error("chanserv",ERR_ERROR,"Found non-existent numeric %d on channel %s",cp->users->content[i],
+ Error("chanserv",ERR_ERROR,"Found non-existent numeric %lu on channel %s",cp->users->content[i],
cp->index->name->content);
continue;
}
else
rcup=NULL;
- if (rcup && CUIsBanned(rcup) && !IsService(np)) {
- cs_banuser(changes, cp->index, np, NULL);
- continue;
- }
-
- /* chanflag +k checks; kick them if they "obviously" can't rejoin without a ban */
- if (!IsService(np) && CIsKnownOnly(rcp) && !(rcup && CUKnown(rcup))) {
- if (IsInviteOnly(cp) || (IsRegOnly(cp) && !IsAccount(np))) {
- localkickuser(chanservnick,cp,np,"Authorised users only.");
- } else {
- cs_banuser(NULL, cp->index, np, "Authorised users only.");
+ /* Various things that might ban the user - don't apply these to +o, +k or +X users */
+ if (!IsService(np) && !IsXOper(np) && !IsOper(np)) {
+ if (rcup && CUIsBanned(rcup)) {
+ cs_banuser(changes, cp->index, np, NULL);
+ continue;
+ }
+
+ /* chanflag +k checks; kick them if they "obviously" can't rejoin without a ban */
+ if (CIsKnownOnly(rcp) && !(rcup && CUKnown(rcup))) {
+ if (IsInviteOnly(cp) || (IsRegOnly(cp) && !IsAccount(np))) {
+ localkickuser(chanservnick,cp,np,"Authorised users only.");
+ } else {
+ cs_banuser(NULL, cp->index, np, "Authorised users only.");
+ }
+ continue;
}
- continue;
}
if ((cp->users->content[i] & CUMODE_OP) && !IsService(np)) {
return;
for (rcup=rup->knownon;rcup;rcup=rcup->nextbyuser) {
+ /* Skip suspended channels */
+ if (CIsSuspended(rcup->chan))
+ continue;
+
if (rcup->chan->index->channel) {
/* Channel exists */
if ((lp=getnumerichandlefromchanhash(rcup->chan->index->channel->users, np->numeric))) {
regchan *rcp;
int i,j;
- if (IsService(np))
+ if (IsService(np) || IsOper(np) || IsXOper(np))
return;
/* Avoid races: memcpy the channel array */
continue;
if ((np=getnickbynumeric(cp->users->content[i]))==NULL) {
- Error("chanserv",ERR_ERROR,"Found numeric %d on channel %s who doesn't exist.",
+ Error("chanserv",ERR_ERROR,"Found numeric %lu on channel %s who doesn't exist.",
cp->users->content[i], cp->index->name->content);
continue;
}
- if (IsService(np))
+ if (IsService(np) || IsOper(np) || IsXOper(np))
continue;
for (rbp=rcp->bans;rbp;rbp=rbp->next) {
for (i=0;(cip->channel) && i<cip->channel->users->hashsize;i++) {
if (cip->channel->users->content[i]!=nouser &&
(np=getnickbynumeric(cip->channel->users->content[i])) &&
- !IsService(np) &&
+ !IsService(np) && !IsOper(np) && !IsXOper(np) &&
nickmatchban_visible(np, rbp->cbp))
localkickuser(chanservnick, cip->channel, np, rbp->reason ? rbp->reason->content : "Banned.");
}