Re: More uh. yep. Dynamic Board stuff.

From: Sammy (samedi@DHC.NET)
Date: 03/04/98


On Wed, 4 Mar 1998, George wrote:

>   /*
>    * Erase any ~'s inserted by people in the editor.  This prevents anyone
>    * using online creation from causing parse errors in the world files.
>    * Suggested by Sammy <samedi@dhc.net>, -gg 2/20/98
>    */

Wasn't my suggestion.  I think removing all tildes is a bad idea, since
they can be fairly common (especially if people are exchanging url's on
the boards).

Here's my original suggestion:

Date: Wed, 28 Jan 1998 09:59:06 -0600 (CST)
From: Sammy <samedi@dhc.net>
Subject: Re:  [ALERT!!!] Major back door in AScii PFiles!!!

> A lot of simple solutions have been mentioned.  I think I fixed this in my
> copy long ago and forgot about it, because it works ok for me.
> Personally, I'd just hack string_add to make ~ a terminator along with @.
> Then you get the added benefit of protection against clever builders who
> put ~'s in mob/obj/room descriptions to break world files and keep the
> mud from booting.

And the code to make it happen:

diff -up src/db.c new/db.c
--- src/db.c    Thu Dec 25 13:16:56 1997
+++ new/db.c    Wed Mar  4 21:03:08 1998
@@ -2060,8 +2060,8 @@ char *fread_string(FILE * fl, char *erro
       exit(1);
     }
     /* If there is a '~', end the string; else put an "\r\n" over the '\n'. */
-    if ((point = strchr(tmp, '~')) != NULL) {
-      *point = '\0';
+    if (*tmp == '~') {
+      *tmp = '\0';
       done = 1;
     } else {
       point = tmp + strlen(tmp) - 1;
diff -up src/modify.c new/modify.c
--- src/modify.c        Tue Oct 28 23:16:28 1997
+++ new/modify.c        Wed Mar  4 20:51:11 1998
@@ -62,7 +62,7 @@ void string_add(struct descriptor_data *

   delete_doubledollar(str);

-  if ((terminator = (*str == '@')))
+  if ((terminator = (*str == '@' || *str == '~')))
     *str = '\0';

   if (!(*d->str)) {

This allows tildes to be used anywhere in the editor except at the
beginning of a line, in which case it's equivalent to a '@' terminator.

Sam


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



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