X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=src%2Fnickserv.c;h=122c622db728c9554e0b4f48d4923f4e264f727e;hb=350314c7cc92a1b15287133ca072f56fe85dc0b1;hp=6831c586c308ce19c3710b2af300f71f28e63597;hpb=5b5229875555f54a7a73f3b6fe6d8b67b8406e40;p=srvx.git diff --git a/src/nickserv.c b/src/nickserv.c index 6831c58..122c622 100644 --- a/src/nickserv.c +++ b/src/nickserv.c @@ -1825,12 +1825,24 @@ static NICKSERV_FUNC(cmd_auth) return 1; } -struct handle_info *checklogin(const char *user, const char *pass, const char *numeric, const char *hostmask) +struct handle_info *checklogin(const char *user, const char *pass, const char *numeric, const char *hostmask, const char *ipmask) { struct handle_info *hi; + int match = 0, ii = 0; hi = dict_find(nickserv_handle_dict, user, NULL); if(!hi) return NULL; + /* If no hostmasks on the account, allow it. */ + if (hi->masks->used) { + /* If any hostmask matches, allow it. */ + for (ii=0; iimasks->used; ii++) + if (match_ircglob(hostmask, hi->masks->list[ii]) || match_ircglob(ipmask, hi->masks->list[ii])) { + match = 1; + break; + } + if(!match) + return NULL; + } if(!checkpass(pass, hi->passwd)) return NULL; if (HANDLE_FLAGGED(hi, SUSPENDED))