Subject: Object matching and programmer privilages

From: Tanya Louise Daum <[email-masked]>
Date: Sat, 15 Aug 1992 20:17:14 -0700

One thing that *really* TICKs me off about the built in MOO parser is the way a
total non-programmer can do look #xxx or look $xxx and see the object.  I know,
I could hack #1:look_self, etc. to make sure that it is in the location, and
everything, but that, to me, seems like a huge amount of time (just ask the
wizards at GodNet)

In an RPG system, you don't want people throwing object numbers around.  What
I'd like to see, in the next release, is a compile time option that lets you
specify whether you'd like non-programmers be able to specify object numbers on
the command line.  A simple call to is_programmer in the matching routines to
prevent things like this would be really nice.

Alterntively, I wouldn't mind seeing all object matching moved in-db.  Parsing
in-db is nice, but my main concern is with object matching.

---

From: [email-masked] (H. Peter Anvin N9ITP)
Date: Mon, 17 Aug 1992 12:15:18 -0700

Here is a patch that *seems* to take care of the problem for out-of-db
matching.  It is rather untested, and of course you'll want to change
$match_utils if you are using LambdaCore, but...

cd to your LambdaMOO 1.6.1 source directory and type:

	patch -p0 < thisfile

[If you don't have patch get it from aeneas.mit.edu]

then edit the DEFS line in your Makefile to include -DNO_PL_NUM_MATCH and
make.

	/hpa

*** src1.6.1/Makefile	Fri Aug 14 15:47:05 1992
--- Makefile	Sun Aug 16 00:20:00 1992
***************
*** 47,52 ****
--- 47,56 ----
  #			recent checkpoint.  The log is flushed whenever a
  #			checkpoint is successfully begun and is dumped into the
  #			server log when and if the server panics.
+ #
+ # -DNO_PL_NUM_MATCH     Disallows players from using object numbers in
+ #                       commands; parser will not recognize object numbers
+ #                       typed in by non-programmers.
  
  # These definitions work for SunOS 4.1.1, IRIX4.0, and DEC/MIPS Ultrix 4.2.
  #DEFS = -DUSE_RANDOM -DUSE_POSIX
*** src1.6.1/match.c	Tue Aug 11 12:02:19 1992
--- match.c	Sun Aug 16 00:21:20 1992
***************
*** 91,96 ****
--- 91,102 ----
  	return NOTHING;
      if (name[0] == '#') {
  	char   *p;
+ 
+ #ifdef NO_PL_NUM_MATCH
+ 	if ( !is_programmer(player) )
+ 	  return FAILED_MATCH;
+ #endif
+ 
  	Objid	r = strtol(name + 1, &p, 10);
  
  	if (*p != '\0' || !retrieve(r))

-- 
INTERNET:  [email-masked]   TALK:      [email-masked]
BITNET:    HPA@NUACC     IBMNET:    16334@IBMX400
HAM RADIO: N9ITP         NeXTMAIL:  [email-masked]
Seeg??  I don't need no goddamn seeg!

---

From: Judy Anderson <[email-masked]>
Date: Mon, 17 Aug 1992 12:37:00 -0700

Hmmm.  Now that you've already done it...  I would suggest that better
semantics might be to disallow non-progs from using object numbers for
objects that they don't own...  Otherwise they might be screwed after
some creation command that put the object in #-1; no way to recover it.

Possibly this issue should be tabled though, until we get real in-db
parsing, since your purposes were for an RPG mud, and players won't be
creating objects in a strict RPG setting.
							yduJ