Author: beware <steendijk@tomaatnet.nl> && Alex Badea <vampire@p16.pub.ro>
authorAlex Badea <vampire@p16.pub.ro>
Tue, 16 Apr 2002 13:34:07 +0000 (13:34 +0000)
committerAlex Badea <vampire@p16.pub.ro>
Tue, 16 Apr 2002 13:34:07 +0000 (13:34 +0000)
Log message:

beware: fixed m_whois The Right Way (tm), also cleaned up m_admin

Vampire-: fixed hunt_server_cmd not sending "no such server" for
servermasks

(pull-up from u2_10_11 branch)

git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@741 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
include/patchlevel.h
ircd/m_admin.c
ircd/m_whois.c
ircd/s_user.c

index 4efa31ab74e1d503a5aa049e7650bdbd7e99d32f..bb761e2b8b04d35e32310c96c147189d22992ddd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2002-04-16  Alex Badea  <vampire@p16.pub.ro>
+
+       * ircd/s_user.c (hunt_server_cmd): also send a "no such server"
+       reply if the servername contains a '*' and it doesn't exist
+
+       * include/patchlevel.h (PATCHLEVEL): bump patchlevel
+
+2002-04-16  beware <steendijk@tomaatnet.nl>
+
+       * ircd/m_whois.c: the previous patch broke whois, fixed it
+       another way
+
+       * ircd/m_admin.c: cleaned up m_admin too while we're here,
+       hunt_server_cmd can do all the work for us
+
 2002-04-15  Alex Badea  <vampire@p16.pub.ro>
 
        * ircd/m_stats.c: added verbose server reporting (/stats v
index 72f5f2b1b3d7705406182f460797bca581fe8582..d954db7f3a6b0d1321295a4997d854ab21e06334 100644 (file)
@@ -18,7 +18,7 @@
  * $Id$
  *
  */
-#define PATCHLEVEL "03"
+#define PATCHLEVEL "04"
 
 #define RELEASE ".12.alpha."
 
index b918f3b674441741dadb15615b17df8bbaf849d9..e9b44883fd70c2973ebccd73c291f3fc555161ac 100644 (file)
@@ -135,19 +135,9 @@ int mo_admin(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
   assert(0 != cptr);
   assert(cptr == sptr);
 
-  if (parc > 1) {
-    struct Client *acptr;
-    acptr = FindUser(parv[1]);
-    if (acptr)
-      parv[1] = cli_name(cli_user(acptr)->server);
-    else if (!(acptr = find_match_server(parv[1])))
-      return send_reply(sptr, ERR_NOSUCHSERVER, parv[1]);
-
-    parv[1] = cli_name(acptr);
-    if (hunt_server_cmd(sptr, CMD_ADMIN, cptr, HEAD_IN_SAND_REMOTE, ":%C", 1,
-                       parc, parv) != HUNTED_ISME)
-      return 0;
-  }
+  if (hunt_server_cmd(sptr, CMD_ADMIN, cptr, HEAD_IN_SAND_REMOTE, ":%C", 1,
+                     parc, parv) != HUNTED_ISME)
+    return 0;
   return send_admin_info(sptr);
 }
 
index 4324e0aa1e07e7eb60a22d06c75b2b2333c045d6..5a5109449b42e08a105b367f26266a2a809df94e 100644 (file)
@@ -357,7 +357,6 @@ int m_whois(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
 
   if (parc > 2)
   {
-    struct Client *acptr;
     /* For convenience: Accept a nickname as first parameter, by replacing
      * it with the correct servername - as is needed by hunt_server().
      * This is the secret behind the /whois nick nick trick.
@@ -370,22 +369,11 @@ int m_whois(struct Client* cptr, struct Client* sptr, int parc, char* parv[])
       parv[1] = parv[2];
 #endif
 
-    acptr = FindUser(parv[1]);
-
-    if (IsOper(sptr) && !(acptr))
-    {
-      send_reply(sptr, ERR_NOSUCHSERVER, parv[1]);
-      return 0;
-    }
+    if (hunt_server_cmd(sptr, CMD_WHOIS, cptr, 0, "%C :%s", 1, parc, parv) !=
+       HUNTED_ISME)
+    return 0;
     
-    if (acptr)
-    {
-      parv[1] = cli_name(cli_user(acptr)->server);
-      if (hunt_server_cmd(sptr, CMD_WHOIS, cptr, 0, "%C :%s", 1, parc, parv) !=
-         HUNTED_ISME)
-      return 0;
-      parv[1] = parv[2];
-    }
+    parv[1] = parv[2];
   }
 
   for (tmp = parv[1]; (nick = ircd_strtok(&p, tmp, ",")); tmp = 0)
index 52d55a85108fb50d284c85600f9b3d41faa1165a..dd6b51b349f435df245b9c66db2196f649cd34d3 100644 (file)
@@ -175,7 +175,9 @@ struct Client *next_client(struct Client *next, const char* ch)
  *            Command can have only max 8 parameters.
  *
  *    server  parv[server] is the parameter identifying the
- *            target server.
+ *            target server. It can be a nickname, servername,
+ *            or server mask (from a local user) or a server
+ *            numeric (from a remote server).
  *
  *    *WARNING*
  *            parv[server] is replaced with the pointer to the
@@ -205,8 +207,10 @@ int hunt_server_cmd(struct Client *from, const char *cmd, const char *tok,
   if (MyUser(from)) {
     /* Make sure it's a server */
     if (!strchr(to, '*')) {
-      if (0 == (acptr = FindClient(to)))
+      if (0 == (acptr = FindClient(to))) {
+        send_reply(from, ERR_NOSUCHSERVER, to);
         return HUNTED_NOSUCH;
+      }
 
       if (cli_user(acptr))
         acptr = cli_user(acptr)->server;
@@ -251,8 +255,10 @@ int hunt_server_prio_cmd(struct Client *from, const char *cmd, const char *tok,
   if (MyUser(from)) {
     /* Make sure it's a server */
     if (!strchr(to, '*')) {
-      if (0 == (acptr = FindClient(to)))
+      if (0 == (acptr = FindClient(to))) {
+        send_reply(from, ERR_NOSUCHSERVER, to);
         return HUNTED_NOSUCH;
+      }
 
       if (cli_user(acptr))
         acptr = cli_user(acptr)->server;