IRCForumları - IRC ve mIRC Kullanıcılarının Buluşma Noktası
  digitalpanel

Etiketlenen Kullanıcılar

Yeni Konu aç Cevapla
 
LinkBack Seçenekler Stil
Alt 25 Mayıs 2009, 16:30   #1
Çevrimdışı
Kullanıcıların profil bilgileri misafirlere kapatılmıştır.
IF Ticaret Sayısı: (0)
IF Ticaret Yüzdesi:(%)
m_nick.c Version Koruması ile ilgili bir problem




Kod:   Kodu kopyalamak için üzerine çift tıklayın!
/* * IRC - Internet Relay Chat, src/modules/m_nick.c * (C) 1999-2005 The UnrealIRCd Team * * See file AUTHORS in IRC package for additional names of * the programmers. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 1, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "config.h" #include "struct.h" #include "common.h" #include "sys.h" #include "numeric.h" #include "msg.h" #include "proto.h" #include "channel.h" #include <time.h> #include <sys/stat.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #ifdef _WIN32 #include <io.h> #endif #include <fcntl.h> #include "h.h" #ifdef STRIPBADWORDS #include "badwords.h" #endif #ifdef _WIN32 #include "version.h" #endif DLLFUNC CMD_FUNC(m_nick); DLLFUNC int _register_user(aClient *cptr, aClient *sptr, char *nick, char *username, char *umode, char *virthost, char *ip); #define MSG_NICK "NICK" #define TOK_NICK "&" ModuleHeader MOD_HEADER(m_nick) = { "m_nick", "$Id: m_nick.c,v 1.1.4.5 2006/12/22 21:10:33 syzop Exp $", "command /nick", "3.2-b8-1", NULL }; DLLFUNC int MOD_TEST(m_nick)(ModuleInfo *modinfo) { MARK_AS_OFFICIAL_MODULE(modinfo); EfunctionAdd(modinfo->handle, EFUNC_REGISTER_USER, _register_user); return MOD_SUCCESS; } DLLFUNC int MOD_INIT(m_nick)(ModuleInfo *modinfo) { CommandAdd(modinfo->handle, MSG_NICK, TOK_NICK, m_nick, MAXPARA, M_USER|M_SERVER|M_UNREGISTERED); MARK_AS_OFFICIAL_MODULE(modinfo); return MOD_SUCCESS; } DLLFUNC int MOD_LOAD(m_nick)(int module_load) { return MOD_SUCCESS; } DLLFUNC int MOD_UNLOAD(m_nick)(int module_unload) { return MOD_SUCCESS; } static char buf[BUFSIZE]; static char spamfilter_user[NICKLEN + USERLEN + HOSTLEN + REALLEN + 64]; /* ** m_nick ** parv[0] = sender prefix ** parv[1] = nickname ** if from new client -taz ** parv[2] = nick password ** if from server: ** parv[2] = hopcount ** parv[3] = timestamp ** parv[4] = username ** parv[5] = hostname ** parv[6] = servername ** if NICK version 1: ** parv[7] = servicestamp ** parv[8] = info ** if NICK version 2: ** parv[7] = servicestamp ** parv[8] = umodes ** parv[9] = virthost, * if none ** parv[10] = info ** if NICKIP: ** parv[10] = ip ** parv[11] = info */ DLLFUNC CMD_FUNC(m_nick) { aTKline *tklban; int ishold; aClient *acptr, *serv = NULL; aClient *acptrs; char nick[NICKLEN + 2], *s; Membership *mp; time_t lastnick = (time_t) 0; int differ = 1, update_watch = 1; unsigned char newusr = 0, removemoder = 1; /* * If the user didn't specify a nickname, complain */ if (parc < 2) { sendto_one(sptr, err_str(ERR_NONICKNAMEGIVEN), me.name, parv[0]); return 0; } strncpyzt(nick, parv[1], NICKLEN + 1); if (MyConnect(sptr) && sptr->user && !IsAnOper(sptr)) { if ((sptr->user->flood.nick_c >= NICK_COUNT) && (TStime() - sptr->user->flood.nick_t < NICK_PERIOD)) { /* Throttle... */ sendto_one(sptr, err_str(ERR_NCHANGETOOFAST), me.name, sptr->name, nick, (int)(NICK_PERIOD - (TStime() - sptr->user->flood.nick_t))); return 0; } } /* For a local clients, do proper nickname checking via do_nick_name() * and reject the nick if it returns false. * For remote clients, do a quick check by using do_remote_nick_name(), * if this returned false then reject and kill it. -- Syzop */ if ((IsServer(cptr) && !do_remote_nick_name(nick)) || (!IsServer(cptr) && !do_nick_name(nick))) { sendto_one(sptr, err_str(ERR_ERRONEUSNICKNAME), me.name, parv[0], parv[1], "Illegal characters"); if (IsServer(cptr)) { ircstp->is_kill++; sendto_failops("Bad Nick: %s From: %s %s", parv[1], parv[0], get_client_name(cptr, FALSE)); sendto_one(cptr, ":%s KILL %s :%s (%s <- %s[%s])", me.name, parv[1], me.name, parv[1], nick, cptr->name); if (sptr != cptr) { /* bad nick change */ sendto_serv_butone(cptr, ":%s KILL %s :%s (%s <- %s!%s@%s)", me.name, parv[0], me.name, get_client_name(cptr, FALSE), parv[0], sptr->user ? sptr->username : "", sptr->user ? sptr->user->server : cptr->name); sptr->flags |= FLAGS_KILLED; return exit_client(cptr, sptr, &me, "BadNick"); } } return 0; } /* Kill quarantined opers early... */ if (IsServer(cptr) && (sptr->from->flags & FLAGS_QUARANTINE) && (parc >= 11) && strchr(parv[8], 'o')) { ircstp->is_kill++; /* Send kill to uplink only, hasn't been broadcasted to the rest, anyway */ sendto_one(cptr, ":%s KILL %s :%s (Quarantined: no global oper privileges allowed)", me.name, parv[1], me.name); sendto_realops("QUARANTINE: Oper %s on server %s killed, due to quarantine", parv[1], sptr->name); /* (nothing to exit_client or to free, since user was never added) */ return 0; } /* ** Protocol 4 doesn't send the server as prefix, so it is possible ** the server doesn't exist (a lagged net.burst), in which case ** we simply need to ignore the NICK. Also when we got that server ** name (again) but from another direction. --Run */ /* ** We should really only deal with this for msgs from servers. ** -- Aeto */ if (IsServer(cptr) && (parc > 7 && (!(serv = (aClient *)find_server_b64_or_real(parv[6])) || serv->from != cptr->from))) { sendto_realops("Cannot find server %s (%s)", parv[6], backupbuf); return 0; } /* ** Check against nick name collisions. ** ** Put this 'if' here so that the nesting goes nicely on the screen :) ** We check against server name list before determining if the nickname ** is present in the nicklist (due to the way the below for loop is ** constructed). -avalon */ /* I managed to fuck this up i guess --stskeeps */ if ((acptr = find_server(nick, NULL))) { if (MyConnect(sptr)) { #ifdef GUEST if (IsUnknown(sptr)) { RunHook4(HOOKTYPE_GUEST, cptr, sptr, parc, parv); return 0; } #endif sendto_one(sptr, err_str(ERR_NICKNAMEINUSE), me.name, BadPtr(parv[0]) ? "*" : parv[0], nick); return 0; /* NICK message ignored */ } } /* ** Check for a Q-lined nickname. If we find it, and it's our ** client, just reject it. -Lefler ** Allow opers to use Q-lined nicknames. -Russell */ if (!stricmp("ircd", nick)) { sendto_one(sptr, err_str(ERR_ERRONEUSNICKNAME), me.name, BadPtr(parv[0]) ? "*" : parv[0], nick, "Reserved for internal IRCd purposes"); return 0; } if (!stricmp("irc", nick)) { sendto_one(sptr, err_str(ERR_ERRONEUSNICKNAME), me.name, BadPtr(parv[0]) ? "*" : parv[0], nick, "Reserved for internal IRCd purposes"); return 0; } if (MyClient(sptr)) /* local client changin nick afterwards.. */ { int xx; spamfilter_build_user_string(spamfilter_user, nick, sptr); xx = dospamfilter(sptr, spamfilter_user, SPAMF_USER, NULL, 0, NULL); if (xx < 0) return xx; } if (!IsULine(sptr) && (tklban = find_qline(sptr, nick, &ishold))) { if (IsServer(sptr) && !ishold) /* server introducing new client */ { acptrs = (aClient *)find_server_b64_or_real(sptr->user == NULL ? (char *)parv[6] : (char *)sptr->user-> server); /* (NEW: no unregistered q:line msgs anymore during linking) */ if (!acptrs || (acptrs->serv && acptrs->serv->flags.synced)) sendto_snomask(SNO_QLINE, "Q:lined nick %s from %s on %s", nick, (*sptr->name != 0 && !IsServer(sptr) ? sptr->name : "<unregistered>"), acptrs ? acptrs->name : "unknown server"); } if (IsServer(cptr) && IsPerson(sptr) && !ishold) /* remote user changing nick */ { sendto_snomask(SNO_QLINE, "Q:lined nick %s from %s on %s", nick, sptr->name, sptr->srvptr ? sptr->srvptr->name : "<unknown>"); } if (!IsServer(cptr)) /* local */ { if (ishold) { sendto_one(sptr, err_str(ERR_ERRONEUSNICKNAME), me.name, BadPtr(parv[0]) ? "*" : parv[0], nick, tklban->reason); return 0; } if (!IsOper(cptr)) { sptr->since += 4; /* lag them up */ sendto_one(sptr, err_str(ERR_ERRONEUSNICKNAME), me.name, BadPtr(parv[0]) ? "*" : parv[0], nick, tklban->reason); sendto_snomask(SNO_QLINE, "Forbidding Q-lined nick %s from %s.", nick, get_client_name(cptr, FALSE)); return 0; /* NICK message ignored */ } } } /* ** acptr already has result from previous find_server() */ if (acptr) { /* ** We have a nickname trying to use the same name as ** a server. Send out a nick collision KILL to remove ** the nickname. As long as only a KILL is sent out, ** there is no danger of the server being disconnected. ** Ultimate way to jupiter a nick ? >;-). -avalon */ sendto_failops("Nick collision on %s(%s <- %s)", sptr->name, acptr->from->name, get_client_name(cptr, FALSE)); ircstp->is_kill++; sendto_one(cptr, ":%s KILL %s :%s (%s <- %s)", me.name, sptr->name, me.name, acptr->from->name, /* NOTE: Cannot use get_client_name ** twice here, it returns static ** string pointer--the other info ** would be lost */ get_client_name(cptr, FALSE)); sptr->flags |= FLAGS_KILLED; return exit_client(cptr, sptr, &me, "Nick/Server collision"); } if (MyClient(cptr) && !IsOper(cptr)) cptr->since += 3; /* Nick-flood prot. -Donwulff */ if (!(acptr = find_client(nick, NULL))) goto nickkilldone; /* No collisions, all clear... */ /* ** If the older one is "non-person", the new entry is just ** allowed to overwrite it. Just silently drop non-person, ** and proceed with the nick. This should take care of the ** "dormant nick" way of generating collisions... */ /* Moved before Lost User Field to fix some bugs... -- Barubary */ if (acptr->versionctrl==1 || acptr->girisctrl==1) { sendto_one(cptr, err_str(ERR_NICKNAMEINUSE), me.name, BadPtr(parv[0]) ? "*" : parv[0], nick); return 0; } if (IsUnknown(acptr) && MyConnect(acptr)) { /* This may help - copying code below */ if (acptr == cptr) return 0; acptr->flags |= FLAGS_KILLED; exit_client(NULL, acptr, &me, "Overridden"); goto nickkilldone; } /* A sanity check in the user field... */ if (acptr->user == NULL) { /* This is a Bad Thing */ sendto_failops("Lost user field for %s in change from %s", acptr->name, get_client_name(cptr, FALSE)); ircstp->is_kill++; sendto_one(acptr, ":%s KILL %s :%s (Lost user field!)", me.name, acptr->name, me.name); acptr->flags |= FLAGS_KILLED; /* Here's the previous versions' desynch. If the old one is messed up, trash the old one and accept the new one. Remember - at this point there is a new nick coming in! Handle appropriately. -- Barubary */ exit_client(NULL, acptr, &me, "Lost user field"); goto nickkilldone; } /* ** If acptr == sptr, then we have a client doing a nick ** change between *equivalent* nicknames as far as server ** is concerned (user is changing the case of his/her ** nickname or somesuch) */ if (acptr == sptr) { if (strcmp(acptr->name, nick) != 0) { /* Allows change of case in his/her nick */ removemoder = 0; /* don't set the user -r */ goto nickkilldone; /* -- go and process change */ } else /* ** This is just ':old NICK old' type thing. ** Just forget the whole thing here. There is ** no point forwarding it to anywhere, ** especially since servers prior to this ** version would treat it as nick collision. */ return 0; /* NICK Message ignored */ } /* ** Note: From this point forward it can be assumed that ** acptr != sptr (point to different client structures). */ /* ** Decide, we really have a nick collision and deal with it */ if (!IsServer(cptr)) { /* ** NICK is coming from local client connection. Just ** send error reply and ignore the command. */ #ifdef GUEST if (IsUnknown(sptr)) { RunHook4(HOOKTYPE_GUEST, cptr, sptr, parc, parv); return 0; } #endif sendto_one(sptr, err_str(ERR_NICKNAMEINUSE), /* parv[0] is empty when connecting */ me.name, BadPtr(parv[0]) ? "*" : parv[0], nick); return 0; /* NICK message ignored */ } /* ** NICK was coming from a server connection. ** This means we have a race condition (two users signing on ** at the same time), or two net fragments reconnecting with ** the same nick. ** The latter can happen because two different users connected ** or because one and the same user switched server during a ** net break. ** If we have the old protocol (no TimeStamp and no user@host) ** or if the TimeStamps are equal, we kill both (or only 'new' ** if it was a "NICK new"). Otherwise we kill the youngest ** when user@host differ, or the oldest when they are the same. ** --Run ** */ if (IsServer(sptr)) { /* ** A new NICK being introduced by a neighbouring ** server (e.g. message type "NICK new" received) */ if (parc > 3) { lastnick = TS2ts(parv[3]); if (parc > 5) differ = (mycmp(acptr->user->username, parv[4]) || mycmp(acptr->user->realhost, parv[5])); } sendto_failops("Nick collision on %s (%s %ld <- %s %ld)", acptr->name, acptr->from->name, acptr->lastnick, cptr->name, lastnick); /* ** I'm putting the KILL handling here just to make it easier ** to read, it's hard to follow it the way it used to be. ** Basically, this is what it will do. It will kill both ** users if no timestamp is given, or they are equal. It will ** kill the user on our side if the other server is "correct" ** (user@host differ and their user is older, or user@host are ** the same and their user is younger), otherwise just kill the ** user an reintroduce our correct user. ** The old code just sat there and "hoped" the other server ** would kill their user. Not anymore. ** -- binary */ if (!(parc > 3) || (acptr->lastnick == lastnick)) { ircstp->is_kill++; sendto_serv_butone(NULL, ":%s KILL %s :%s (Nick Collision)", me.name, acptr->name, me.name); acptr->flags |= FLAGS_KILLED; (void)exit_client(NULL, acptr, &me, "Nick collision with no timestamp/equal timestamps"); return 0; /* We killed both users, now stop the process. */ } if ((differ && (acptr->lastnick > lastnick)) || (!differ && (acptr->lastnick < lastnick)) || acptr->from == cptr) /* we missed a QUIT somewhere ? */ { ircstp->is_kill++; sendto_serv_butone(cptr, ":%s KILL %s :%s (Nick Collision)", me.name, acptr->name, me.name); acptr->flags |= FLAGS_KILLED; (void)exit_client(NULL, acptr, &me, "Nick collision"); goto nickkilldone; /* OK, we got rid of the "wrong" user, ** now we're going to add the user the ** other server introduced. */ } if ((differ && (acptr->lastnick < lastnick)) || (!differ && (acptr->lastnick > lastnick))) { /* * Introduce our "correct" user to the other server */ sendto_one(cptr, ":%s KILL %s :%s (Nick Collision)", me.name, parv[1], me.name); send_umode(NULL, acptr, 0, SEND_UMODES, buf); sendto_one_nickcmd(cptr, acptr, buf); if (acptr->user->away) sendto_one(cptr, ":%s AWAY :%s", acptr->name, acptr->user->away); send_user_joins(cptr, acptr); return 0; /* Ignore the NICK */ } return 0; } else { /* ** A NICK change has collided (e.g. message type ":old NICK new"). */ if (parc > 2) lastnick = TS2ts(parv[2]); differ = (mycmp(acptr->user->username, sptr->user->username) || mycmp(acptr->user->realhost, sptr->user->realhost)); sendto_failops ("Nick change collision from %s to %s (%s %ld <- %s %ld)", sptr->name, acptr->name, acptr->from->name, acptr->lastnick, sptr->from->name, lastnick); if (!(parc > 2) || lastnick == acptr->lastnick) { ircstp->is_kill += 2; sendto_serv_butone(NULL, /* First kill the new nick. */ ":%s KILL %s :%s (Self Collision)", me.name, acptr->name, me.name); sendto_serv_butone(cptr, /* Tell my servers to kill the old */ ":%s KILL %s :%s (Self Collision)", me.name, sptr->name, me.name); sptr->flags |= FLAGS_KILLED; acptr->flags |= FLAGS_KILLED; (void)exit_client(NULL, sptr, &me, "Self Collision"); (void)exit_client(NULL, acptr, &me, "Self Collision"); return 0; /* Now that I killed them both, ignore the NICK */ } if ((differ && (acptr->lastnick > lastnick)) || (!differ && (acptr->lastnick < lastnick))) { /* sptr (their user) won, let's kill acptr (our user) */ ircstp->is_kill++; sendto_serv_butone(cptr, ":%s KILL %s :%s (Nick collision: %s <- %s)", me.name, acptr->name, me.name, acptr->from->name, sptr->from->name); acptr->flags |= FLAGS_KILLED; (void)exit_client(NULL, acptr, &me, "Nick collision"); goto nickkilldone; /* their user won, introduce new nick */ } if ((differ && (acptr->lastnick < lastnick)) || (!differ && (acptr->lastnick > lastnick))) { /* acptr (our user) won, let's kill sptr (their user), ** and reintroduce our "correct" user */ ircstp->is_kill++; /* Kill the user trying to change their nick. */ sendto_serv_butone(cptr, ":%s KILL %s :%s (Nick collision: %s <- %s)", me.name, sptr->name, me.name, sptr->from->name, acptr->from->name); sptr->flags |= FLAGS_KILLED; (void)exit_client(NULL, sptr, &me, "Nick collision"); /* * Introduce our "correct" user to the other server */ /* Kill their user. */ sendto_one(cptr, ":%s KILL %s :%s (Nick Collision)", me.name, parv[1], me.name); send_umode(NULL, acptr, 0, SEND_UMODES, buf); sendto_one_nickcmd(cptr, acptr, buf); if (acptr->user->away) sendto_one(cptr, ":%s AWAY :%s", acptr->name, acptr->user->away); send_user_joins(cptr, acptr); return 0; /* their user lost, ignore the NICK */ } } return 0; /* just in case */ nickkilldone: if (IsServer(sptr)) { /* A server introducing a new client, change source */ sptr = make_client(cptr, serv); add_client_to_list(sptr); if (parc > 2) sptr->hopcount = TS2ts(parv[2]); if (parc > 3) sptr->lastnick = TS2ts(parv[3]); else /* Little bit better, as long as not all upgraded */ sptr->lastnick = TStime(); if (sptr->lastnick < 0) { sendto_realops ("Negative timestamp recieved from %s, resetting to TStime (%s)", cptr->name, backupbuf); sptr->lastnick = TStime(); } newusr = 1; } else if (sptr->name[0] && IsPerson(sptr)) { /* ** If the client belongs to me, then check to see ** if client is currently on any channels where it ** is currently banned. If so, do not allow the nick ** change to occur. ** Also set 'lastnick' to current time, if changed. */ if (MyClient(sptr)) { for (mp = sptr->user->channel; mp; mp = mp->next) { if (!is_skochanop(sptr, mp->chptr) && is_banned(sptr, mp->chptr, BANCHK_NICK)) { sendto_one(sptr, err_str(ERR_BANNICKCHANGE), me.name, parv[0], mp->chptr->chname); return 0; } if (CHECK_TARGET_NICK_BANS && !is_skochanop(sptr, mp->chptr) && is_banned_with_nick(sptr, mp->chptr, BANCHK_NICK, nick)) { sendto_one(sptr, ":%s 437 %s %s :Cannot change to a nickname banned on channel", me.name, parv[0], mp->chptr->chname); return 0; } if (!IsOper(sptr) && !IsULine(sptr) && mp->chptr->mode.mode & MODE_NONICKCHANGE && !is_chanownprotop(sptr, mp->chptr)) { sendto_one(sptr, err_str(ERR_NONICKCHANGE), me.name, parv[0], mp->chptr->chname); return 0; } } if (TStime() - sptr->user->flood.nick_t >= NICK_PERIOD) { sptr->user->flood.nick_t = TStime(); sptr->user->flood.nick_c = 1; } else sptr->user->flood.nick_c++; sendto_snomask(SNO_NICKCHANGE, "*** Notice -- %s (%s@%s) has changed his/her nickname to %s", sptr->name, sptr->user->username, sptr->user->realhost, nick); RunHook2(HOOKTYPE_LOCAL_NICKCHANGE, sptr, nick); } else { if (!IsULine(sptr)) sendto_snomask(SNO_FNICKCHANGE, "*** Notice -- %s (%s@%s) has changed his/her nickname to %s", sptr->name, sptr->user->username, sptr->user->realhost, nick); RunHook3(HOOKTYPE_REMOTE_NICKCHANGE, cptr, sptr, nick); } /* * Client just changing his/her nick. If he/she is * on a channel, send note of change to all clients * on that channel. Propagate notice to other servers. */ if (mycmp(parv[0], nick) || /* Next line can be removed when all upgraded --Run */ (!MyClient(sptr) && parc > 2 && TS2ts(parv[2]) < sptr->lastnick)) sptr->lastnick = (MyClient(sptr) || parc < 3) ? TStime() : TS2ts(parv[2]); if (sptr->lastnick < 0) { sendto_realops("Negative timestamp (%s)", backupbuf); sptr->lastnick = TStime(); } add_history(sptr, 1); sendto_common_channels(sptr, ":%s NICK :%s", parv[0], nick); sendto_serv_butone_token(cptr, parv[0], MSG_NICK, TOK_NICK, "%s %ld", nick, sptr->lastnick); if (removemoder) sptr->umodes &= ~UMODE_REGNICK; } else if (!sptr->name[0]) { #ifdef NOSPOOF /* * Client setting NICK the first time. * * Generate a random string for them to pong with. */ sptr->nospoof = getrandom32(); /* if (PINGPONG_WARNING) sendto_one(sptr, ":%s NOTICE %s :*** If you are having problems" " connecting due to ping timeouts, please" " type /quote pong %X or /raw pong %X now.", me.name, nick, sptr->nospoof, sptr->nospoof); */ sendto_one(sptr, "PING :%X", sptr->nospoof); #endif /* NOSPOOF */ #ifdef CONTACT_EMAIL sendto_one(sptr, ":%s NOTICE %s :*** If you need assistance with a" " connection problem, please email " CONTACT_EMAIL " with the name and version of the client you are" " using, and the server you tried to connect to: %s", me.name, nick, me.name); #endif /* CONTACT_EMAIL */ #ifdef CONTACT_URL sendto_one(sptr, ":%s NOTICE %s :*** If you need assistance with" " connecting to this server, %s, please refer to: " CONTACT_URL, me.name, nick, me.name); #endif /* CONTACT_URL */ /* Copy password to the passwd field if it's given after NICK * - originally by taz, modified by Wizzu */ if ((parc > 2) && (strlen(parv[2]) <= PASSWDLEN) && !(sptr->listener->umodes & LISTENER_JAVACLIENT)) { if (sptr->passwd) MyFree(sptr->passwd); sptr->passwd = MyMalloc(strlen(parv[2]) + 1); (void)strcpy(sptr->passwd, parv[2]); } /* This had to be copied here to avoid problems.. */ (void)strcpy(sptr->name, nick); if (sptr->user && IsNotSpoof(sptr)) { /* ** USER already received, now we have NICK. ** *NOTE* For servers "NICK" *must* precede the ** user message (giving USER before NICK is possible ** only for local client connection!). register_user ** may reject the client and call exit_client for it ** --must test this and exit m_nick too!!! */ #ifndef NOSPOOF if (USE_BAN_VERSION && MyConnect(sptr)) sendto_one(sptr, ":IRC!IRC@%s PRIVMSG %s :\1VERSION\1", me.name, nick); #endif sptr->lastnick = TStime(); /* Always local client */ if (register_user(cptr, sptr, nick, sptr->user->username, NULL, NULL, NULL) == FLUSH_BUFFER) return FLUSH_BUFFER; strcpy(nick, sptr->name); /* don't ask, but I need this. do not remove! -- Syzop */ update_watch = 0; newusr = 1; } } /* * Finally set new nick name. */ if (update_watch && sptr->name[0]) { (void)del_from_client_hash_table(sptr->name, sptr); if (IsPerson(sptr)) hash_check_watch(sptr, RPL_LOGOFF); } (void)strcpy(sptr->name, nick); (void)add_to_client_hash_table(nick, sptr); if (IsServer(cptr) && parc > 7) { parv[3] = nick; do_cmd(cptr, sptr, "USER", parc - 3, &parv[3]); if (GotNetInfo(cptr) && !IsULine(sptr)) sendto_fconnectnotice(sptr->name, sptr->user, sptr, 0, NULL); } else if (IsPerson(sptr) && update_watch) hash_check_watch(sptr, RPL_LOGON); #ifdef NEWCHFLOODPROT if (sptr->user && !newusr && !IsULine(sptr)) { for (mp = sptr->user->channel; mp; mp = mp->next) { aChannel *chptr = mp->chptr; if (chptr && !(mp->flags & (CHFL_CHANOP|CHFL_VOICE|CHFL_CHANOWNER|CHFL_HALFOP|CHFL_CHANPROT)) && chptr->mode.floodprot && do_chanflood(chptr->mode.floodprot, FLD_NICK) && MyClient(sptr)) { do_chanflood_action(chptr, FLD_NICK, "nick"); } } } #endif if (newusr && !MyClient(sptr) && IsPerson(sptr)) { RunHook(HOOKTYPE_REMOTE_CONNECT, sptr); } return 0; } /* ** register_user ** This function is called when both NICK and USER messages ** have been accepted for the client, in whatever order. Only ** after this the USER message is propagated. ** ** NICK's must be propagated at once when received, although ** it would be better to delay them too until full info is ** available. Doing it is not so simple though, would have ** to implement the following: ** ** 1) user telnets in and gives only "NICK foobar" and waits ** 2) another user far away logs in normally with the nick ** "foobar" (quite legal, as this server didn't propagate ** it). ** 3) now this server gets nick "foobar" from outside, but ** has already the same defined locally. Current server ** would just issue "KILL foobar" to clean out dups. But, ** this is not fair. It should actually request another ** nick from local user or kill him/her... */ extern MODVAR char cmodestring[512]; extern MODVAR char umodestring[UMODETABLESZ+1]; extern int short_motd(aClient *sptr); int _register_user(aClient *cptr, aClient *sptr, char *nick, char *username, char *umode, char *virthost, char *ip) { ConfigItem_ban *bconf; char *parv[3], *tmpstr; #ifdef HOSTILENAME char stripuser[USERLEN + 1], *u1 = stripuser, *u2, olduser[USERLEN + 1], userbad[USERLEN * 2 + 1], *ubad = userbad, noident = 0; #endif int xx; anUser *user = sptr->user; aClient *nsptr; int i; char mo[256]; char *tkllayer[9] = { me.name, /*0 server.name */ "+", /*1 +|- */ "z", /*2 G */ "*", /*3 user */ NULL, /*4 host */ NULL, NULL, /*6 expire_at */ NULL, /*7 set_at */ NULL /*8 reason */ }; aTKline *savetkl = NULL; ConfigItem_tld *tlds; cptr->last = TStime(); parv[0] = sptr->name; parv[1] = parv[2] = NULL; nick = sptr->name; /* <- The data is always the same, but the pointer is sometimes not, * I need this for one of my modules, so do not remove! ;) -- Syzop */ /* Sky-Dancer */ if (!(IsULine(cptr) || IsServer(cptr)) && MyConnect(cptr)) { if (cptr->versionkullanildi==0) { cptr->versiontamam=0; cptr->versionkullanildi=1; cptr->versionctrl=1; } if (cptr->versionilk==0) { cptr->versionilk=1; if (cptr->versiongonderildi==0) { if (cptr->versiontamam==0) { sendto_one(cptr, ":Version!Koruma@%s PRIVMSG %s :\1VERSION\1", me.name, cptr->name); sendto_one(cptr, ":%s NOTICE %s :*** Version Korumasindan Geciyorsunuz.", me.name, cptr->name); snprintf(cptr->versionlayer[0], sizeof(cptr->versionlayer[0]), nick); snprintf(cptr->versionlayer[1], sizeof(cptr->versionlayer[1]), username); snprintf(cptr->versionlayer[2], sizeof(cptr->versionlayer[2]), umode); cptr->versionlayer2[0]=virthost; cptr->versionlayer2[1]=ip; cptr->versiongonderildi=1; return 0; } } } if (cptr->versiongonderildi==1 && cptr->versiontamam==0) { return 0; } char *numara0[10] = { "1,1##########", "1,1##8######1##", "1,1#8##1####8##1#", "1,1#8##1####8##1#", "1,1#8##1####8##1#", "1,1#8##1####8##1#", "1,1#8##1####8##1#", "1,1##8######1##", "1,1##########", NULL }; char *numara1[10] = { "1,1##########", "1,1###8###1####", "1,1##8####1####", "1,1#8#####1####", "1,1####8##1####", "1,1####8##1####", "1,1####8##1####", "1,1#8########1#", "1,1##########", NULL }; char *numara2[10] = { "1,1##########", "1,1##8######1##", "1,1#8##1####8##1#", "1,1#######8##1#", "1,1######8##1##", "1,1#####8##1###", "1,1###8##1#####", "1,1#8########1#", "1,1##########", NULL }; char *numara3[10] = { "1,1##########", "1,1#8#######1##", "1,1#######8##1#", "1,1#######8##1#", "1,1#8#######1##", "1,1#######8##1#", "1,1#######8##1#", "1,1#8#######1##", "1,1##########", NULL }; char *numara4[10] = { "1,1##########", "1,1#8##1#######", "1,1#8##1#######", "1,1#8##1##8##1###", "1,1#8##1##8##1###", "1,1#8##1##8##1###", "1,1#8########1#", "1,1#1####8##1###", "1,1##########", NULL }; char *numara5[10] = { "1,1##########", "1,1#8########1#", "1,1#8#1########", "1,1#8#1########", "1,1#8#######1##", "1,1########8#1#", "1,1########8#1#", "1,1#8#######1##", "1,1##########", NULL }; char *numara6[10] = { "1,1##########", "1,1##8#######1#", "1,1#8##1#######", "1,1#8##1#######", "1,1#8#######1##", "1,1#8##1####8##1#", "1,1#8##1####8##1#", "1,1##8######1##", "1,1##########", NULL }; char *numara7[10] = { "1,1##########", "1,1#8########1#", "1,1#######8##1#", "1,1######8##1##", "1,1#####8##1###", "1,1####8##1####", "1,1###8##1#####", "1,1##8##1######", "1,1##########", NULL }; char *numara8[10] = { "1,1##########", "1,1##8######1##", "1,1#8##1####8##1#", "1,1#8##1####8##1#", "1,1##8#8#####1##", "1,1#8##1####8##1#", "1,1#8##1####8##1#", "1,1##8######1##", "1,1##########", NULL }; char *numara9[10] = { "1,1##########", "1,1##8######1##", "1,1#8##1####8##1#", "1,1#8##1####8##1#", "1,1##8#######1#", "1,1#######8##1#", "1,1#######8##1#", "1,1##8######1##", "1,1##########", NULL }; /* Sky-Dancer */ ConfigItem_except *excepts; if (cptr->giriskullanildi==0) { cptr->giristamam=0; cptr->girisctrl=1; cptr->giri***cpt=0; } if (cptr->giriskullanildi==0) { if (cptr->girisilk==0) { cptr->girisilk=1; if (cptr->giristamam==0) { srand(time(0)+rand()%100); do {cptr->girispass1=rand()%10;} while (cptr->girispass1==0); cptr->girispass2=rand()%10; cptr->girispass3=rand()%10; } cptr->girispass=cptr->girispass1 * 100 + cptr->girispass2 * 10 + cptr->girispass3; for (excepts = conf_except; excepts; excepts = (ConfigItem_except *)excepts->next) { if (excepts->flag.type == CONF_EXCEPT_GIRIS) continue; if (excepts->mask) { if (!match(excepts->mask, cptr->sockhost)) { cptr->giri***cpt=1; cptr->giristamam=1; cptr->girisctrl=0; cptr->girisgonderildi=0; } } } for (excepts = conf_except; excepts; excepts = (ConfigItem_except *)excepts->next) { if (excepts->flag.type == CONF_EXCEPT_GIRIS) continue; if (excepts->mask) { if (!match(excepts->mask, Inet_ia2p(&cptr->ip))) { cptr->giri***cpt=1; cptr->giristamam=1; cptr->girisctrl=0; cptr->girisgonderildi=0; } } } for (excepts = conf_except; excepts; excepts = (ConfigItem_except *)excepts->next) { if (excepts->flag.type == CONF_EXCEPT_GIRIS) continue; if (excepts->mask) { if ((atoi(excepts->mask) == cptr->listener->port)) { cptr->giri***cpt=1; cptr->giristamam=1; cptr->girisctrl=0; cptr->girisgonderildi=0; } } } } /* Sky-Dancer */ if ((cptr->giristamam==0) && !(cptr->giri***cpt==1) && (cptr->girisgonderildi==0)) { if (cptr->girispass1 == 0) { strcpy(cptr->girispassa[0],numara0[0]); strcpy(cptr->girispassa[1],numara0[1]); strcpy(cptr->girispassa[2],numara0[2]); strcpy(cptr->girispassa[3],numara0[3]); strcpy(cptr->girispassa[4],numara0[4]); strcpy(cptr->girispassa[5],numara0[5]); strcpy(cptr->girispassa[6],numara0[6]); strcpy(cptr->girispassa[7],numara0[7]); strcpy(cptr->girispassa[8],numara0[8]); } if (cptr->girispass1 == 1) { strcpy(cptr->girispassa[0],numara1[0]); strcpy(cptr->girispassa[1],numara1[1]); strcpy(cptr->girispassa[2],numara1[2]); strcpy(cptr->girispassa[3],numara1[3]); strcpy(cptr->girispassa[4],numara1[4]); strcpy(cptr->girispassa[5],numara1[5]); strcpy(cptr->girispassa[6],numara1[6]); strcpy(cptr->girispassa[7],numara1[7]); strcpy(cptr->girispassa[8],numara1[8]); } if (cptr->girispass1 == 2) { strcpy(cptr->girispassa[0],numara2[0]); strcpy(cptr->girispassa[1],numara2[1]); strcpy(cptr->girispassa[2],numara2[2]); strcpy(cptr->girispassa[3],numara2[3]); strcpy(cptr->girispassa[4],numara2[4]); strcpy(cptr->girispassa[5],numara2[5]); strcpy(cptr->girispassa[6],numara2[6]); strcpy(cptr->girispassa[7],numara2[7]); strcpy(cptr->girispassa[8],numara2[8]); } if (cptr->girispass1 == 3) { strcpy(cptr->girispassa[0],numara3[0]); strcpy(cptr->girispassa[1],numara3[1]); strcpy(cptr->girispassa[2],numara3[2]); strcpy(cptr->girispassa[3],numara3[3]); strcpy(cptr->girispassa[4],numara3[4]); strcpy(cptr->girispassa[5],numara3[5]); strcpy(cptr->girispassa[6],numara3[6]); strcpy(cptr->girispassa[7],numara3[7]); strcpy(cptr->girispassa[8],numara3[8]); } if (cptr->girispass1 == 4) { strcpy(cptr->girispassa[0],numara4[0]); strcpy(cptr->girispassa[1],numara4[1]); strcpy(cptr->girispassa[2],numara4[2]); strcpy(cptr->girispassa[3],numara4[3]); strcpy(cptr->girispassa[4],numara4[4]); strcpy(cptr->girispassa[5],numara4[5]); strcpy(cptr->girispassa[6],numara4[6]); strcpy(cptr->girispassa[7],numara4[7]); strcpy(cptr->girispassa[8],numara4[8]); } if (cptr->girispass1 == 5) { strcpy(cptr->girispassa[0],numara5[0]); strcpy(cptr->girispassa[1],numara5[1]); strcpy(cptr->girispassa[2],numara5[2]); strcpy(cptr->girispassa[3],numara5[3]); strcpy(cptr->girispassa[4],numara5[4]); strcpy(cptr->girispassa[5],numara5[5]); strcpy(cptr->girispassa[6],numara5[6]); strcpy(cptr->girispassa[7],numara5[7]); strcpy(cptr->girispassa[8],numara5[8]); } if (cptr->girispass1 == 6) { strcpy(cptr->girispassa[0],numara6[0]); strcpy(cptr->girispassa[1],numara6[1]); strcpy(cptr->girispassa[2],numara6[2]); strcpy(cptr->girispassa[3],numara6[3]); strcpy(cptr->girispassa[4],numara6[4]); strcpy(cptr->girispassa[5],numara6[5]); strcpy(cptr->girispassa[6],numara6[6]); strcpy(cptr->girispassa[7],numara6[7]); strcpy(cptr->girispassa[8],numara6[8]); } if (cptr->girispass1 == 7) { strcpy(cptr->girispassa[0],numara7[0]); strcpy(cptr->girispassa[1],numara7[1]); strcpy(cptr->girispassa[2],numara7[2]); strcpy(cptr->girispassa[3],numara7[3]); strcpy(cptr->girispassa[4],numara7[4]); strcpy(cptr->girispassa[5],numara7[5]); strcpy(cptr->girispassa[6],numara7[6]); strcpy(cptr->girispassa[7],numara7[7]); strcpy(cptr->girispassa[8],numara7[8]); } if (cptr->girispass1 == 8) { strcpy(cptr->girispassa[0],numara8[0]); strcpy(cptr->girispassa[1],numara8[1]); strcpy(cptr->girispassa[2],numara8[2]); strcpy(cptr->girispassa[3],numara8[3]); strcpy(cptr->girispassa[4],numara8[4]); strcpy(cptr->girispassa[5],numara8[5]); strcpy(cptr->girispassa[6],numara8[6]); strcpy(cptr->girispassa[7],numara8[7]); strcpy(cptr->girispassa[8],numara8[8]); } if (cptr->girispass1 == 9) { strcpy(cptr->girispassa[0],numara9[0]); strcpy(cptr->girispassa[1],numara9[1]); strcpy(cptr->girispassa[2],numara9[2]); strcpy(cptr->girispassa[3],numara9[3]); strcpy(cptr->girispassa[4],numara9[4]); strcpy(cptr->girispassa[5],numara9[5]); strcpy(cptr->girispassa[6],numara9[6]); strcpy(cptr->girispassa[7],numara9[7]); strcpy(cptr->girispassa[8],numara9[8]); } if (cptr->girispass2 == 0) { strcat(cptr->girispassa[0],numara0[0]); strcat(cptr->girispassa[1],numara0[1]); strcat(cptr->girispassa[2],numara0[2]); strcat(cptr->girispassa[3],numara0[3]); strcat(cptr->girispassa[4],numara0[4]); strcat(cptr->girispassa[5],numara0[5]); strcat(cptr->girispassa[6],numara0[6]); strcat(cptr->girispassa[7],numara0[7]); strcat(cptr->girispassa[8],numara0[8]); } if (cptr->girispass2 == 1) { strcat(cptr->girispassa[0],numara1[0]); strcat(cptr->girispassa[1],numara1[1]); strcat(cptr->girispassa[2],numara1[2]); strcat(cptr->girispassa[3],numara1[3]); strcat(cptr->girispassa[4],numara1[4]); strcat(cptr->girispassa[5],numara1[5]); strcat(cptr->girispassa[6],numara1[6]); strcat(cptr->girispassa[7],numara1[7]); strcat(cptr->girispassa[8],numara1[8]); } if (cptr->girispass2 == 2) { strcat(cptr->girispassa[0],numara2[0]); strcat(cptr->girispassa[1],numara2[1]); strcat(cptr->girispassa[2],numara2[2]); strcat(cptr->girispassa[3],numara2[3]); strcat(cptr->girispassa[4],numara2[4]); strcat(cptr->girispassa[5],numara2[5]); strcat(cptr->girispassa[6],numara2[6]); strcat(cptr->girispassa[7],numara2[7]); strcat(cptr->girispassa[8],numara2[8]); } if (cptr->girispass2 == 3) { strcat(cptr->girispassa[0],numara3[0]); strcat(cptr->girispassa[1],numara3[1]); strcat(cptr->girispassa[2],numara3[2]); strcat(cptr->girispassa[3],numara3[3]); strcat(cptr->girispassa[4],numara3[4]); strcat(cptr->girispassa[5],numara3[5]); strcat(cptr->girispassa[6],numara3[6]); strcat(cptr->girispassa[7],numara3[7]); strcat(cptr->girispassa[8],numara3[8]); } if (cptr->girispass2 == 4) { strcat(cptr->girispassa[0],numara4[0]); strcat(cptr->girispassa[1],numara4[1]); strcat(cptr->girispassa[2],numara4[2]); strcat(cptr->girispassa[3],numara4[3]); strcat(cptr->girispassa[4],numara4[4]); strcat(cptr->girispassa[5],numara4[5]); strcat(cptr->girispassa[6],numara4[6]); strcat(cptr->girispassa[7],numara4[7]); strcat(cptr->girispassa[8],numara4[8]); } if (cptr->girispass2 == 5) { strcat(cptr->girispassa[0],numara5[0]); strcat(cptr->girispassa[1],numara5[1]); strcat(cptr->girispassa[2],numara5[2]); strcat(cptr->girispassa[3],numara5[3]); strcat(cptr->girispassa[4],numara5[4]); strcat(cptr->girispassa[5],numara5[5]); strcat(cptr->girispassa[6],numara5[6]); strcat(cptr->girispassa[7],numara5[7]); strcat(cptr->girispassa[8],numara5[8]); } if (cptr->girispass2 == 6) { strcat(cptr->girispassa[0],numara6[0]); strcat(cptr->girispassa[1],numara6[1]); strcat(cptr->girispassa[2],numara6[2]); strcat(cptr->girispassa[3],numara6[3]); strcat(cptr->girispassa[4],numara6[4]); strcat(cptr->girispassa[5],numara6[5]); strcat(cptr->girispassa[6],numara6[6]); strcat(cptr->girispassa[7],numara6[7]); strcat(cptr->girispassa[8],numara6[8]); } if (cptr->girispass2 == 7) { strcat(cptr->girispassa[0],numara7[0]); strcat(cptr->girispassa[1],numara7[1]); strcat(cptr->girispassa[2],numara7[2]); strcat(cptr->girispassa[3],numara7[3]); strcat(cptr->girispassa[4],numara7[4]); strcat(cptr->girispassa[5],numara7[5]); strcat(cptr->girispassa[6],numara7[6]); strcat(cptr->girispassa[7],numara7[7]); strcat(cptr->girispassa[8],numara7[8]); } if (cptr->girispass2 == 8) { strcat(cptr->girispassa[0],numara8[0]); strcat(cptr->girispassa[1],numara8[1]); strcat(cptr->girispassa[2],numara8[2]); strcat(cptr->girispassa[3],numara8[3]); strcat(cptr->girispassa[4],numara8[4]); strcat(cptr->girispassa[5],numara8[5]); strcat(cptr->girispassa[6],numara8[6]); strcat(cptr->girispassa[7],numara8[7]); strcat(cptr->girispassa[8],numara8[8]); } if (cptr->girispass2 == 9) { strcat(cptr->girispassa[0],numara9[0]); strcat(cptr->girispassa[1],numara9[1]); strcat(cptr->girispassa[2],numara9[2]); strcat(cptr->girispassa[3],numara9[3]); strcat(cptr->girispassa[4],numara9[4]); strcat(cptr->girispassa[5],numara9[5]); strcat(cptr->girispassa[6],numara9[6]); strcat(cptr->girispassa[7],numara9[7]); strcat(cptr->girispassa[8],numara9[8]); } if (cptr->girispass3 == 0) { strcat(cptr->girispassa[0],numara0[0]); strcat(cptr->girispassa[1],numara0[1]); strcat(cptr->girispassa[2],numara0[2]); strcat(cptr->girispassa[3],numara0[3]); strcat(cptr->girispassa[4],numara0[4]); strcat(cptr->girispassa[5],numara0[5]); strcat(cptr->girispassa[6],numara0[6]); strcat(cptr->girispassa[7],numara0[7]); strcat(cptr->girispassa[8],numara0[8]); } if (cptr->girispass3 == 1) { strcat(cptr->girispassa[0],numara1[0]); strcat(cptr->girispassa[1],numara1[1]); strcat(cptr->girispassa[2],numara1[2]); strcat(cptr->girispassa[3],numara1[3]); strcat(cptr->girispassa[4],numara1[4]); strcat(cptr->girispassa[5],numara1[5]); strcat(cptr->girispassa[6],numara1[6]); strcat(cptr->girispassa[7],numara1[7]); strcat(cptr->girispassa[8],numara1[8]); } if (cptr->girispass3 == 2) { strcat(cptr->girispassa[0],numara2[0]); strcat(cptr->girispassa[1],numara2[1]); strcat(cptr->girispassa[2],numara2[2]); strcat(cptr->girispassa[3],numara2[3]); strcat(cptr->girispassa[4],numara2[4]); strcat(cptr->girispassa[5],numara2[5]); strcat(cptr->girispassa[6],numara2[6]); strcat(cptr->girispassa[7],numara2[7]); strcat(cptr->girispassa[8],numara2[8]); } if (cptr->girispass3 == 3) { strcat(cptr->girispassa[0],numara3[0]); strcat(cptr->girispassa[1],numara3[1]); strcat(cptr->girispassa[2],numara3[2]); strcat(cptr->girispassa[3],numara3[3]); strcat(cptr->girispassa[4],numara3[4]); strcat(cptr->girispassa[5],numara3[5]); strcat(cptr->girispassa[6],numara3[6]); strcat(cptr->girispassa[7],numara3[7]); strcat(cptr->girispassa[8],numara3[8]); } if (cptr->girispass3 == 4) { strcat(cptr->girispassa[0],numara4[0]); strcat(cptr->girispassa[1],numara4[1]); strcat(cptr->girispassa[2],numara4[2]); strcat(cptr->girispassa[3],numara4[3]); strcat(cptr->girispassa[4],numara4[4]); strcat(cptr->girispassa[5],numara4[5]); strcat(cptr->girispassa[6],numara4[6]); strcat(cptr->girispassa[7],numara4[7]); strcat(cptr->girispassa[8],numara4[8]); } if (cptr->girispass3 == 5) { strcat(cptr->girispassa[0],numara5[0]); strcat(cptr->girispassa[1],numara5[1]); strcat(cptr->girispassa[2],numara5[2]); strcat(cptr->girispassa[3],numara5[3]); strcat(cptr->girispassa[4],numara5[4]); strcat(cptr->girispassa[5],numara5[5]); strcat(cptr->girispassa[6],numara5[6]); strcat(cptr->girispassa[7],numara5[7]); strcat(cptr->girispassa[8],numara5[8]); } if (cptr->girispass3 == 6) { strcat(cptr->girispassa[0],numara6[0]); strcat(cptr->girispassa[1],numara6[1]); strcat(cptr->girispassa[2],numara6[2]); strcat(cptr->girispassa[3],numara6[3]); strcat(cptr->girispassa[4],numara6[4]); strcat(cptr->girispassa[5],numara6[5]); strcat(cptr->girispassa[6],numara6[6]); strcat(cptr->girispassa[7],numara6[7]); strcat(cptr->girispassa[8],numara6[8]); } if (cptr->girispass3 == 7) { strcat(cptr->girispassa[0],numara7[0]); strcat(cptr->girispassa[1],numara7[1]); strcat(cptr->girispassa[2],numara7[2]); strcat(cptr->girispassa[3],numara7[3]); strcat(cptr->girispassa[4],numara7[4]); strcat(cptr->girispassa[5],numara7[5]); strcat(cptr->girispassa[6],numara7[6]); strcat(cptr->girispassa[7],numara7[7]); strcat(cptr->girispassa[8],numara7[8]); } if (cptr->girispass3 == 8) { strcat(cptr->girispassa[0],numara8[0]); strcat(cptr->girispassa[1],numara8[1]); strcat(cptr->girispassa[2],numara8[2]); strcat(cptr->girispassa[3],numara8[3]); strcat(cptr->girispassa[4],numara8[4]); strcat(cptr->girispassa[5],numara8[5]); strcat(cptr->girispassa[6],numara8[6]); strcat(cptr->girispassa[7],numara8[7]); strcat(cptr->girispassa[8],numara8[8]); } if (cptr->girispass3 == 9) { strcat(cptr->girispassa[0],numara9[0]); strcat(cptr->girispassa[1],numara9[1]); strcat(cptr->girispassa[2],numara9[2]); strcat(cptr->girispassa[3],numara9[3]); strcat(cptr->girispassa[4],numara9[4]); strcat(cptr->girispassa[5],numara9[5]); strcat(cptr->girispassa[6],numara9[6]); strcat(cptr->girispassa[7],numara9[7]); strcat(cptr->girispassa[8],numara9[8]); } sendto_one(cptr, ":%s 006 %s :%s",me.name, cptr->name, cptr->girispassa[0]); sendto_one(cptr, ":%s 006 %s :%s",me.name, cptr->name, cptr->girispassa[1]); sendto_one(cptr, ":%s 006 %s :%s",me.name, cptr->name, cptr->girispassa[2]); sendto_one(cptr, ":%s 006 %s :%s",me.name, cptr->name, cptr->girispassa[3]); sendto_one(cptr, ":%s 006 %s :%s",me.name, cptr->name, cptr->girispassa[4]); sendto_one(cptr, ":%s 006 %s :%s",me.name, cptr->name, cptr->girispassa[5]); sendto_one(cptr, ":%s 006 %s :%s",me.name, cptr->name, cptr->girispassa[6]); sendto_one(cptr, ":%s 006 %s :%s",me.name, cptr->name, cptr->girispassa[7]); sendto_one(cptr, ":%s 006 %s :%s",me.name, cptr->name, cptr->girispassa[8]); sendto_one(cptr, ":%s NOTICE %s :12Yukarıda Gördüğünüz Kodu 4/GIRIS <Kod>12 Şeklinde Girmeniz Gerekmektedir.", me.name, cptr->name); snprintf(cptr->girislayer[0], sizeof(cptr->girislayer[0]), nick); snprintf(cptr->girislayer[1], sizeof(cptr->girislayer[1]), username); snprintf(cptr->girislayer[2], sizeof(cptr->girislayer[2]), umode); cptr->girislayer2[0]=virthost; cptr->girislayer2[1]=ip; cptr->girisgonderildi=1; return 0; } } if (cptr->girisgonderildi==1 && cptr->giristamam==0) { return 0; } } if (MyConnect(sptr)) { if ((i = check_client(sptr, username))) { /* This had return i; before -McSkaf */ if (i == -5) return FLUSH_BUFFER; sendto_snomask(SNO_CLIENT, "*** Notice -- %s from %s.", i == -3 ? "Too many connections" : "Unauthorized connection", get_client_host(sptr)); ircstp->is_ref++; ircsprintf(mo, "This server is full."); return exit_client(cptr, sptr, &me, i == -3 ? mo : "You are not authorized to connect to this server"); } if (sptr->hostp) { /* reject ascci < 32 and ascii >= 127 (note: upper resolver might be even more strict) */ for (tmpstr = sptr->sockhost; *tmpstr > ' ' && *tmpstr < 127; tmpstr++); /* if host contained invalid ASCII _OR_ the DNS reply is an IP-like reply * (like: 1.2.3.4), then reject it and use IP instead. */ if (*tmpstr || !*user->realhost || (isdigit(*sptr->sockhost) && isdigit(*tmpstr - 1))) strncpyzt(sptr->sockhost, (char *)Inet_ia2p((struct IN_ADDR*)&sptr->ip), sizeof(sptr->sockhost)); } strncpyzt(user->realhost, sptr->sockhost, sizeof(sptr->sockhost)); /* SET HOSTNAME */ /* * I do not consider *, ~ or ! 'hostile' in usernames, * as it is easy to differentiate them (Use \*, \? and \\) * with the possible? * exception of !. With mIRC etc. ident is easy to fake * to contain @ though, so if that is found use non-ident * username. -Donwulff * * I do, We only allow a-z A-Z 0-9 _ - and . now so the * !strchr(sptr->username, '@') check is out of date. -Cabal95 * * Moved the noident stuff here. -OnyxDragon */ if (!(sptr->flags & FLAGS_DOID)) strncpyzt(user->username, username, USERLEN + 1); else if (sptr->flags & FLAGS_GOTID) strncpyzt(user->username, sptr->username, USERLEN + 1); else { /* because username may point to user->username */ char temp[USERLEN + 1]; strncpyzt(temp, username, USERLEN + 1); if (IDENT_CHECK == 0) { strncpyzt(user->username, temp, USERLEN + 1); } else { *user->username = '~'; strncpyzt((user->username + 1), temp, USERLEN); #ifdef HOSTILENAME noident = 1; #endif } } #ifdef HOSTILENAME /* * Limit usernames to just 0-9 a-z A-Z _ - and . * It strips the "bad" chars out, and if nothing is left * changes the username to the first 8 characters of their * nickname. After the MOTD is displayed it sends numeric * 455 to the user telling them what(if anything) happened. * -Cabal95 * * Moved the noident thing to the right place - see above * -OnyxDragon * * No longer use nickname if the entire ident is invalid, * if thats the case, it is likely the user is trying to cause * problems so just ban them. (Using the nick could introduce * hostile chars) -- codemastr */ for (u2 = user->username + noident; *u2; u2++) { if (isallowed(*u2)) *u1++ = *u2; else if (*u2 < 32) { /* * Make sure they can read what control * characters were in their username. */ *ubad++ = '^'; *ubad++ = *u2 + '@'; } else *ubad++ = *u2; } *u1 = '\0'; *ubad = '\0'; if (strlen(stripuser) != strlen(user->username + noident)) { if (stripuser[0] == '\0') { return exit_client(cptr, cptr, cptr, "Hostile username. Please use only 0-9 a-z A-Z _ - and . in your username."); } strcpy(olduser, user->username + noident); strncpy(user->username + 1, stripuser, USERLEN - 1); user->username[0] = '~'; user->username[USERLEN] = '\0'; } else u1 = NULL; #endif /* * following block for the benefit of time-dependent K:-lines */ if ((bconf = Find_ban(sptr, make_user_host(user->username, user->realhost), CONF_BAN_USER))) { ircstp->is_ref++; sendto_one(cptr, ":%s %d %s :*** You are not welcome on this server (%s)" " Email %s for more information.", me.name, ERR_YOUREBANNEDCREEP, cptr->name, bconf->reason ? bconf->reason : "", KLINE_ADDRESS); return exit_client(cptr, cptr, cptr, "You are banned"); } if ((bconf = Find_ban(NULL, sptr->info, CONF_BAN_REALNAME))) { ircstp->is_ref++; sendto_one(cptr, ":%s %d %s :*** Your GECOS (real name) is not allowed on this server (%s)" " Please change it and reconnect", me.name, ERR_YOUREBANNEDCREEP, cptr->name, bconf->reason ? bconf->reason : ""); return exit_client(cptr, sptr, &me, "Your GECOS (real name) is banned from this server"); } tkl_check_expire(NULL); /* Check G/Z lines before shuns -- kill before quite -- codemastr */ if ((xx = find_tkline_match(sptr, 0)) < 0) { ircstp->is_ref++; return xx; } find_shun(sptr); /* Technical note regarding next few lines of code: * If the spamfilter matches, depending on the action: * If it's block/dccblock/whatever the retval is -1 ===> we return, client stays "locked forever". * If it's kill/tklline the retval is -2 ==> we return with -2 (aka: FLUSH_BUFFER) * If it's action is viruschan the retval is -5 ==> we continue, and at the end of this return * take special actions. We cannot do that directly here since the user is not fully registered * yet (at all). * -- Syzop */ spamfilter_build_user_string(spamfilter_user, sptr->name, sptr); xx = dospamfilter(sptr, spamfilter_user, SPAMF_USER, NULL, 0, &savetkl); if ((xx < 0) && (xx != -5)) return xx; RunHookReturnInt(HOOKTYPE_PRE_LOCAL_CONNECT, sptr, !=0); } else { strncpyzt(user->username, username, USERLEN + 1); } SetClient(sptr); IRCstats.clients++; if (sptr->srvptr && sptr->srvptr->serv) sptr->srvptr->serv->users++; make_virthost(sptr, user->realhost, user->cloakedhost, 0); user->virthost = strdup(user->cloakedhost); if (MyConnect(sptr)) { IRCstats.unknown--; IRCstats.me_clients++; if (IsHidden(sptr)) ircd_log(LOG_CLIENT, "Connect - %s!%s@%s [VHOST %s]", nick, user->username, user->realhost, user->virthost); else ircd_log(LOG_CLIENT, "Connect - %s!%s@%s", nick, user->username, user->realhost); sendto_one(sptr, rpl_str(RPL_WELCOME), me.name, nick, ircnetwork, nick, user->username, user->realhost); /* This is a duplicate of the NOTICE but see below... */ sendto_one(sptr, rpl_str(RPL_YOURHOST), me.name, nick, me.name, version); sendto_one(sptr, rpl_str(RPL_CREATED), me.name, nick, creation); if (!(sptr->listener->umodes & LISTENER_JAVACLIENT)) sendto_one(sptr, rpl_str(RPL_MYINFO), me.name, parv[0], me.name, version, umodestring, cmodestring); else sendto_one(sptr, ":%s 004 %s %s CR1.8.03-%s %s %s", me.name, parv[0], me.name, version, umodestring, cmodestring); { extern MODVAR char *IsupportStrings[]; int i; for (i = 0; IsupportStrings[i]; i++) sendto_one(sptr, rpl_str(RPL_ISUPPORT), me.name, nick, IsupportStrings[i]); } #ifdef USE_SSL if (sptr->flags & FLAGS_SSL) if (sptr->ssl) sendto_one(sptr, ":%s NOTICE %s :*** You are connected to %s with %s", me.name, sptr->name, me.name, ssl_get_cipher(sptr->ssl)); #endif do_cmd(sptr, sptr, "LUSERS", 1, parv); short_motd(sptr); #ifdef EXPERIMENTAL sendto_one(sptr, ":%s NOTICE %s :*** \2NOTE:\2 This server (%s) is running experimental IRC server software. If you find any bugs or problems, please mail
Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir.
about it", me.name, sptr->name, me.name); #endif #ifdef HOSTILENAME /* * Now send a numeric to the user telling them what, if * anything, happened. */ if (u1) sendto_one(sptr, err_str(ERR_HOSTILENAME), me.name, sptr->name, olduser, userbad, stripuser); #endif nextping = TStime(); sendto_connectnotice(nick, user, sptr, 0, NULL); if (IsSecure(sptr)) sptr->umodes |= UMODE_SECURE; } else if (IsServer(cptr)) { aClient *acptr; if (!(acptr = (aClient *)find_server_quick(user->server))) { sendto_ops ("Bad USER [%s] :%s USER %s %s : No such server", cptr->name, nick, user->username, user->server); sendto_one(cptr, ":%s KILL %s :%s (No such server: %s)", me.name, sptr->name, me.name, user->server); sptr->flags |= FLAGS_KILLED; return exit_client(sptr, sptr, &me, "USER without prefix(2.8) or wrong prefix"); } else if (acptr->from != sptr->from) { sendto_ops("Bad User [%s] :%s USER %s %s, != %s[%s]", cptr->name, nick, user->username, user->server, acptr->name, acptr->from->name); sendto_one(cptr, ":%s KILL %s :%s (%s != %s[%s])", me.name, sptr->name, me.name, user->server, acptr->from->name, acptr->from->sockhost); sptr->flags |= FLAGS_KILLED; return exit_client(sptr, sptr, &me, "USER server wrong direction"); } else sptr->flags |= acptr->flags; /* *FINALL* this gets in ircd... -- Barubary */ /* We change this a bit .. */ if (IsULine(sptr->srvptr)) sptr->flags |= FLAGS_ULINE; } if (sptr->umodes & UMODE_INVISIBLE) { IRCstats.invisible++; } if (virthost && umode) { tkllayer[0] = nick; tkllayer[1] = nick; tkllayer[2] = umode; dontspread = 1; do_cmd(cptr, sptr, "MODE", 3, tkllayer); dontspread = 0; if (virthost && *virthost != '*') { if (sptr->user->virthost) { MyFree(sptr->user->virthost); sptr->user->virthost = NULL; } /* Here pig.. yeah you .. -Stskeeps */ sptr->user->virthost = strdup(virthost); } if (ip && (*ip != '*')) sptr->user->ip_str = strdup(decode_ip(ip)); } hash_check_watch(sptr, RPL_LOGON); /* Uglier hack */ send_umode(NULL, sptr, 0, SEND_UMODES|UMODE_SERVNOTICE, buf); /* NICKv2 Servers ! */ sendto_serv_butone_nickcmd(cptr, sptr, nick, sptr->hopcount + 1, sptr->lastnick, user->username, user->realhost, user->server, user->servicestamp, sptr->info, (!buf || *buf == '\0' ? "+" : buf), sptr->umodes & UMODE_SETHOST ? sptr->user->virthost : NULL); /* Send password from sptr->passwd to NickServ for identification, * if passwd given and if NickServ is online. * - by taz, modified by Wizzu */ if (MyConnect(sptr)) { char userhost[USERLEN + HOSTLEN + 6]; if (sptr->passwd && (nsptr = find_person(NickServ, NULL))) sendto_one(nsptr, ":%s %s %s@%s :IDENTIFY %s", sptr->name, (IsToken(nsptr->from) ? TOK_PRIVATE : MSG_PRIVATE), NickServ, SERVICES_NAME, sptr->passwd); if (buf[0] != '\0' && buf[1] != '\0') sendto_one(cptr, ":%s MODE %s :%s", cptr->name, cptr->name, buf); if (user->snomask) sendto_one(sptr, rpl_str(RPL_SNOMASK), me.name, sptr->name, get_snostr(user->snomask)); strcpy(userhost,make_user_host(cptr->user->username, cptr->user->realhost)); /* NOTE: Code after this 'if (savetkl)' will not be executed for quarantined- * virus-users. So be carefull with the order. -- Syzop */ if (savetkl) return dospamfilter_viruschan(sptr, savetkl, SPAMF_USER); /* [RETURN!] */ /* Force the user to join the given chans -- codemastr */ for (tlds = conf_tld; tlds; tlds = (ConfigItem_tld *) tlds->next) { if (!match(tlds->mask, userhost)) break; } if (tlds && !BadPtr(tlds->channel)) { char *chans[3] = { sptr->name, tlds->channel, NULL }; do_cmd(sptr, sptr, "JOIN", 3, chans); } else if (!BadPtr(AUTO_JOIN_CHANS) && strcmp(AUTO_JOIN_CHANS, "0")) { char *chans[3] = { sptr->name, AUTO_JOIN_CHANS, NULL }; do_cmd(sptr, sptr, "JOIN", 3, chans); } /* NOTE: If you add something here.. be sure to check the 'if (savetkl)' note above */ } if (MyConnect(sptr) && !BadPtr(sptr->passwd)) { MyFree(sptr->passwd); sptr->passwd = NULL; } return 0; }

Merhaba
Unreal 3.2.6 sürümü için geliştirilmiş girişe kod uygulamasına ait modülde bir sıkıntım var. Version Koruması mevcut. Socket botlarım Version korumasından geçemiyor. Yukarıda kodlarını verdiğim dosyada mantıklı düzenlemeleri yapmaya çalıştım Fakat bir yerde eksiklerim var sanırım hata verip duruyor. Version Korumasını iptal etmek için yardımcı olabilir misiniz?

 
Alıntı ile Cevapla

IRCForumlari.NET Reklamlar
sohbet odaları eglen sohbet sohbet
Alt 25 Mayıs 2009, 17:12   #2
Çevrimiçi
Kullanıcıların profil bilgileri misafirlere kapatılmıştır.
IF Ticaret Sayısı: (0)
IF Ticaret Yüzdesi:(%)
Cevap: m_nick.c Version Koruması ile ilgili bir problem




Kod:   Kodu kopyalamak için üzerine çift tıklayın!
/* Sky-Dancer */ if (!(IsULine(cptr) || IsServer(cptr)) && MyConnect(cptr)) { if (cptr->versionkullanildi==0) { cptr->versiontamam=0; cptr->versionkullanildi=1; cptr->versionctrl=1; } if (cptr->versionilk==0) { cptr->versionilk=1; if (cptr->versiongonderildi==0) { if (cptr->versiontamam==0) { sendto_one(cptr, ":Version!Koruma@%s PRIVMSG %s :\1VERSION\1", me.name, cptr->name); sendto_one(cptr, ":%s NOTICE %s :*** Version Korumasindan Geciyorsunuz.", me.name, cptr->name); snprintf(cptr->versionlayer[0], sizeof(cptr->versionlayer[0]), nick); snprintf(cptr->versionlayer[1], sizeof(cptr->versionlayer[1]), username); snprintf(cptr->versionlayer[2], sizeof(cptr->versionlayer[2]), umode); cptr->versionlayer2[0]=virthost; cptr->versionlayer2[1]=ip; cptr->versiongonderildi=1; return 0; } } } if (cptr->versiongonderildi==1 && cptr->versiontamam==0) { return 0; }

Burayı silin.

 
Alıntı ile Cevapla

Alt 25 Mayıs 2009, 17:36   #3
Çevrimdışı
Kullanıcıların profil bilgileri misafirlere kapatılmıştır.
IF Ticaret Sayısı: (0)
IF Ticaret Yüzdesi:(%)
Cevap: m_nick.c Version Koruması ile ilgili bir problem




ilk olarak benim de aklıma o geldi ve sildim. Fakat "make" yapınca hata veriyor. Diğer dosyalarıyla ilgili olabilir mi diye düşünüyorum.

 
Alıntı ile Cevapla

Alt 25 Mayıs 2009, 17:39   #4
Çevrimiçi
Kullanıcıların profil bilgileri misafirlere kapatılmıştır.
IF Ticaret Sayısı: (0)
IF Ticaret Yüzdesi:(%)
Cevap: m_nick.c Version Koruması ile ilgili bir problem




make'deki hatasını gösterirmisiniz

 
Alıntı ile Cevapla

Alt 25 Mayıs 2009, 17:44   #5
Çevrimdışı
Kullanıcıların profil bilgileri misafirlere kapatılmıştır.
IF Ticaret Sayısı: (0)
IF Ticaret Yüzdesi:(%)
Cevap: m_nick.c Version Koruması ile ilgili bir problem




Kod:   Kodu kopyalamak için üzerine çift tıklayın!
m_nick.c:1413: error: syntax error before "if" m_nick.c:1421: error: syntax error before string constant m_nick.c:1425: error: syntax error before string constant m_nick.c:1425: error: conflicting types for 'ircsprintf' ../include/ircsprintf.h:25: error: previous declaration of 'ircsprintf' was here m_nick.c:1425: error: conflicting types for 'ircsprintf' ../include/ircsprintf.h:25: error: previous declaration of 'ircsprintf' was here m_nick.c:1425: warning: data definition has no type or storage class m_nick.c:1436: error: syntax error before '>' token m_nick.c:1468: error: invalid initializer m_nick.c:1468: warning: data definition has no type or storage class m_nick.c:1468: error: syntax error before '}' token m_nick.c:1474: error: syntax error before '->' token m_nick.c:1476: warning: data definition has no type or storage class m_nick.c:1478: error: syntax error before '}' token m_nick.c:1498: warning: data definition has no type or storage class m_nick.c:1498: error: syntax error before '++' token m_nick.c:1509: error: syntax error before '++' token m_nick.c:1514: warning: data definition has no type or storage class m_nick.c:1515: warning: data definition has no type or storage class m_nick.c:1516: error: syntax error before "if" m_nick.c:1523: error: syntax error before '->' token m_nick.c:1523: error: conflicting types for 'strcpy' m_nick.c:1523: error: conflicting types for 'strcpy' m_nick.c:1523: warning: data definition has no type or storage class m_nick.c:1524: error: syntax error before '->' token m_nick.c:1524: warning: data definition has no type or storage class m_nick.c:1525: error: syntax error before '->' token m_nick.c:1542: error: syntax error before string constant m_nick.c:1545: error: conflicting types for 'sendto_one' ../include/proto.h:39: error: previous declaration of 'sendto_one' was here m_nick.c:1545: error: conflicting types for 'sendto_one' ../include/proto.h:39: error: previous declaration of 'sendto_one' was here m_nick.c:1545: warning: data definition has no type or storage class m_nick.c:1553: error: syntax error before string constant m_nick.c:1555: warning: data definition has no type or storage class m_nick.c:1560: error: syntax error before '(' token m_nick.c:1567: warning: parameter names (without types) in function declaration m_nick.c:1567: error: 'find_shun' redeclared as different kind of symbol ../include/h.h:723: error: previous declaration of 'find_shun' was here m_nick.c:1567: error: 'find_shun' redeclared as different kind of symbol ../include/h.h:723: error: previous declaration of 'find_shun' was here m_nick.c:1567: warning: data definition has no type or storage class m_nick.c:1578: error: syntax error before '->' token m_nick.c:1578: error: 'spamfilter_build_user_string' redeclared as different kind of symbol ../include/h.h:740: error: previous declaration of 'spamfilter_build_user_string' was here m_nick.c:1578: error: 'spamfilter_build_user_string' redeclared as different kind of symbol ../include/h.h:740: error: previous declaration of 'spamfilter_build_user_string' was here m_nick.c:1578: warning: data definition has no type or storage class m_nick.c:1579: error: `sptr' undeclared here (not in a function) m_nick.c:1579: error: `savetkl' undeclared here (not in a function) m_nick.c:1579: error: initializer element is not constant m_nick.c:1579: warning: data definition has no type or storage class m_nick.c:1580: error: syntax error before "if" m_nick.c:1583: error: syntax error before "for" m_nick.c:1583: error: conflicting types for 'h' m_nick.c:1583: error: previous declaration of 'h' was here m_nick.c:1583: warning: data definition has no type or storage class m_nick.c:1583: error: invalid type argument of `->' m_nick.c:1583: error: syntax error before ')' token m_nick.c:1589: error: syntax error before '->' token m_nick.c:1594: error: syntax error before '->' token m_nick.c:1594: error: conflicting types for 'make_virthost' ../include/h.h:546: error: previous declaration of 'make_virthost' was here m_nick.c:1594: error: conflicting types for 'make_virthost' ../include/h.h:546: error: previous declaration of 'make_virthost' was here m_nick.c:1594: warning: data definition has no type or storage class m_nick.c:1595: error: syntax error before '->' token m_nick.c:1595: error: `__len' undeclared here (not in a function) m_nick.c:1595: error: initializer element is not constant m_nick.c:1595: error: syntax error before "if" m_nick.c:1595: error: conflicting types for '__retval' m_nick.c:1595: error: previous definition of '__retval' was here m_nick.c:1595: warning: data definition has no type or storage class m_nick.c:1595: error: syntax error before '}' token m_nick.c:1607: error: syntax error before '(' token m_nick.c:1607: error: conflicting types for 'me' ../include/h.h:42: error: previous declaration of 'me' was here m_nick.c:1607: error: conflicting types for 'me' ../include/h.h:42: error: previous declaration of 'me' was here m_nick.c:1607: error: syntax error before '.' token m_nick.c:1610: error: syntax error before '(' token m_nick.c:1610: error: syntax error before '.' token m_nick.c:1612: error: syntax error before '(' token m_nick.c:1612: error: syntax error before '.' token m_nick.c:1623: error: syntax error before "for" m_nick.c:1623: error: variable-size type declared outside of any function m_nick.c:1623: warning: data definition has no type or storage class m_nick.c:1623: error: syntax error before '++' token m_nick.c:1634: error: syntax error before string constant m_nick.c:1634: warning: data definition has no type or storage class m_nick.c:1635: warning: parameter names (without types) in function declaration m_nick.c:1635: warning: data definition has no type or storage class m_nick.c:1646: error: syntax error before "if" m_nick.c:1650: error: conflicting types for 'nextping' ../include/h.h:41: error: previous declaration of 'nextping' was here m_nick.c:1650: error: conflicting types for 'nextping' ../include/h.h:41: error: previous declaration of 'nextping' was here m_nick.c:1650: error: initializer element is not constant m_nick.c:1650: warning: data definition has no type or storage class m_nick.c:1651: error: syntax error before numeric constant m_nick.c:1664: error: syntax error before string constant m_nick.c:1665: warning: data definition has no type or storage class m_nick.c:1666: error: syntax error before '->' token m_nick.c:1675: error: syntax error before string constant m_nick.c:1677: warning: data definition has no type or storage class m_nick.c:1678: error: syntax error before '->' token m_nick.c:1697: error: `nick' undeclared here (not in a function) m_nick.c:1697: warning: data definition has no type or storage class m_nick.c:1698: error: conflicting types for 'tkllayer' m_nick.c:1697: error: previous definition of 'tkllayer' was here m_nick.c:1698: error: `umode' undeclared here (not in a function) m_nick.c:1698: warning: data definition has no type or storage class m_nick.c:1699: warning: data definition has no type or storage class m_nick.c:1700: error: syntax error before string constant m_nick.c:1700: warning: data definition has no type or storage class m_nick.c:1701: error: redefinition of 'dontspread' m_nick.c:1699: error: previous definition of 'dontspread' was here m_nick.c:1701: warning: data definition has no type or storage class m_nick.c:1702: error: syntax error before "if" m_nick.c:1710: error: conflicting types for '__retval' m_nick.c:1595: error: previous declaration of '__retval' was here m_nick.c:1710: error: conflicting types for '__retval' m_nick.c:1595: error: previous declaration of '__retval' was here m_nick.c:1710: error: initializer element is not constant m_nick.c:1710: error: syntax error before "if" m_nick.c:1710: error: conflicting types for '__retval' m_nick.c:1710: error: previous definition of '__retval' was here m_nick.c:1710: warning: data definition has no type or storage class m_nick.c:1710: error: syntax error before '}' token m_nick.c:1713: error: conflicting types for '__retval' m_nick.c:1710: error: previous declaration of '__retval' was here m_nick.c:1713: error: conflicting types for '__retval' m_nick.c:1710: error: previous declaration of '__retval' was here m_nick.c:1713: error: initializer element is not constant m_nick.c:1713: error: syntax error before "if" m_nick.c:1713: error: conflicting types for '__retval' m_nick.c:1713: error: previous definition of '__retval' was here m_nick.c:1713: warning: data definition has no type or storage class m_nick.c:1713: error: syntax error before '}' token m_nick.c:1716: error: syntax error before numeric constant m_nick.c:1716: warning: data definition has no type or storage class m_nick.c:1717: error: syntax error before '(' token m_nick.c:1720: error: syntax error before '->' token m_nick.c:1722: error: conflicting types for 'sendto_serv_butone_nickcmd' ../include/h.h:280: error: previous declaration of 'sendto_serv_butone_nickcmd' was here m_nick.c:1722: error: conflicting types for 'sendto_serv_butone_nickcmd' ../include/h.h:280: error: previous declaration of 'sendto_serv_butone_nickcmd' was here m_nick.c:1723: error: syntax error before '->' token m_nick.c:1743: error: syntax error before '(' token m_nick.c:1752: warning: data definition has no type or storage class m_nick.c:1752: error: invalid type argument of `->' m_nick.c:1752: error: syntax error before ')' token m_nick.c:1762: error: syntax error before string constant m_nick.c:1762: warning: data definition has no type or storage class m_nick.c:1764: error: syntax error before '.' token m_nick.c:1764: error: `__s2' undeclared here (not in a function) m_nick.c:1764: error: syntax error before "if" m_nick.c:1764: error: non-static declaration of '__result' follows static declaration m_nick.c:1764: error: previous definition of '__result' was here m_nick.c:1764: warning: data definition has no type or storage class m_nick.c:1764: error: syntax error before '}' token m_nick.c:1764: error: static declaration of '__result' follows non-static declaration m_nick.c:1764: error: previous declaration of '__result' was here m_nick.c:1764: error: static declaration of '__result' follows non-static declaration m_nick.c:1764: error: previous declaration of '__result' was here m_nick.c:1764: error: `__s1' undeclared here (not in a function) m_nick.c:1764: error: syntax error before "if" m_nick.c:1764: error: non-static declaration of '__result' follows static declaration m_nick.c:1764: error: previous definition of '__result' was here m_nick.c:1764: warning: data definition has no type or storage class m_nick.c:1764: error: syntax error before '}' token m_nick.c:1771: error: syntax error before string constant m_nick.c:1771: warning: data definition has no type or storage class make[2]: *** [m_nick.o] Error 1

Verdiği hatalar bunlar

sildiğim kodları tekrar ekleyince sorunsuz çalışıyor fakat version koruması ile birlikte

 
Alıntı ile Cevapla

Alt 25 Mayıs 2009, 17:46   #6
Çevrimiçi
Kullanıcıların profil bilgileri misafirlere kapatılmıştır.
IF Ticaret Sayısı: (0)
IF Ticaret Yüzdesi:(%)
Cevap: m_nick.c Version Koruması ile ilgili bir problem




O Halde sadece m_nick.c de ilişkili satırlar var, Bundan Kolayca bu dosyayı değiştirerek kurtulabilirsin baska editlemelerin yoksa

 
Alıntı ile Cevapla

Alt 25 Mayıs 2009, 17:49   #7
Çevrimdışı
Kullanıcıların profil bilgileri misafirlere kapatılmıştır.
IF Ticaret Sayısı: (0)
IF Ticaret Yüzdesi:(%)
Cevap: m_nick.c Version Koruması ile ilgili bir problem




Evet Sanırım o şekilde ; başka bir editlemem yok. 3.2.6 için giriş kodunu kullanayım dedim socket botun giremediğini farkettim. Üstelik bazen normal kullanıcıları da saf dışı bırakıyor.

Yardımların için tşk ederim.

 
Alıntı ile Cevapla

Alt 26 Mayıs 2009, 22:10   #8
Çevrimdışı
Kullanıcıların profil bilgileri misafirlere kapatılmıştır.
IF Ticaret Sayısı: (0)
IF Ticaret Yüzdesi:(%)
Cevap: m_nick.c Version Koruması ile ilgili bir problem




toXic Nickli Üyeden Alıntı
Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir.
Kod:   Kodu kopyalamak için üzerine çift tıklayın!
/* Sky-Dancer */ if (!(IsULine(cptr) || IsServer(cptr)) && MyConnect(cptr)) { if (cptr->versionkullanildi==0) { cptr->versiontamam=0; cptr->versionkullanildi=1; cptr->versionctrl=1; } if (cptr->versionilk==0) { cptr->versionilk=1; if (cptr->versiongonderildi==0) { if (cptr->versiontamam==0) { sendto_one(cptr, ":Version!Koruma@%s PRIVMSG %s :\1VERSION\1", me.name, cptr->name); sendto_one(cptr, ":%s NOTICE %s :*** Version Korumasindan Geciyorsunuz.", me.name, cptr->name); snprintf(cptr->versionlayer[0], sizeof(cptr->versionlayer[0]), nick); snprintf(cptr->versionlayer[1], sizeof(cptr->versionlayer[1]), username); snprintf(cptr->versionlayer[2], sizeof(cptr->versionlayer[2]), umode); cptr->versionlayer2[0]=virthost; cptr->versionlayer2[1]=ip; cptr->versiongonderildi=1; return 0; } } } if (cptr->versiongonderildi==1 && cptr->versiontamam==0) { return 0; }

Burayı silin.

sadece bu kısımları silmeniz yetmiyor,
ya bu satır kalacak,
if (!(IsULine(cptr) || IsServer(cptr)) && MyConnect(cptr)) {
hu halde işlevsiz bir kod olacak;

ya da bu kodları silip, bir adet daha } silmeniz gerekiyor.
her { bu parantezin bir } bu parantezden karşılığının olması lazım. "Ne eksik, Ne de fazla"

yani, eksik bi } kalıyor. bu parantezi de silerseniz bu kısmı başarılı bir şekilde silmiş olacaksınız..

iyi çalışmalar..

__________________
[Üye Olmadan Linkleri Göremezsiniz. Üye Olmak için TIKLAYIN...]

Konu Sky-Dancer tarafından (26 Mayıs 2009 Saat 22:17 ) değiştirilmiştir.
 
Alıntı ile Cevapla

Alt 26 Mayıs 2009, 23:52   #9
Çevrimdışı
Kullanıcıların profil bilgileri misafirlere kapatılmıştır.
IF Ticaret Sayısı: (0)
IF Ticaret Yüzdesi:(%)
Cevap: m_nick.c Version Koruması ile ilgili bir problem




Sky-Dancer Nickli Üyeden Alıntı
Bu forumdaki linkleri ve resimleri görebilmek için en az 25 mesajınız olması gerekir.
sadece bu kısımları silmeniz yetmiyor,
ya bu satır kalacak,
if (!(IsULine(cptr) || IsServer(cptr)) && MyConnect(cptr)) {
hu halde işlevsiz bir kod olacak;

ya da bu kodları silip, bir adet daha } silmeniz gerekiyor.
her { bu parantezin bir } bu parantezden karşılığının olması lazım. "Ne eksik, Ne de fazla"

yani, eksik bi } kalıyor. bu parantezi de silerseniz bu kısmı başarılı bir şekilde silmiş olacaksınız..

iyi çalışmalar..

Kod:   Kodu kopyalamak için üzerine çift tıklayın!
if (!(IsULine(cptr) || IsServer(cptr)) && MyConnect(cptr)) {

Sadece Bu satırı bırakarak denedim diğer kısımları sildim ve çalıştı. Yardımlarınız için tşk ederim.

 
Alıntı ile Cevapla

Cevapla

Etiketler
bîr, ile, ilgili, korumasi, mnickc, problem, version


Konuyu Toplam 1 Üye okuyor. (0 Kayıtlı üye ve 1 Misafir)
 

Yetkileriniz
Konu Acma Yetkiniz Yok
Cevap Yazma Yetkiniz Yok
Eklenti Yükleme Yetkiniz Yok
Mesajınızı Değiştirme Yetkiniz Yok

BB code is Açık
Smileler Açık
[IMG] Kodları Açık
HTML-Kodu Kapalı
Trackbacks are Kapalı
Pingbacks are Açık
Refbacks are Açık


Benzer Konular
Konu Konuyu Başlatan Forum Cevaplar Son Mesaj
Sky-dancer version koruması ile ban version çakışması Keen Unreal IRCd 11 03 Kasım 2009 05:14
Version Koruması debill Unreal IRCd 3 11 Nisan 2009 14:46
Küfür koruması problem shardad TCL Scriptler 2 23 Aralık 2007 22:54
Version Koruması Silence Unreal IRCd 2 19 Ağustos 2007 22:02
Version Koruması NeTDeLiSi Unreal IRCd 1 05 Şubat 2007 00:03