[eggheads-patches] PATCH: botrecall.patch

Peter 'Rattacresh' Backes rtc at rhrk.uni-kl.de
Fri Oct 15 16:24:43 CST 1999


This patch modifies .chnick to allow (botnet) masters to rename any 
bot to our botnetnick if it's currently not connected.
It also disallows anyone to create user records with the botnetnick 
as handle. Only bot records can be created with this name, via .+bot.
A warning message is logged if the user finds a user record without 
+b with the botnetnick in the user file.
.chattr didn't have to be fixed as it doesn't allow +b/-b changes.


-- Peter 'Rattacresh' Backes, rtc at rhrk.uni-kl.de

-------------- next part --------------
diff -urN eggdrop1.3.29/doc/UPDATES1.3 eggdrop1.3.29+botrecall/doc/UPDATES1.3
--- eggdrop1.3.29/doc/UPDATES1.3	Fri Oct 15 17:15:03 1999
+++ eggdrop1.3.29+botrecall/doc/UPDATES1.3	Fri Oct 15 17:13:48 1999
@@ -4,6 +4,9 @@
 
 1.3.29
 Foundby   Fixedby   What....
+          rtc       .chnick can now rename any +b to the bots nick if
+                    currently not connected, fixed .+user to not allow to
+                    create user accounts with the bots name.
           Cybah	    strncpy() being used on buffers without terminating them.
 Tothwolf  Fabian    stopped userfile parsing funcs from messing with ~ and `
           rtc       language files were being installed twice
diff -urN eggdrop1.3.29/src/cmds.c eggdrop1.3.29+botrecall/src/cmds.c
--- eggdrop1.3.29/src/cmds.c	Fri Oct 15 17:15:04 1999
+++ eggdrop1.3.29+botrecall/src/cmds.c	Fri Oct 15 17:11:41 1999
@@ -810,6 +810,8 @@
   else if (get_user_by_handle(userlist, newhand) &&
           strcasecmp(hand, newhand))
     dprintf(idx, "Somebody is already using %s.\n", newhand);
+  else if (!strcasecmp(newhand, botnetnick))
+    dprintf(idx, "Hey! That's MY name!\n");
   else {
     u2 = get_user_by_handle(userlist, hand);
     atr2 = u2 ? u2->flags : 0;
@@ -823,9 +825,6 @@
       dprintf(idx, "Can't change the bot owner's handle.\n");
     else if (isowner(hand) && strcasecmp(dcc[idx].nick, hand))
       dprintf(idx, "Can't change the permanent bot owner's handle.\n");
-    else if (!strcasecmp(newhand, botnetnick) && (!(atr2 & USER_BOT) ||
-             nextbot(hand) != -1))
-      dprintf(idx, "Hey! That's MY name!\n");
     else if (change_handle(u2, newhand)) {
       putlog(LOG_CMDS, "*", "#%s# chnick %s %s", dcc[idx].nick,
             hand, newhand);
@@ -2279,13 +2278,11 @@
   host = newsplit(&par);
   if (strlen(handle) > HANDLEN)
     handle[HANDLEN] = 0;	/* max len = XX */
-  if (get_user_by_handle(userlist, handle))
+  if (get_user_by_handle(userlist, handle)) {
     dprintf(idx, "Someone already exists by that name.\n");
-  else if (strchr(BADNICKCHARS, handle[0]) != NULL)
+  } else if (strchr(BADNICKCHARS, handle[0]) != NULL) {
     dprintf(idx, "You can't start a nick with '%c'.\n", handle[0]);
-  else if (!strcasecmp(handle, botnetnick))
-    dprintf(idx, "Hey! That's MY name!\n");
-  else {
+  } else {
     putlog(LOG_CMDS, "*", "#%s# +user %s %s", dcc[idx].nick, handle, host);
     userlist = adduser(userlist, handle, host, "-", 0);
     dprintf(idx, "Added %s (%s) with no password or flags.\n", handle, host);
diff -urN eggdrop1.3.29/src/tcluser.c eggdrop1.3.29+botrecall/src/tcluser.c
--- eggdrop1.3.29/src/tcluser.c	Fri Oct 15 17:15:04 1999
+++ eggdrop1.3.29+botrecall/src/tcluser.c	Fri Oct 15 17:11:41 1999
@@ -381,8 +381,7 @@
       x = 0;
     else if (get_user_by_handle(userlist, hand))
       x = 0;
-    else if ((!strcasecmp(origbotname, hand) || !rfc_casecmp(botnetnick, hand)) &&
-             (!(u->flags & USER_BOT) || nextbot (argv [1]) != -1))
+    else if (!strcasecmp(origbotname, hand) || !rfc_casecmp(botnetnick, hand))
       x = 0;
     else if (hand[0] == '*')
       x = 0;
diff -urN eggdrop1.3.29/src/users.c eggdrop1.3.29+botrecall/src/users.c
--- eggdrop1.3.29/src/users.c	Fri Oct 15 17:15:04 1999
+++ eggdrop1.3.29+botrecall/src/users.c	Fri Oct 15 17:11:41 1999
@@ -986,11 +986,6 @@
   for (u = bu; u; u = u->next) {
     struct user_entry *e;
 
-    if (!(u->flags & USER_BOT) && !strcasecmp (u->handle, botnetnick)) {
-      putlog(LOG_MISC, "*", "(!) I have an user record, but without +b");
-      /* u->flags |= USER_BOT; */
-    }
-    
     for (e = u->entries; e; e = e->next)
       if (e->name) {
 	struct user_entry_type *uet = find_entry_type(e->name);


More information about the Patches mailing list