From: Kevin L. Mitchell Date: Fri, 8 Jun 2001 23:12:17 +0000 (+0000) Subject: Author: Kev X-Git-Url: http://git.pk910.de/?p=ircu2.10.12-pk.git;a=commitdiff_plain;h=d7ad89d2770abe6284f02d99b6169c52a02bce92 Author: Kev Log message: When HEAD_IN_SAND_SNOTICES is #define'd, there is no longer any reason to hide the nickname of an operator using, say, /OPMODE (except in the actual MODE command sent to the channel). Therefore, whenever HEAD_IN_SAND_SNOTICES is #define'd, /OPMODE, /CLEARMODE, /GLINE, and /JUPE generate server notices containing the generating operator's nickname. The old chroot() and setuid() support code has been removed. There are plenty of code paths that get traversed before we even hit the setuid stuff, which is a security risk. There're much better ways of handling setuid operation in the first place, which is what we're going to move to. I will write documentation and preparation scripts for this. Previously, whenever a user that is GLINEd or a server that is JUPEd showed up on line from a remote server, the GLINE or JUPE was retransmitted. To prevent the network from being clogged up, I added a parameter to allow a server to acknowledge that that JUPE/GLINE is known, and being intentionally ignored. After some discussion, however, it was decided to remove all of that code. Now the only retransmits left in the code are ones where the remote server sends a JUPE/GLINE with a bad mod time...and all that hair is now gone. git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@492 c9e4aea6-c8fd-4c43-8297-357d70d61c8c --- diff --git a/ChangeLog b/ChangeLog index 921822f..3ce7234 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,46 @@ +2001-06-08 Kevin L. Mitchell + + * ircd/s_user.c: remove deprecated struct Gline* argument to + register_user(); remove GLINE rebroadcast; do not send GLINE + acknowledgement parameter to NICK; do not look for GLINE + acknowledgement parameter to NICK while parsing + + * ircd/s_serv.c (server_estab): remove deprecated struct Jupe* + argument to server_estab(); do not send JUPE/GLINE acknowledgement + parameters for SERVER or NICK + + * ircd/m_user.c (m_user): remove deprecated argument to + register_user() + + * ircd/m_server.c: remove deprecated argument to server_estab(); + remove documentation comment regarding JUPE acknowledgement + parameter to SERVER; remove JUPE rebroadcast + + * ircd/m_pong.c (mr_pong): remove deprecated argument to + register_user() + + * ircd/m_nick.c: remove documentation comment regarding GLINE + acknowledgement parameter to NICK + + * ircd/jupe.c: use user's real name in JUPE server notices if + HEAD_IN_SAND_SNOTICES is defined + + * ircd/ircd.c: remove deprecated chroot() code; remove deprecated + setuid code; correct ancient DEBUG vs DEBUGMODE typo + + * ircd/gline.c: use user's real name in GLINE server notices if + HEAD_IN_SAND_SNOTICES is defined + + * ircd/channel.c (modebuf_flush_int): make apparent source be + local server, not oper's server; use user's real name in hack + notices and DESYNC notices if HEAD_IN_SAND_SNOTICES is defined + + * include/s_user.h: remove struct Gline pre-declaration; remove + deprecated struct Gline argument from register_user() + + * include/s_serv.h: remove struct Jupe pre-declaration; remove + deprecated struct Jupe argument from server_estab() + 2001-06-07 Kevin L. Mitchell * ircd/s_stats.c (hunt_stats): forward-port from pl15 of all the diff --git a/include/s_serv.h b/include/s_serv.h index 387e7cf..e6c1f33 100644 --- a/include/s_serv.h +++ b/include/s_serv.h @@ -12,7 +12,6 @@ struct ConfItem; struct Client; -struct Jupe; extern unsigned int max_connection_count; extern unsigned int max_client_count; @@ -23,8 +22,7 @@ extern unsigned int max_client_count; extern int exit_new_server(struct Client* cptr, struct Client* sptr, const char* host, time_t timestamp, const char* fmt, ...); extern int a_kills_b_too(struct Client *a, struct Client *b); -extern int server_estab(struct Client *cptr, struct ConfItem *aconf, - struct Jupe *ajupe); +extern int server_estab(struct Client *cptr, struct ConfItem *aconf); #endif /* INCLUDED_s_serv_h */ diff --git a/include/s_user.h b/include/s_user.h index fec38e2..296d819 100644 --- a/include/s_user.h +++ b/include/s_user.h @@ -12,7 +12,6 @@ struct Client; struct User; -struct Gline; struct Channel; struct MsgBuf; @@ -58,8 +57,7 @@ typedef void (*InfoFormatter)(struct Client* who, struct MsgBuf* buf); extern struct User* make_user(struct Client *cptr); extern void free_user(struct User *user); extern int register_user(struct Client* cptr, struct Client* sptr, - const char* nick, char* username, - struct Gline *agline); + const char* nick, char* username); extern void user_count_memory(size_t* count_out, size_t* bytes_out); diff --git a/ircd/channel.c b/ircd/channel.c index 8ad3356..d10e5c0 100644 --- a/ircd/channel.c +++ b/ircd/channel.c @@ -1431,7 +1431,7 @@ modebuf_flush_int(struct ModeBuf *mbuf, int all) /* Ok, if we were given the OPMODE flag, hide the source if its a user */ if (mbuf->mb_dest & MODEBUF_DEST_OPMODE && !IsServer(mbuf->mb_source)) - app_source = (cli_user(mbuf->mb_source))->server; + app_source = &me; else app_source = mbuf->mb_source; @@ -1539,14 +1539,24 @@ modebuf_flush_int(struct ModeBuf *mbuf, int all) /* send the messages off to their destination */ if (mbuf->mb_dest & MODEBUF_DEST_HACK2) { sendto_opmask_butone(0, SNO_HACK2, "HACK(2): %s MODE %s %s%s%s%s%s%s " - "[%Tu]", cli_name(app_source), + "[%Tu]", +#ifdef HEAD_IN_SAND_SNOTICES + cli_name(mbuf->mb_source), +#else + cli_name(app_source), +#endif mbuf->mb_channel->chname, rembuf_i ? "-" : "", rembuf, addbuf_i ? "+" : "", addbuf, remstr, addstr, mbuf->mb_channel->creationtime); sendcmdto_serv_butone(&me, CMD_DESYNCH, mbuf->mb_connect, ":HACK: %s MODE %s %s%s%s%s%s%s [%Tu]", - cli_name(app_source), mbuf->mb_channel->chname, +#ifdef HEAD_IN_SAND_SNOTICES + cli_name(mbuf->mb_source), +#else + cli_name(app_source), +#endif + mbuf->mb_channel->chname, rembuf_i ? "-" : "", rembuf, addbuf_i ? "+" : "", addbuf, remstr, addstr, mbuf->mb_channel->creationtime); @@ -1554,14 +1564,24 @@ modebuf_flush_int(struct ModeBuf *mbuf, int all) if (mbuf->mb_dest & MODEBUF_DEST_HACK3) sendto_opmask_butone(0, SNO_HACK3, "BOUNCE or HACK(3): %s MODE %s " - "%s%s%s%s%s%s [%Tu]", cli_name(app_source), + "%s%s%s%s%s%s [%Tu]", +#ifdef HEAD_IN_SAND_SNOTICES + cli_name(mbuf->mb_source), +#else + cli_name(app_source), +#endif mbuf->mb_channel->chname, rembuf_i ? "-" : "", rembuf, addbuf_i ? "+" : "", addbuf, remstr, addstr, mbuf->mb_channel->creationtime); if (mbuf->mb_dest & MODEBUF_DEST_HACK4) sendto_opmask_butone(0, SNO_HACK4, "HACK(4): %s MODE %s %s%s%s%s%s%s " - "[%Tu]", cli_name(app_source), + "[%Tu]", +#ifdef HEAD_IN_SAND_SNOTICES + cli_name(mbuf->mb_source), +#else + cli_name(app_source), +#endif mbuf->mb_channel->chname, rembuf_i ? "-" : "", rembuf, addbuf_i ? "+" : "", addbuf, remstr, addstr, diff --git a/ircd/gline.c b/ircd/gline.c index 7f0186f..6362156 100644 --- a/ircd/gline.c +++ b/ircd/gline.c @@ -26,6 +26,7 @@ #include "ircd.h" #include "ircd_alloc.h" #include "ircd_log.h" +#include "ircd_policy.h" #include "ircd_reply.h" #include "ircd_string.h" #include "match.h" @@ -260,8 +261,13 @@ gline_add(struct Client *cptr, struct Client *sptr, char *userhost, /* Inform ops... */ sendto_opmask_butone(0, SNO_GLINE, "%s adding %s %s for %s, expiring at " - "%Tu: %s", IsServer(sptr) ? cli_name(sptr) : + "%Tu: %s", +#ifdef HEAD_IN_SAND_SNOTICES + cli_name(sptr), +#else + IsServer(sptr) ? cli_name(sptr) : cli_name((cli_user(sptr))->server), +#endif flags & GLINE_LOCAL ? "local" : "global", flags & GLINE_BADCHAN ? "BADCHAN" : "GLINE", userhost, expire + TSoffset, reason); @@ -315,8 +321,13 @@ gline_activate(struct Client *cptr, struct Client *sptr, struct Gline *gline, /* Inform ops and log it */ sendto_opmask_butone(0, SNO_GLINE, "%s activating global %s for %s%s%s, " - "expiring at %Tu: %s", IsServer(sptr) ? cli_name(sptr) : + "expiring at %Tu: %s", +#ifdef HEAD_IN_SAND_SNOTICES + cli_name(sptr), +#else + IsServer(sptr) ? cli_name(sptr) : cli_name((cli_user(sptr))->server), +#endif GlineIsBadChan(gline) ? "BADCHAN" : "GLINE", gline->gl_user, GlineIsBadChan(gline) ? "" : "@", GlineIsBadChan(gline) ? "" : gline->gl_host, @@ -373,8 +384,13 @@ gline_deactivate(struct Client *cptr, struct Client *sptr, struct Gline *gline, /* Inform ops and log it */ sendto_opmask_butone(0, SNO_GLINE, "%s %s %s for %s%s%s, expiring at %Tu: " - "%s", IsServer(sptr) ? cli_name(sptr) : + "%s", +#ifdef HEAD_IN_SAND_SNOTICES + cli_name(sptr), +#else + IsServer(sptr) ? cli_name(sptr) : cli_name((cli_user(sptr))->server), +#endif msg, GlineIsBadChan(gline) ? "BADCHAN" : "GLINE", gline->gl_user, GlineIsBadChan(gline) ? "" : "@", GlineIsBadChan(gline) ? "" : gline->gl_host, diff --git a/ircd/ircd.c b/ircd/ircd.c index cfee4af..d608534 100644 --- a/ircd/ircd.c +++ b/ircd/ircd.c @@ -496,10 +496,6 @@ static char check_file_access(const char *path, char which, int mode) { "recompile to correct this.\n", which, path, strerror(errno)); -#ifdef CHROOTDIR - fprintf(stderr, "Keep in mind that paths are relative to CHROOTDIR.\n"); -#endif - return 0; } @@ -524,41 +520,10 @@ static void set_core_limit(void) { -/*---------------------------------------------------------------------------- - * set_chroot_environment - *--------------------------------------------------------------------------*/ -#ifdef CHROOTDIR -static char set_chroot_environment(void) { - /* Must be root to chroot! Silly if you ask me... */ - if (geteuid()) - seteuid(0); - - if (chdir(dpath)) { - fprintf(stderr, "Fail: Cannot chdir(%s): %s\n", dpath, strerror(errno)); - return 0; - } - if (chroot(dpath)) { - fprintf(stderr, "Fail: Cannot chroot(%s): %s\n", dpath, strerror(errno)); - return 0; - } - dpath = "/"; - return 1; -} -#endif - - /*---------------------------------------------------------------------------- * set_userid_if_needed() *--------------------------------------------------------------------------*/ static int set_userid_if_needed(void) { - /* TODO: Drop privs correctly! */ -#if defined(IRC_GID) && defined(IRC_UID) - setgid (IRC_GID); - setegid(IRC_GID); - setuid (IRC_UID); - seteuid(IRC_UID); -#endif - if (getuid() == 0 || geteuid() == 0 || getgid() == 0 || getegid() == 0) { fprintf(stderr, "ERROR: This server will not run as superuser.\n"); @@ -584,11 +549,6 @@ int main(int argc, char **argv) { thisServer.uid = getuid(); thisServer.euid = geteuid(); -#ifdef CHROOTDIR - if (!set_chroot_environment()) - return 1; -#endif - #if defined(HAVE_SETRLIMIT) && defined(RLIMIT_CORE) set_core_limit(); #endif @@ -614,7 +574,7 @@ int main(int argc, char **argv) { !check_file_access(configfile, 'C', R_OK)) return 4; -#ifdef DEBUG +#ifdef DEBUGMODE if (!check_file_access(LPATH, 'L', W_OK)) return 5; #endif diff --git a/ircd/jupe.c b/ircd/jupe.c index 2a58812..b406f54 100644 --- a/ircd/jupe.c +++ b/ircd/jupe.c @@ -28,6 +28,7 @@ #include "ircd.h" #include "ircd_alloc.h" #include "ircd_log.h" +#include "ircd_policy.h" #include "ircd_reply.h" #include "ircd_string.h" #include "match.h" @@ -122,8 +123,13 @@ jupe_add(struct Client *cptr, struct Client *sptr, char *server, char *reason, /* Inform ops and log it */ sendto_opmask_butone(0, SNO_NETWORK, "%s adding %sJUPE for %s, expiring at " - "%Tu: %s", IsServer(sptr) ? cli_name(sptr) : + "%Tu: %s", +#ifdef HEAD_IN_SAND_SNOTICES + cli_name(sptr), +#else + IsServer(sptr) ? cli_name(sptr) : cli_name(cli_user(sptr)->server), +#endif flags & JUPE_LOCAL ? "local " : "", server, expire + TSoffset, reason); @@ -168,7 +174,12 @@ jupe_activate(struct Client *cptr, struct Client *sptr, struct Jupe *jupe, /* Inform ops and log it */ sendto_opmask_butone(0, SNO_NETWORK, "%s activating JUPE for %s, expiring " "at %Tu: %s", - IsServer(sptr) ? cli_name(sptr) : cli_name(cli_user(sptr)->server), +#ifdef HEAD_IN_SAND_SNOTICES + cli_name(sptr), +#else + IsServer(sptr) ? cli_name(sptr) : + cli_name(cli_user(sptr)->server), +#endif jupe->ju_server, jupe->ju_expire + TSoffset, jupe->ju_reason); @@ -211,7 +222,12 @@ jupe_deactivate(struct Client *cptr, struct Client *sptr, struct Jupe *jupe, /* Inform ops and log it */ sendto_opmask_butone(0, SNO_NETWORK, "%s %s JUPE for %s, expiring at %Tu: " "%s", - IsServer(sptr) ? cli_name(sptr) : cli_name(cli_user(sptr)->server), +#ifdef HEAD_IN_SAND_SNOTICES + cli_name(sptr), +#else + IsServer(sptr) ? cli_name(sptr) : + cli_name(cli_user(sptr)->server), +#endif JupeIsLocal(jupe) ? "removing local" : "deactivating", jupe->ju_server, jupe->ju_expire + TSoffset, jupe->ju_reason); diff --git a/ircd/m_nick.c b/ircd/m_nick.c index 5990ba6..83cefe3 100644 --- a/ircd/m_nick.c +++ b/ircd/m_nick.c @@ -246,7 +246,6 @@ int m_nick(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) * parv[4] = username * parv[5] = hostname * parv[6] = umode (optional) - * parv[parc-4] = %: <- Only if matching GLINE * parv[parc-3] = IP# <- Only Protocol >= 10 * parv[parc-2] = YXX, numeric nick <- Only Protocol >= 10 * parv[parc-1] = info diff --git a/ircd/m_pong.c b/ircd/m_pong.c index a746ca8..5072126 100644 --- a/ircd/m_pong.c +++ b/ircd/m_pong.c @@ -163,7 +163,7 @@ int mr_pong(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) /* * NICK and USER OK */ - return register_user(cptr, sptr, cli_name(sptr), cli_user(sptr)->username, 0); + return register_user(cptr, sptr, cli_name(sptr), cli_user(sptr)->username); } else send_reply(sptr, SND_EXPLICIT | ERR_BADPING, diff --git a/ircd/m_server.c b/ircd/m_server.c index 394fccd..6743284 100644 --- a/ircd/m_server.c +++ b/ircd/m_server.c @@ -735,7 +735,7 @@ int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) } } - ret = server_estab(cptr, aconf, ajupe); + ret = server_estab(cptr, aconf); } else ret = 0; @@ -766,8 +766,6 @@ int mr_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) * parv[6] = "YMM", where 'Y' is the server numeric and "MM" is the * numeric nick mask of this server. * parv[7] = 0 (not used yet, mandatory unsigned int after u2.10.06) - * parv[8] = % - optional parameter only present if there's an - * outstanding JUPE; specifies the JUPE's lastmod field */ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) { @@ -780,7 +778,6 @@ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) struct Client* LHcptr = 0; struct ConfItem* aconf = 0; struct ConfItem* lhconf = 0; - struct Jupe* ajupe = 0; int hop; int ret; int active_lh_line = 0; @@ -789,7 +786,6 @@ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) time_t timestamp = 0; time_t recv_time; time_t ghost = 0; - time_t lastmod = 0; if (IsUserPort(cptr)) return exit_client_msg(cptr, cptr, &me, @@ -840,16 +836,6 @@ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) return exit_new_server(cptr, sptr, host, timestamp, "Incompatible protocol: %s", parv[5]); } - if (parc > 9 && *parv[8] == '%') - lastmod = atoi(parv[8] + 1); - /* If there's a jupe that matches, and it's a global jupe, and the - * introducer didn't indicate it knew of the jupe or has an older - * version of the jupe, and the connection isn't in a BURST, resynch - * the jupe. - */ - if ((ajupe = jupe_find(host)) && !JupeIsLocal(ajupe) && - JupeLastMod(ajupe) > lastmod && !IsBurstOrBurstAck(cptr)) - jupe_resend(cptr, ajupe); /* * Check for "FRENCH " infection ;-) (actually this should * be replaced with routine to check the hostname syntax in @@ -1369,7 +1355,7 @@ int ms_server(struct Client* cptr, struct Client* sptr, int parc, char* parv[]) } } - ret = server_estab(cptr, aconf, ajupe); + ret = server_estab(cptr, aconf); } else ret = 0; diff --git a/ircd/m_user.c b/ircd/m_user.c index 55ac6a8..06a8917 100644 --- a/ircd/m_user.c +++ b/ircd/m_user.c @@ -147,7 +147,7 @@ int m_user(struct Client *cptr, struct Client *sptr, int parc, char *parv[]) /* * NICK and PONG already received, now we have USER... */ - return register_user(cptr, sptr, cli_name(sptr), username, 0); + return register_user(cptr, sptr, cli_name(sptr), username); } else { ircd_strncpy(user->username, username, USERLEN); diff --git a/ircd/s_serv.c b/ircd/s_serv.c index ff5d2e0..c6eac61 100644 --- a/ircd/s_serv.c +++ b/ircd/s_serv.c @@ -94,8 +94,7 @@ int a_kills_b_too(struct Client *a, struct Client *b) * May only be called after a SERVER was received from cptr, * and thus make_server was called, and serv->prot set. --Run */ -int server_estab(struct Client *cptr, struct ConfItem *aconf, - struct Jupe *ajupe) +int server_estab(struct Client *cptr, struct ConfItem *aconf) { struct Client* acptr = 0; const char* inpath; @@ -176,16 +175,10 @@ int server_estab(struct Client *cptr, struct ConfItem *aconf, continue; if (!match(cli_name(&me), cli_name(cptr))) continue; - if (ajupe) - sendcmdto_one(&me, CMD_SERVER, acptr, - "%s 2 0 %Tu J%02u %s%s 0 %%%Tu :%s", cli_name(cptr), - cli_serv(cptr)->timestamp, Protocol(cptr), NumServCap(cptr), - JupeLastMod(ajupe), cli_info(cptr)); - else - sendcmdto_one(&me, CMD_SERVER, acptr, - "%s 2 0 %Tu J%02u %s%s 0 :%s", cli_name(cptr), - cli_serv(cptr)->timestamp, Protocol(cptr), NumServCap(cptr), - cli_info(cptr)); + sendcmdto_one(&me, CMD_SERVER, acptr, + "%s 2 0 %Tu J%02u %s%s 0 :%s", cli_name(cptr), + cli_serv(cptr)->timestamp, Protocol(cptr), NumServCap(cptr), + cli_info(cptr)); } /* @@ -220,18 +213,11 @@ int server_estab(struct Client *cptr, struct ConfItem *aconf, split = (MyConnect(acptr) && 0 != ircd_strcmp(cli_name(acptr), cli_sockhost(acptr)) && 0 != ircd_strncmp(cli_info(acptr), "JUPE", 4)); - if ((ajupe = jupe_find(cli_name(acptr))) && !JupeIsLocal(ajupe)) - sendcmdto_one(cli_serv(acptr)->up, CMD_SERVER, cptr, - "%s %d 0 %Tu %s%u %s%s 0 %%%Tu :%s", cli_name(acptr), - cli_hopcount(acptr) + 1, cli_serv(acptr)->timestamp, - protocol_str, Protocol(acptr), NumServCap(acptr), - JupeLastMod(ajupe), cli_info(acptr)); - else - sendcmdto_one(cli_serv(acptr)->up, CMD_SERVER, cptr, - "%s %d 0 %Tu %s%u %s%s 0 :%s", cli_name(acptr), - cli_hopcount(acptr) + 1, cli_serv(acptr)->timestamp, - protocol_str, Protocol(acptr), NumServCap(acptr), - cli_info(acptr)); + sendcmdto_one(cli_serv(acptr)->up, CMD_SERVER, cptr, + "%s %d 0 %Tu %s%u %s%s 0 :%s", cli_name(acptr), + cli_hopcount(acptr) + 1, cli_serv(acptr)->timestamp, + protocol_str, Protocol(acptr), NumServCap(acptr), + cli_info(acptr)); } } @@ -244,25 +230,13 @@ int server_estab(struct Client *cptr, struct ConfItem *aconf, { char xxx_buf[8]; char *s = umode_str(acptr); - struct Gline *agline = 0; - if ((agline = gline_lookup(acptr, GLINE_GLOBAL | GLINE_LASTMOD))) - sendcmdto_one(cli_user(acptr)->server, CMD_NICK, cptr, - "%s %d %Tu %s %s %s%s%s%%%Tu:%s@%s %s %s%s :%s", - cli_name(acptr), cli_hopcount(acptr) + 1, cli_lastnick(acptr), - cli_user(acptr)->username, cli_user(acptr)->host, - *s ? "+" : "", s, *s ? " " : "", - GlineLastMod(agline), GlineUser(agline), - GlineHost(agline), - inttobase64(xxx_buf, ntohl(cli_ip(acptr).s_addr), 6), - NumNick(acptr), cli_info(acptr)); - else - sendcmdto_one(cli_user(acptr)->server, CMD_NICK, cptr, - "%s %d %Tu %s %s %s%s%s%s %s%s :%s", - cli_name(acptr), cli_hopcount(acptr) + 1, cli_lastnick(acptr), - cli_user(acptr)->username, cli_user(acptr)->host, - *s ? "+" : "", s, *s ? " " : "", - inttobase64(xxx_buf, ntohl(cli_ip(acptr).s_addr), 6), - NumNick(acptr), cli_info(acptr)); + sendcmdto_one(cli_user(acptr)->server, CMD_NICK, cptr, + "%s %d %Tu %s %s %s%s%s%s %s%s :%s", + cli_name(acptr), cli_hopcount(acptr) + 1, cli_lastnick(acptr), + cli_user(acptr)->username, cli_user(acptr)->host, + *s ? "+" : "", s, *s ? " " : "", + inttobase64(xxx_buf, ntohl(cli_ip(acptr).s_addr), 6), + NumNick(acptr), cli_info(acptr)); } } /* diff --git a/ircd/s_user.c b/ircd/s_user.c index 6d7cc91..78d94cf 100644 --- a/ircd/s_user.c +++ b/ircd/s_user.c @@ -29,7 +29,6 @@ #include "channel.h" #include "class.h" #include "client.h" -#include "gline.h" #include "hash.h" #include "ircd.h" #include "ircd_alloc.h" @@ -320,7 +319,7 @@ static char *clean_user_id(char *dest, char *source, int tilde) * nick from local user or kill him/her... */ int register_user(struct Client *cptr, struct Client *sptr, - const char *nick, char *username, struct Gline *agline) + const char *nick, char *username) { struct ConfItem* aconf; char* parv[3]; @@ -506,14 +505,6 @@ int register_user(struct Client *cptr, struct Client *sptr, } SetUser(sptr); - /* a gline wasn't passed in, so find a matching global one that isn't - * a Uworld-set one, and propagate it if there is such an animal. - */ - if (!agline && - (agline = gline_lookup(sptr, GLINE_GLOBAL | GLINE_LASTMOD)) && - !IsBurstOrBurstAck(cptr)) - gline_resend(cptr, agline); - if (IsInvisible(sptr)) ++UserStats.inv_clients; if (IsOper(sptr)) @@ -577,24 +568,13 @@ int register_user(struct Client *cptr, struct Client *sptr, } } tmpstr = umode_str(sptr); - if (agline) - sendcmdto_serv_butone(user->server, CMD_NICK, cptr, - "%s %d %Tu %s %s %s%s%s%%%Tu:%s@%s %s %s%s :%s", - nick, cli_hopcount(sptr) + 1, cli_lastnick(sptr), - user->username, user->host, - *tmpstr ? "+" : "", tmpstr, *tmpstr ? " " : "", - GlineLastMod(agline), GlineUser(agline), - GlineHost(agline), - inttobase64(ip_base64, ntohl(cli_ip(sptr).s_addr), 6), - NumNick(sptr), cli_info(sptr)); - else - sendcmdto_serv_butone(user->server, CMD_NICK, cptr, - "%s %d %Tu %s %s %s%s%s%s %s%s :%s", - nick, cli_hopcount(sptr) + 1, cli_lastnick(sptr), - user->username, user->host, - *tmpstr ? "+" : "", tmpstr, *tmpstr ? " " : "", - inttobase64(ip_base64, ntohl(cli_ip(sptr).s_addr), 6), - NumNick(sptr), cli_info(sptr)); + sendcmdto_serv_butone(user->server, CMD_NICK, cptr, + "%s %d %Tu %s %s %s%s%s%s %s%s :%s", + nick, cli_hopcount(sptr) + 1, cli_lastnick(sptr), + user->username, user->host, + *tmpstr ? "+" : "", tmpstr, *tmpstr ? " " : "", + inttobase64(ip_base64, ntohl(cli_ip(sptr).s_addr), 6), + NumNick(sptr), cli_info(sptr)); /* Send umode to client */ if (MyUser(sptr)) @@ -635,8 +615,6 @@ int set_nick_name(struct Client* cptr, struct Client* sptr, if (IsServer(sptr)) { int i; const char* p; - char *t; - struct Gline *agline = 0; /* * A server introducing a new client, change source @@ -677,19 +655,7 @@ int set_nick_name(struct Client* cptr, struct Client* sptr, ircd_strncpy(cli_user(new_client)->host, parv[5], HOSTLEN); ircd_strncpy(cli_info(new_client), parv[parc - 1], REALLEN); - /* Deal with GLINE parameters... */ - if (*parv[parc - 4] == '%' && (t = strchr(parv[parc - 4] + 1, ':'))) { - time_t lastmod; - - *(t++) = '\0'; - lastmod = atoi(parv[parc - 4] + 1); - - if (lastmod && - (agline = gline_find(t, GLINE_EXACT | GLINE_GLOBAL | GLINE_LASTMOD)) - && GlineLastMod(agline) > lastmod && !IsBurstOrBurstAck(cptr)) - gline_resend(cptr, agline); - } - return register_user(cptr, new_client, cli_name(new_client), parv[4], agline); + return register_user(cptr, new_client, cli_name(new_client), parv[4]); } else if ((cli_name(sptr))[0]) { /* @@ -782,7 +748,7 @@ int set_nick_name(struct Client* cptr, struct Client* sptr, * for it - must test this and exit m_nick too ! */ cli_lastnick(sptr) = TStime(); /* Always local client */ - if (register_user(cptr, sptr, nick, cli_user(sptr)->username, 0) == CPTR_KILLED) + if (register_user(cptr, sptr, nick, cli_user(sptr)->username) == CPTR_KILLED) return CPTR_KILLED; } }