Author: Kev <klmitch@mit.edu>
authorKevin L. Mitchell <klmitch@mit.edu>
Fri, 8 Jun 2001 23:12:17 +0000 (23:12 +0000)
committerKevin L. Mitchell <klmitch@mit.edu>
Fri, 8 Jun 2001 23:12:17 +0000 (23:12 +0000)
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

13 files changed:
ChangeLog
include/s_serv.h
include/s_user.h
ircd/channel.c
ircd/gline.c
ircd/ircd.c
ircd/jupe.c
ircd/m_nick.c
ircd/m_pong.c
ircd/m_server.c
ircd/m_user.c
ircd/s_serv.c
ircd/s_user.c

index 921822fb5c15f180ea62ef17dad5a74d7a50aea5..3ce72349da533f7bacc68e5e3060a2b38ed6ab2e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,46 @@
+2001-06-08  Kevin L. Mitchell  <klmitch@mit.edu>
+
+       * 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  <klmitch@mit.edu>
 
        * ircd/s_stats.c (hunt_stats): forward-port from pl15 of all the
index 387e7cfc4b46fec68478a2ba3f77c554dff07766..e6c1f3392f2cb878602547bb841a91a0bf08d8e8 100644 (file)
@@ -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 */
index fec38e238f7e0fd10718d881659c9329fc0d55d0..296d8193206cfd2785afa5189368065b5632ed0f 100644 (file)
@@ -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);
 
index 8ad335612209d469b065c72143cd5a1b44ffc80a..d10e5c0ebdaddb85eb0fbcc1266b769b0dfc88a6 100644 (file)
@@ -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,
index 7f0186ff9c5cd53b38664bc725ce66b945b5b0b6..63621567864be7af7c2baec5c02b9c5f138600ce 100644 (file)
@@ -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,
index cfee4af807282c030b1719c438956a87ff32bdc7..d6085344441600988cc0412cbb60c8adbbecd8c5 100644 (file)
@@ -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
index 2a58812a07a1de13e8875dea9da73c59a990baf9..b406f54509cbc5c3f40e276fba09c6c87a9d0545 100644 (file)
@@ -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);
index 5990ba6d46a450adb16b59f25d1b329d04bfb618..83cefe351c8e3e93c50ea918fd452f517c7263b7 100644 (file)
@@ -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] = %<lastmod>:<mask>   <- Only if matching GLINE
  *   parv[parc-3] = IP#                 <- Only Protocol >= 10
  *   parv[parc-2] = YXX, numeric nick   <- Only Protocol >= 10
  *   parv[parc-1] = info
index a746ca8abb1375c385733d0043008df3062363a1..507212621fae5145c3eb77bfbcb38f10b028d153 100644 (file)
@@ -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,
index 394fccdb97574960aca5f6f80b8d819c9f25462c..6743284fcd32ed80d939a77270f5609f7947be30 100644 (file)
@@ -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] = %<lastmod> - 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;
index 55ac6a8a1a136feb5051d5c816be9a9a51eafffd..06a8917de069768ea4bfe729cf9b284661e5aa81 100644 (file)
@@ -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);
index ff5d2e0149dba658a4091ff9dabe5bb17b70334d..c6eac617c077663ccefa21c3c4534fbc811fe08b 100644 (file)
@@ -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));
     }
   }
   /*
index 6d7cc911a40a0119fbbef57ff251724ef4100069..78d94cf08c7c6cb5d78a52b144c0bc89d5533f61 100644 (file)
@@ -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;
     }
   }