Jelajahi Sumber

* Perm owners may no longer change their handle via cmd_handle or cmd_chhandle. (#107)
(A user may change to a perm-owner handle though in a situation where the list changes in binary)


svn: 2311

Bryan Drewery 21 tahun lalu
induk
melakukan
824962ff81
3 mengubah file dengan 13 tambahan dan 2 penghapusan
  1. 2 0
      doc/UPDATES
  2. 3 0
      misc/help.txt
  3. 8 2
      src/cmds.c

+ 2 - 0
doc/UPDATES

@@ -56,6 +56,8 @@ Lines prefixed with '-' were disabled before release and are not finished, or ar
 * Fixed cmd_slowjoin (#129)
 * Automatic host adding by localhubs now sanity checks if the hosts will conflict with other bots/users. (#137)
 * Fixed cmd_chanset not displaying ALL invalid channel flags, although, there are still *many* errors like with with the chanset code. (#136)
+* Perm owners may no longer change their handle via cmd_handle or cmd_chhandle. (#107)
+  (A user may change to a perm-owner handle though in a situation where the list changes in binary)
 
 1.2.4
 * Fixed cmd_botset not displaying botnick.

+ 3 - 0
misc/help.txt

@@ -617,6 +617,8 @@ See also: whois
    Changes the handle of a user. For example, to change the handle of user
    'gavroche' to 'jamie', you would use 'chhandle gavroche jamie'.
  
+   Perm owners may not change their handle without recompiling binaries first. 
+ 
 See also: chpass%{+n}, chsecpass%{-}
 ::chinfo
 ###  $bchinfo$b <user> [channel] [info-line/none]
@@ -1000,6 +1002,7 @@ See also: console, channels%{+m}, status%{-}
    bot will know you as from this point forward. It is used to log into the
    bot.
  
+   Perm owners may not change their handle without recompiling binaries first. 
 See also: newpass%{+mi}, chhand, chpass%{-}%{+n}, chsecpass%{-}
 ::help:
 ###  $bhelp$b [cmd]

+ 8 - 2
src/cmds.c

@@ -1082,7 +1082,10 @@ static void cmd_chhandle(int idx, char *par)
   for (size_t i = 0; i < strlen(newhand); i++)
     if ((newhand[i] <= 32) || (newhand[i] >= 127) || (newhand[i] == '@'))
       newhand[i] = '?';
-  if (strchr(BADHANDCHARS, newhand[0]) != NULL)
+  if (isowner(hand)) {
+    dprintf(idx, "Sorry, perm owners may not change their handle without recompiling binaries.\n");
+    return;
+  } else if (strchr(BADHANDCHARS, newhand[0]) != NULL)
     dprintf(idx, "Bizarre quantum forces prevent nicknames from starting with '%c'.\n", newhand[0]);
   else if (get_user_by_handle(userlist, newhand) && egg_strcasecmp(hand, newhand))
     dprintf(idx, "Somebody is already using %s.\n", newhand);
@@ -1130,7 +1133,10 @@ static void cmd_handle(int idx, char *par)
   for (size_t i = 0; i < strlen(newhandle); i++)
     if ((newhandle[i] <= 32) || (newhandle[i] >= 127) || (newhandle[i] == '@'))
       newhandle[i] = '?';
-  if (strchr(BADHANDCHARS, newhandle[0]) != NULL) {
+  if (isowner(dcc[idx].nick)) {
+    dprintf(idx, "Sorry, perm owners may not change their handle without recompiling binaries.\n");
+    return;
+  } else if (strchr(BADHANDCHARS, newhandle[0]) != NULL) {
     dprintf(idx, "Bizarre quantum forces prevent handle from starting with '%c'.\n",
 	    newhandle[0]);
   } else if (get_user_by_handle(userlist, newhandle) &&