[X2serv-cvs] [CVS] Module x2: Change committed
Brought to you by:
sirvulcan
From: Alex S. <ru...@us...> - 2004-08-23 15:26:09
|
Committer : Alex Schumann <ru...@us...> CVSROOT : /cvsroot/x2serv Module : x2 Commit time: 2004-08-23 15:25:59 UTC Modified files: Makefile.in source/chan.c source/commands.c source/config.h source/misc.c source/misc.h source/parse.c source/parse.h source/user.c source/user.h Log message: Added (proper) support for hidden hosts, fakehosts, and sethosts. They are considered in lamer, ban and access functions, and available in the WHOIS command. ---------------------- diff included ---------------------- Index: x2/Makefile.in diff -u x2/Makefile.in:1.9 x2/Makefile.in:1.10 --- x2/Makefile.in:1.9 Sun Sep 15 00:41:10 2002 +++ x2/Makefile.in Mon Aug 23 08:25:47 2004 @@ -49,11 +49,11 @@ else \ echo "keeping existing $(prefix)/x2.motd.example";\ fi - @if [ ! -f $(prefix)/x2.news ]; then \ - echo "Creating $(prefix)/x2.news"; \ - $(CP) $(srcdir)/conf/x2.news $(prefix)/x2.news;\ + @if [ ! -f $(prefix)/x2.news.example ]; then \ + echo "Creating $(prefix)/x2.news.example"; \ + $(CP) $(srcdir)/conf/x2.news.example $(prefix)/x2.news.example;\ else \ - echo "keeping existing $(prefix)/x2.news";\ + echo "keeping existing $(prefix)/x2.news.example";\ fi @if [ ! -f $(prefix)/illegalchans.dat ]; then \ echo "Creating $(prefix)/illegalchans.dat"; \ Index: x2/source/chan.c diff -u x2/source/chan.c:1.90 x2/source/chan.c:1.91 --- x2/source/chan.c:1.90 Sun Jul 4 13:42:18 2004 +++ x2/source/chan.c Mon Aug 23 08:25:48 2004 @@ -165,22 +165,27 @@ { LamerListType lptr; char *nuh; + char *nuh2; if(uptr == NULL || cptr == NULL) return(NULL); - nuh = (char *) malloc(strlen(uptr->Nick) + strlen(uptr->UserID) + strlen(uptr->Address) + 3); - sprintf(nuh, "%s!%s@%s", uptr->Nick, uptr->UserID, uptr->Address); + nuh = (char *) malloc(strlen(uptr->Nick) + strlen(ActiveUsername(uptr)) + strlen(ActiveHost(uptr)) + 3); + nuh2 = (char *) malloc(strlen(uptr->Nick) + strlen(uptr->UserID) + strlen(uptr->Address) + 3); + sprintf(nuh, "%s!%s@%s", uptr->Nick, ActiveUsername(uptr), ActiveHost(uptr)); + sprintf(nuh2, "%s!%s@%s", uptr->Nick, uptr->UserID, uptr->Address); for(lptr = cptr->Lamers;lptr;lptr = lptr->Next) { - if(!matches(lptr->Mask, nuh)) + if(!matches(lptr->Mask, nuh) || !matches(lptr->Mask, nuh2)) { free(nuh); + free(nuh2); return(lptr); } } free(nuh); + free(nuh2); return (NULL); } @@ -287,7 +292,7 @@ } } /* No login, so find a match here... */ - sprintf(Str, "%s!%s@%s", uptr->Nick, uptr->UserID, uptr->Address); + sprintf(Str, "%s!%s@%s", uptr->Nick, ActiveUsername(uptr), ActiveHost(uptr)); for(hptr = cptr->Handles;hptr;hptr = hptr->Next) { for(mptr = hptr->Masks;mptr;mptr = mptr->Next) Index: x2/source/commands.c diff -u x2/source/commands.c:1.185 x2/source/commands.c:1.186 --- x2/source/commands.c:1.185 Sun Aug 22 12:10:42 2004 +++ x2/source/commands.c Mon Aug 23 08:25:48 2004 @@ -414,7 +414,7 @@ send_to_user(uptr, "\002%s is a Service.\002", rest); return(FALSE); } - sprintf(nuh, "%s!%s@%s", UserNode->Nick, UserNode->UserID, UserNode->Address); + sprintf(nuh, "%s!%s@%s", UserNode->Nick, ActiveUsername(UserNode), ActiveHost(UserNode)); if (!banok(cptr, uptr, nuh)) { @@ -624,7 +624,7 @@ send_to_user(uptr, "\002Sorry, you cannot kick or deop channel services.\002"); return(FALSE); } - sprintf(nuh, "%s!%s@%s", target->Nick, target->UserID, target->Address); + sprintf(nuh, "%s!%s@%s", target->Nick, ActiveUsername(target), ActiveHost(target)); if ((!kickok(cptr, uptr, target)) || (!banok(cptr, uptr, nuh))) { @@ -650,7 +650,7 @@ Debug(DBGWARNING, "c_ubm(): Null uptr"); return(FALSE); } - sprintf(nuh, "%s!%s@%s", uptr->Nick, uptr->UserID, uptr->Address); + sprintf(nuh, "%s!%s@%s", uptr->Nick, ActiveUsername(uptr), ActiveHost(uptr)); sprintf(nuh2, "%s!%s@%d.%d.%d.%d", uptr->Nick, uptr->UserID, uptr->IP / 65536 / 256 % 256, uptr->IP / 65536 % 256, uptr->IP / 256 % 256, uptr->IP % 256); @@ -694,7 +694,7 @@ } if((target = FindNick(rest, UsersN))) { - sprintf(nuh, "%s!%s@%s", target->Nick, target->UserID, target->Address); + sprintf(nuh, "%s!%s@%s", target->Nick, ActiveUsername(target), ActiveHost(target)); if (channel_unban(cptr, nuh)) { send_to_user(uptr, "\002%s has been unbanned from %s.\002", nuh, cptr->Name); @@ -750,7 +750,7 @@ else { char str[MAXLEN]; - snprintf(str, MAXLEN, "%s!%s@%s", target->Nick, target->UserID, target->Address); + snprintf(str, MAXLEN, "%s!%s@%s", target->Nick, ActiveUsername(target), ActiveHost(target)); send_to_user(uptr, "That user (%s) clusters to: %s", str, cluster(str)); } } @@ -875,13 +875,17 @@ if((target = (FindNick(rest, UsersN)))) { send_to_user(uptr, "\002=------%s------=\002", rest); - send_to_user(uptr, "\002 Nick : %s\002", target->Nick); - send_to_user(uptr, "\002 NumNick: %s\002", target->Numnick); - send_to_user(uptr, "\002 UserID : %s\002", target->UserID); - send_to_user(uptr, "\002 Address: %s\002", target->Address); - send_to_user(uptr, "\002 IP Addr: %s\002", unsigned32ToDotQuad(target->IP)); - send_to_user(uptr, "\002 Server : %s\002", target->Serv); - send_to_user(uptr, "\002 Clones : %d\002", target->Clones); + send_to_user(uptr, "\002 NumNick : %s\002", target->Numnick); + send_to_user(uptr, "\002 Nick : %s\002", target->Nick); + send_to_user(uptr, "\002 UserID : %s\002", target->UserID); + send_to_user(uptr, "\002 Address : %s\002", target->Address); + send_to_user(uptr, "\002 Realname: %s\002", target->RealName); + send_to_user(uptr, "\002 Account : %s\002", target->Account); + send_to_user(uptr, "\002 fakehost: %s\002", target->Fakehost); + send_to_user(uptr, "\002 sethost : %s\002", target->Sethost); + send_to_user(uptr, "\002 IP Addr : %s\002", unsigned32ToDotQuad(target->IP)); + send_to_user(uptr, "\002 Server : %s\002", target->Serv); + send_to_user(uptr, "\002 Clones : %d\002", target->Clones); if (target->Modes & UMODEd) strcat(modetmp, "d"); if (target->Modes & UMODEi) @@ -902,6 +906,12 @@ strcat(modetmp, "B"); if (target->Modes & UMODER) strcat(modetmp, "R"); + if (target->Modes & UMODEr) + strcat(modetmp, "r"); + if (target->Modes & UMODEf) + strcat(modetmp, "f"); + if (target->Modes & UMODEh) + strcat(modetmp, "h"); if (target->Modes & UMODEgod) strcat(modetmp, "(GOD)"); send_to_user(uptr, "\002 Modes : +%s\002", modetmp); @@ -3968,7 +3978,7 @@ send_to_user(uptr, "\002You cannot kick/deop/lamer a channel service.\002"); return(FALSE); } - sprintf(nuh, "%s!%s@%s", target->Nick, target->UserID, target->Address); + sprintf(nuh, "%s!%s@%s", target->Nick, ActiveUsername(target), ActiveHost(target)); sprintf(buff, "%s", cluster(nuh)); Address = buff; } @@ -4073,7 +4083,7 @@ { /* if the address doesnt have address stuff in it (!@ etc) */ if((target = FindNick(Address, UsersN))) { /* if theres a user on with that nick */ - sprintf(buff, "%s!%s@%s", target->Nick, target->UserID, target->Address); + sprintf(buff, "%s!%s@%s", target->Nick, ActiveUsername(target), ActiveHost(target)); Address = buff; send_to_user(uptr, "\002Searching for a mask matching: %s\002", Address); for(lptr = cptr->Lamers;lptr;lptr = lptr->Next) Index: x2/source/config.h diff -u x2/source/config.h:1.79 x2/source/config.h:1.80 --- x2/source/config.h:1.79 Sun Aug 22 12:10:42 2004 +++ x2/source/config.h Mon Aug 23 08:25:48 2004 @@ -47,7 +47,9 @@ #define VERSION "X2 v5.2 - AfterNET Channel Services" /* This is used to refer to your network in various places. It should be one word, eg "AfterNET" */ -#define NETWORK "AfterNET" +#define NETWORK "AfterNET" +#define HIDDEN_HOST "Users.AfterNET.Org" +#define HIDDEN_HOST_STAFF "Staff.AfterNET.Org" #define HELPURL "http://www.afternet.org/support/" #define OPERHELPFILE "HELP/operhelp.txt" @@ -68,7 +70,7 @@ /* Uncomment the following for debugging. */ -/* #define debugon */ + #define debugon /* If you dont want the word warez in channel names, define this. * TODO : This is a hack, and would do better in a config file. Do it! @@ -488,6 +490,9 @@ char Numnick[NUMNICKLEN]; char UserID[12]; char *Address; + char *Account; /* ircu +r account */ + char *Sethost; /* ircu +h sethost (S: lines) */ + char *Fakehost; /* ircu +f fakehost */ unsigned int IP; struct AuthHandleStruct *AuthHandles; /* A list of channel and handles were logged in as */ char *RealName; Index: x2/source/misc.c diff -u x2/source/misc.c:1.51 x2/source/misc.c:1.52 --- x2/source/misc.c:1.51 Sun Jul 4 13:42:19 2004 +++ x2/source/misc.c Mon Aug 23 08:25:48 2004 @@ -889,7 +889,7 @@ { char buff[MAXLEN]; - sprintf(buff, "%s!%s@%s", uptr->Nick, uptr->UserID, uptr->Address); + sprintf(buff, "%s!%s@%s", uptr->Nick, ActiveUsername(uptr), ActiveHost(uptr)); send_chanmode(cptr, "-ov+b %s %s %s", uptr->Numnick, uptr->Numnick, cluster(buff)); add_ban(cptr, cluster(buff)); } @@ -971,26 +971,7 @@ /* This will have to be reworked when the new domains are deploid */ tptr = &temp[strlen(temp) - 4]; /* Try to guess how many dots we need (minus one) */ - if(!strcasecmp(tptr, ".psi.net")) - { - numofdots = 4; - } - else if(!strcasecmp(tptr, "home.com") || - !strcasecmp(tptr, ".ar") || - !strcasecmp(tptr, ".ibm.net") || - !strcasecmp(tptr, ".uu.net")) - { - numofdots = 3; - } - else if(!strcasecmp(tptr, ".level3.net") || - !strcasecmp(tptr, ".texas.net") || - !strcasecmp(tptr, ".execpc.com") || - !strcasecmp(tptr, ".freei.net") || - !strcasecmp(tptr, ".rr.com")) - { - numofdots = 2; - } - else if (!strcasecmp(tptr, ".com") || + if ( !strcasecmp(tptr, ".com") || !strcasecmp(tptr, ".edu") || !strcasecmp(tptr, ".org") || !strcasecmp(tptr, ".net") || @@ -1003,7 +984,8 @@ !strcasecmp(tptr, ".no") || !strcasecmp(tptr, ".ca") || !strcasecmp(tptr, ".nu") || - !strcasecmp(tptr, ".fr")) + !strcasecmp(tptr, ".fr") + ) { numofdots = 1; } @@ -1011,6 +993,8 @@ { numofdots = 2; } + if(!matches("*.AfterNET.Org", fullhost)) + numofdots = 4; temp = fullhost; for (x = 0; x <= (strlen(fullhost) - 1); x++) { @@ -1596,3 +1580,49 @@ else return (Name); } + +char *ActiveHost(UserListType uptr) +{ + static char buff[MAXLEN]; + char *buffptr = buff; + if(uptr->Modes & UMODEh) + { + char *uname; + char *host; + strcpy(buff, uptr->Sethost); + uname = mysep(&buffptr, "@"); + host = mysep(&buffptr, "@"); + + return(host); + } + else if(uptr->Modes & UMODEf) + return(uptr->Fakehost); + else if(uptr->Modes & UMODEr) + { + if(uptr->Modes & UMODEo) + sprintf(buff, "%s.%s", uptr->Account, HIDDEN_HOST_STAFF); + else + sprintf(buff, "%s.%s", uptr->Account, HIDDEN_HOST); + return(buff); + } + else + return(uptr->Address); +} + +char *ActiveUsername(UserListType uptr) +{ + static char buff[MAXLEN]; + char *buffptr = buff; + if(uptr->Modes & UMODEh) + { + char *uname; + strcpy(buff, uptr->Sethost); + uname = mysep(&buffptr, "@"); + return(uname); + } + else + return(uptr->UserID); +} + + + Index: x2/source/misc.h diff -u x2/source/misc.h:1.20 x2/source/misc.h:1.21 --- x2/source/misc.h:1.20 Sun Jul 4 13:42:19 2004 +++ x2/source/misc.h Mon Aug 23 08:25:48 2004 @@ -71,3 +71,5 @@ unsigned int base64toint(const char *s); const char* inttobase64(char* buf, unsigned int v, unsigned int count); void LogAccess(UserListType uptr, char* item, int size); +char *ActiveHost(UserListType uptr); +char *ActiveUsername(UserListType uptr); Index: x2/source/parse.c diff -u x2/source/parse.c:1.92 x2/source/parse.c:1.93 --- x2/source/parse.c:1.92 Mon Jul 5 01:12:14 2004 +++ x2/source/parse.c Mon Aug 23 08:25:48 2004 @@ -89,11 +89,13 @@ { "WA", m_noop, TRUE, TRUE }, { "R", m_noop, TRUE, TRUE }, { "SE", m_settime, TRUE, FALSE }, - { "AC", m_noop, TRUE, FALSE }, /* not used in X2 */ + { "AC", m_account, TRUE, FALSE }, { "PRIVS", m_noop, TRUE, FALSE }, { "WU", m_noop, TRUE, TRUE }, { "LL", m_noop, TRUE, FALSE }, +#ifdef notdef { "SH", m_sethost, TRUE, FALSE }, +#endif { "FA", m_fakehost, TRUE, FALSE }, { "OM", m_noop, TRUE, TRUE }, { "CM", m_noop, TRUE, TRUE }, @@ -125,16 +127,54 @@ return true; } +/* This dont even exist.. it uses usermode */ +#ifdef notdef int m_sethost(M_PARAMS) { /* TODO: Change the host part of the structure */ return(0); } +#endif int m_fakehost(M_PARAMS) { - /* TODO: Change the host part of the structure */ - return(0); + char *numnick; + char *fakehost; + + numnick = mysep(&rest, " "); + fakehost = mysep(&rest, " "); + uptr = FindNumnick(numnick, UsersU); + if(!uptr) + { + Debug(DBGERROR, "Failed to find numnick %s in m_fakehost", numnick); + return(0); + } + uptr->Modes = uptr->Modes | UMODEf; + free(uptr->Fakehost); + uptr->Fakehost = malloc(strlen(fakehost)+1); + strcpy(uptr->Fakehost, fakehost); + return(0); +} +/* This is set when someone auths with srvx */ +/* It should set UMODEr and uptr->Account */ +int m_account(M_PARAMS) +{ + char *numnick; + char *account; + + numnick = mysep(&rest, " "); + account = mysep(&rest, " "); + uptr = FindNumnick(numnick, UsersU); + if(!uptr) + { + Debug(DBGERROR, "Failed to find numnick '%s' for AC '%s' (in m_account()) ", numnick, account); + return(0); + } + uptr->Modes = uptr->Modes | UMODEr; + free(uptr->Account); + uptr->Account = malloc(strlen(account) + 1); + strcpy(uptr->Account, account); + return(0); } int m_notice(M_PARAMS) @@ -418,9 +458,10 @@ int m_nick(M_PARAMS) { char* Arg[9]; - char* modes, *account, *sethost, *fakehost; + char* modes, *account = "", *sethost = "", *fakehost = ""; UserListType UserPtr; unsigned int IP; + char modestr[MAXLEN]; /* Built from parsing to pass to UserMode() */ Arg[0] = (char *) strtok(rest, " "); /* nick */ Arg[1] = (char *) strtok(NULL, " "); /* 1 */ @@ -440,20 +481,27 @@ Arg[3] = (char *) strtok(NULL, " "); /* userID */ Arg[4] = (char *) strtok(NULL, " "); /* address */ modes = (char *) strtok(NULL, " "); /* modes */ + strcpy(modestr, modes); if(modes[0] == '+') { Arg[5] = modes; if(strchr(modes, 'r')) { account = (char *) strtok(NULL, " "); /* This user has an account set from another service */ + strcat(modestr, " "); + strcat(modestr, account); } if(strchr(modes, 'h')) { sethost = (char *) strtok(NULL, " "); /* This user has an hidden hostmask (asuka/Nefarious only) */ + strcat(modestr, " "); + strcat(modestr, sethost); } if(strchr(modes, 'f')) { fakehost = (char *) strtok(NULL, " "); /* This user has an hidden hostmask (GameSurge/Nefarious only) */ + strcat(modestr, " "); + strcat(modestr, fakehost); } Arg[6] = (char *) strtok(NULL, " "); /* Compressed IP */ } @@ -475,14 +523,16 @@ Debug(DBGWARNING, "Incorrect syntax in NICK line"); return(0); } - UserPtr = AddUser(Arg[7], Arg[0], Arg[3], Arg[4], Arg[8], IP, sptr->Name, NOMODES); + UserPtr = AddUser(Arg[7], Arg[0], Arg[3], Arg[4], Arg[8], IP, sptr->Name, NOMODES, account, sethost, fakehost); if(!UserPtr) { Debug(DBGWARNING, "AddUser returned NULL for %s", Arg[0]); return(0); } - if(modes[0] == '+') - ProcessUserMode(UserPtr, modes); + + if(modes[0] == '+') + ProcessUserMode(UserPtr, modestr); + if(!NETBURSTING) SendMOTD(UserPtr); if(UserPtr) @@ -808,10 +858,10 @@ char* Arg[4]; Arg[0] = (char *) strtok(rest, " "); /* nick/channel */ - Arg[1] = (char *) strtok(NULL, " "); /* +/- mode */ if (Arg[0][0] == '#') { char buff[MAXLEN]; + Arg[1] = (char *) strtok(NULL, " "); /* +/- mode */ Arg[2] = (char *) strtok(NULL, " "); Arg[3] = (char *) strtok(NULL, "\n\0"); snprintf(buff, MAXLEN, "%s %s %s", Arg[1], Arg[2]?Arg[2]:"", Arg[3]?Arg[3]:""); @@ -822,7 +872,10 @@ on_mode(GetChannel(Arg[0]), NULL, buff); } else - ProcessUserMode(uptr, &Arg[1][1]); + { + Arg[1] = strtok(NULL, "\0"); + ProcessUserMode(uptr, Arg[1]); + } return (0); } int m_pong(M_PARAMS) @@ -1537,7 +1590,7 @@ } } AddUser(NumNick, IrcNick, IrcNick, "X2", ServiceName, - LOCALIP, ServiceName, (UMODEk & UMODEo)); + LOCALIP, ServiceName, (UMODEk & UMODEo),"","",""); ProcessUserMode(FindNick(IrcNick, UsersN), "+kows"); return; Index: x2/source/parse.h diff -u x2/source/parse.h:1.15 x2/source/parse.h:1.16 --- x2/source/parse.h:1.15 Sun Jul 4 13:42:19 2004 +++ x2/source/parse.h Mon Aug 23 08:25:48 2004 @@ -28,6 +28,9 @@ int m_quit(M_PARAMS); int m_kill(M_PARAMS); int m_squit(M_PARAMS); +#ifdef notdef int m_sethost(M_PARAMS); +#endif int m_fakehost(M_PARAMS); +int m_account(M_PARAMS); int m_logerror(M_PARAMS); Index: x2/source/user.c diff -u x2/source/user.c:1.36 x2/source/user.c:1.37 --- x2/source/user.c:1.36 Wed Jun 9 16:33:03 2004 +++ x2/source/user.c Mon Aug 23 08:25:48 2004 @@ -180,7 +180,7 @@ return (false); } -UserListType AddUser(char *Numnick, char *Nick, char *UserID, char *Address, char *RealName, unsigned int IP, char *Serv, unsigned char Modes) +UserListType AddUser(char *Numnick, char *Nick, char *UserID, char *Address, char *RealName, unsigned int IP, char *Serv, unsigned char Modes, char *Account, char *Sethost, char *Fakehost) { static int UserSegWarning = 1; UserListType NewUser, UserNode; @@ -210,6 +210,12 @@ return(NULL); if (!(NewUser->Address = (char *) malloc(strlen(Address) + 1))) return(NULL); + if (!(NewUser->Account = (char *) malloc(strlen(Account) + 1))) + return(NULL); + if (!(NewUser->Sethost = (char *) malloc(strlen(Sethost) + 1))) + return(NULL); + if (!(NewUser->Fakehost = (char *) malloc(strlen(Fakehost) + 1))) + return(NULL); if (!(NewUser->Serv = (char *) malloc(strlen(Serv) + 1))) return(NULL); if (!(NewUser->RealName = (char *) malloc(strlen(RealName) + 1))) @@ -218,6 +224,9 @@ UpdateCloneCount(CleanUserID, Address, CloneCount, UsersA); strcpy(NewUser->UserID, CleanUserID); strcpy(NewUser->Address, Address); + strcpy(NewUser->Account, Account); + strcpy(NewUser->Fakehost, Fakehost); + strcpy(NewUser->Sethost, Sethost); strcpy(NewUser->Serv, Serv); strcpy(NewUser->RealName, RealName); NewUser->IP = IP; @@ -472,7 +481,11 @@ if (ServPtr) ServPtr->NumOfUsers--; free(CurrPtrN->Address); + free(CurrPtrN->Account); + free(CurrPtrN->Fakehost); + free(CurrPtrN->Sethost); free(CurrPtrN->Serv); + free(CurrPtrN->RealName); free(CurrPtrN); } @@ -516,21 +529,26 @@ void ProcessUserMode(UserListType uptr, char *Modes) { -/* i'm not realy satisfied with the way this works */ char ch; char Operator = '+'; int len, i; unsigned int UserMode; + char *modestr; + char *sethost; + char *fakehost; + char *account; if (uptr == NULL) return; + modestr = mysep(&Modes, " "); + UserMode = NOMODES; - len = strlen(Modes); + len = strlen(modestr); for (i = 0; i < len; i++) { - ch = Modes[i]; + ch = modestr[i]; switch (ch) { case 'o': @@ -550,6 +568,20 @@ break; case 'h': UserMode = UMODEh; + if(Operator == '+') + { + /* Need to store the sethost! */ + sethost = mysep(&Modes, " "); + free(uptr->Sethost); /* Free the old one */ + uptr->Sethost = malloc(strlen(sethost) + 1); /* Make room */ + strcpy(uptr->Sethost, sethost); /* Copy it over */ + } + else + { + free(uptr->Sethost); + uptr->Sethost = malloc(2); + strcpy(uptr->Sethost, ""); + } break; case 'g': UserMode = UMODEg; @@ -559,9 +591,29 @@ break; case 'x': UserMode = UMODEx; + /* Can only be +, error on - */ break; case 'r': + /* Important NOTE: This is used for bursting, but after + * that m_account() gets called, which does the following + * itself (so look there too). + * Also note that -r doesnt ever really happen + */ UserMode = UMODEr; + if(Operator == '+') + { + /* Need to store the account */ + account = mysep(&Modes, " "); + free(uptr->Account); /* Free the old one */ + uptr->Account = malloc(strlen(account) + 1); + strcpy(uptr->Account, account); + } + else /* NEVER gets used. you cant unregister */ + { + free(uptr->Account); + uptr->Account = malloc(2); + strcpy(uptr->Account, ""); + } break; case 'B': UserMode = UMODEB; @@ -571,6 +623,21 @@ break; case 'f': UserMode = UMODEf; + if(Operator == '+') + { + /* Need to store teh fakehost! */ + fakehost = mysep(&Modes, " "); + free(uptr->Fakehost); + uptr->Fakehost = malloc(strlen(fakehost) + 1); + strcpy(uptr->Fakehost, fakehost); + } + else + { + free(uptr->Fakehost); + uptr->Fakehost = malloc(2); + strcpy(uptr->Fakehost, ""); + } + break; case '-': Operator = ch; break; Index: x2/source/user.h diff -u x2/source/user.h:1.12 x2/source/user.h:1.13 --- x2/source/user.h:1.12 Tue Jan 2 02:11:33 2001 +++ x2/source/user.h Mon Aug 23 08:25:48 2004 @@ -11,7 +11,7 @@ boolean IsOper(UserListType uptr); boolean IsGodOper(UserListType uptr); boolean IsOperByAdd(char *UserID, char *Address); -UserListType AddUser(char *Numnick, char *Nick, char *UserID, char *Address, char *RealName, unsigned int IP, char *Serv, unsigned char Modes); +UserListType AddUser(char *Numnick, char *Nick, char *UserID, char *Address, char *RealName, unsigned int IP, char *Serv, unsigned char Modes, char *Account, char *Sethost, char *Fakehost); void DeleteAllUsersByServer(char *ServerName); void DeleteUser(UserListType uptr, boolean sendnotice); void KillUserList(); ----------------------- End of diff ----------------------- |