Package: oftc-hybrid
Version: 1.6.3.dfsg-1
Severity: wishlist
Tags: patch

Hi,

To make the oftc-hybrid irc server more transparent to
users, it would be nice, if they could look which modules
are currently loaded. It gives a better feeling to users,
if they know, which modules were loaded by the admin.

The only obvious security issue might be the load adresses
of the module, that's why the attached patch hides those
from the normal user output.

Other irc servers have quite the same behaviour (let normal
users use modlist, but not get the addresses).

The attached patch does exactly this.


Greetings,

Elrond
--- oftc-hybrid-1.6.3.dfsg.orig/src/modules.c
+++ oftc-hybrid-1.6.3.dfsg/src/modules.c
@@ -109,7 +109,7 @@
 
 struct Message modlist_msgtab = {
  "MODLIST", 0, 0, 0, 0, MFLG_SLOW, 0,
-  {m_unregistered, m_not_oper, m_ignore, m_ignore, mo_modlist, m_ignore}
+  {m_unregistered, mo_modlist, m_ignore, m_ignore, mo_modlist, m_ignore}
 };
 
 struct Message modrestart_msgtab = {
@@ -508,31 +508,28 @@
 {
   dlink_node *ptr;
   struct module *modp;
-
-  if (!IsAdmin(source_p))
-  {
-    sendto_one(source_p, form_str(ERR_NOPRIVILEGES),
-               me.name, source_p->name);
-    return;
-  }
+  int is_admin = IsAdmin(source_p);
 
   DLINK_FOREACH(ptr, mod_list.head)
   {
+    int show_this_one = 0;
     modp = ptr->data;
 
     if (parc > 1)
     {
       if (match(parv[1], modp->name))
       {
-        sendto_one(source_p, form_str(RPL_MODLIST), me.name, parv[0],
-                   modp->name, modp->address,
-                   modp->version, modp->core?"(core)":"");
+        show_this_one = 1;
       }
     }
     else
+      show_this_one = 1;
+
+    if (show_this_one)
     {
       sendto_one(source_p, form_str(RPL_MODLIST), me.name, parv[0],
-                 modp->name, modp->address,
+                 modp->name,
+                 (is_admin ? modp->address : 0),
                  modp->version, modp->core?"(core)":"");
     }
   }

Reply via email to