Просмотр исходного кода

* 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 лет назад
Родитель
Сommit
824962ff81
3 измененных файлов с 13 добавлено и 2 удалено
  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)
 * Fixed cmd_slowjoin (#129)
 * Automatic host adding by localhubs now sanity checks if the hosts will conflict with other bots/users. (#137)
 * 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)
 * 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
 1.2.4
 * Fixed cmd_botset not displaying botnick.
 * 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
    Changes the handle of a user. For example, to change the handle of user
    'gavroche' to 'jamie', you would use 'chhandle gavroche jamie'.
    '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%{-}
 See also: chpass%{+n}, chsecpass%{-}
 ::chinfo
 ::chinfo
 ###  $bchinfo$b <user> [channel] [info-line/none]
 ###  $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 will know you as from this point forward. It is used to log into the
    bot.
    bot.
  
  
+   Perm owners may not change their handle without recompiling binaries first. 
 See also: newpass%{+mi}, chhand, chpass%{-}%{+n}, chsecpass%{-}
 See also: newpass%{+mi}, chhand, chpass%{-}%{+n}, chsecpass%{-}
 ::help:
 ::help:
 ###  $bhelp$b [cmd]
 ###  $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++)
   for (size_t i = 0; i < strlen(newhand); i++)
     if ((newhand[i] <= 32) || (newhand[i] >= 127) || (newhand[i] == '@'))
     if ((newhand[i] <= 32) || (newhand[i] >= 127) || (newhand[i] == '@'))
       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]);
     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))
   else if (get_user_by_handle(userlist, newhand) && egg_strcasecmp(hand, newhand))
     dprintf(idx, "Somebody is already using %s.\n", 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++)
   for (size_t i = 0; i < strlen(newhandle); i++)
     if ((newhandle[i] <= 32) || (newhandle[i] >= 127) || (newhandle[i] == '@'))
     if ((newhandle[i] <= 32) || (newhandle[i] >= 127) || (newhandle[i] == '@'))
       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",
     dprintf(idx, "Bizarre quantum forces prevent handle from starting with '%c'.\n",
 	    newhandle[0]);
 	    newhandle[0]);
   } else if (get_user_by_handle(userlist, newhandle) &&
   } else if (get_user_by_handle(userlist, newhandle) &&