Bug in ban.c

From: Andrey Fidrya (andrey@alex-ua.com)
Date: 01/02/99


I cc-d this msg to bugs@circlemud.org.
Any imms with "switch" command can abuse this bug and create a new char with
same name as their is.
Also, GET_NAME() macros won't work with my IS_NPC (pfilepos check), so I had
to change it to GET_PC_NAME.
Here is it:
int Valid_Name(char *newname)
[...]
-  for (dt = descriptor_list; dt; dt = dt->next)
-    if (dt->character && GET_NAME(dt->character) &&
!str_cmp(GET_NAME(dt->character), newname))
-      return (STATE(dt) == CON_PLAYING);
+  for (dt = descriptor_list; dt; dt = dt->next) {
+    if (dt->original)
+      ch = dt->original;
+    else if (dt->character)
+      ch = dt->character;
+    else
+      continue;
+    if (GET_PC_NAME(ch) && !str_cmp(GET_PC_NAME(ch), newname))
+      return (STATE(dt) == CON_PLAYING); /* If playing, allow reconnecting.
*/
+  }

Zmey


     +------------------------------------------------------------+
     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
     +------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 12/15/00 PST