[X2serv-cvs] CVS: x2/source commands.c,1.143,1.144 main.c,1.49,1.50 misc.c,1.41,1.42 send.c,1.24,1.2
Brought to you by:
sirvulcan
From: Richard P. <lys...@us...> - 2001-04-17 10:25:45
|
Update of /cvsroot/x2serv/x2/source In directory usw-pr-cvs1:/tmp/cvs-serv16646/source Modified Files: commands.c main.c misc.c send.c Log Message: Undid the other two fixes of Mike, made userlist not showing masks to not-logged in ppl and addmask checks for proper hostmasks Index: commands.c =================================================================== RCS file: /cvsroot/x2serv/x2/source/commands.c,v retrieving revision 1.143 retrieving revision 1.144 diff -C2 -r1.143 -r1.144 *** commands.c 2001/04/14 22:18:07 1.143 --- commands.c 2001/04/17 10:25:42 1.144 *************** *** 2665,2668 **** --- 2665,2672 ---- mask = Arg0; } + if (!AddyOk(mask)) { + send_to_user(uptr, "Incorrect mask."); + return(FALSE); + } if(handle) { *************** *** 2799,2802 **** --- 2803,2807 ---- char tmp[MAXLEN]; time_t seentime, difference; + HandleListType savehptr = hptr; char* searchstr; *************** *** 2845,2849 **** } /**************************/ ! if(hptr->Masks) { send_to_user(uptr, "\002%7s\002 - [\002%s\002] %10s\002%c-\002 %s (%s)", --- 2850,2856 ---- } /**************************/ ! /* Users who are not logged in don't need to see the masks. ! IRCOps might want to help users, and they won't abuse the masks (i hope (: ) */ ! if(hptr->Masks && (savehptr || IsOper(uptr))) { send_to_user(uptr, "\002%7s\002 - [\002%s\002] %10s\002%c-\002 %s (%s)", Index: main.c =================================================================== RCS file: /cvsroot/x2serv/x2/source/main.c,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -r1.49 -r1.50 *** main.c 2001/03/04 10:30:22 1.49 --- main.c 2001/04/17 10:25:42 1.50 *************** *** 550,554 **** } Mask = (char *) mysep(&lb, " "); ! AddMask(LastHandle, Mask); continue; case 'B': /* BAN (lamer lits) */ --- 550,555 ---- } Mask = (char *) mysep(&lb, " "); ! if (AddyOk(Mask)) ! AddMask(LastHandle, Mask); continue; case 'B': /* BAN (lamer lits) */ Index: misc.c =================================================================== RCS file: /cvsroot/x2serv/x2/source/misc.c,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -r1.41 -r1.42 *** misc.c 2001/03/20 23:36:03 1.41 --- misc.c 2001/04/17 10:25:42 1.42 *************** *** 1284,1304 **** for (i = 0; i < len; i++) { ! if (iscntrl(Address[i])) ! return (false); ! if ((isalnum(Address[i])) || (Address[i] == '*') || (Address[i] == '?')) continue; ! else if (Address[i] == '!') ! { ! if ((gotexcl) || (gotat)) ! return (0); ! else ! gotexcl = true; ! } ! else if (Address[i] == '@') ! { ! if (gotat) ! return (0); ! else ! gotat = true; } } --- 1284,1309 ---- for (i = 0; i < len; i++) { ! if (isalnum(Address[i])) continue; ! switch (Address[i]) { ! case '*': case '?': case '+': case '-': case '.': case '\\': ! case '^': case '_': case '{': case '[': case '}': case ']': ! continue; ! case '!': { ! if (gotexcl || gotat) ! return (false); ! else ! gotexcl = true; ! break; ! } ! case '@': { ! if (gotat) ! return (false); ! else ! gotat = true; ! break; ! } ! default: ! return (false); } } Index: send.c =================================================================== RCS file: /cvsroot/x2serv/x2/source/send.c,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -r1.24 -r1.25 *** send.c 2001/03/19 03:24:57 1.24 --- send.c 2001/04/17 10:25:42 1.25 *************** *** 458,462 **** if(TempChanPtr->settings[INCHAN]) { ! if (!strcmp(TempChanPtr->Topic, "*") && (TempChanPtr->settings[TOPICFREQ] > 0)) sendtosock(Sock, ":%s TOPIC %s :%s", IrcNick, TempChanPtr->Name, TempChanPtr->Topic); --- 458,462 ---- if(TempChanPtr->settings[INCHAN]) { ! if (strcmp(TempChanPtr->Topic, "*") && (TempChanPtr->settings[TOPICFREQ] > 0)) sendtosock(Sock, ":%s TOPIC %s :%s", IrcNick, TempChanPtr->Name, TempChanPtr->Topic); *************** *** 530,534 **** while (TempChanPtr) { ! if(TempChanPtr->settings[TOPICFREQ] && !strcmp(TempChanPtr->Topic, "*")) sendtosock(Sock, ":%s TOPIC %s :%s", IrcNick, TempChanPtr->Name, TempChanPtr->Topic); --- 530,534 ---- while (TempChanPtr) { ! if(TempChanPtr->settings[TOPICFREQ] && strcmp(TempChanPtr->Topic, "*")) sendtosock(Sock, ":%s TOPIC %s :%s", IrcNick, TempChanPtr->Name, TempChanPtr->Topic); |