This is patch09 to PennMUSH 1.7.2. After applying this patch, you will have version 1.7.2p9. To apply this patch, save it to a file in your top-level MUSH directory, and do the following: patch -p0 < 1.7.2-patch09 rm src/nmalloc.c make If you use GNU patch 2.2, you probably want the above to be 'patch -b -p0', not just 'patch -p0'. Then @shutdown and restart your MUSH. In this patch: Minor bugfixes. - Alan/Javelin Index: Patchlevel Prereq: 1.7.2p8 *** Patchlevel.orig Tue, 14 Apr 1998 14:28:36 -0500 dunemush (pennmush/h/12_Patchlevel 1.9 640) 0.24 --- Patchlevel Tue, 21 Apr 1998 15:18:53 -0500 dunemush (pennmush/h/12_Patchlevel 1.9 640) 0.24(w) *************** *** 1,2 **** Do not edit this file. It is maintained by the official PennMUSH patches. ! This is PennMUSH 1.7.2p8 --- 1,2 ---- Do not edit this file. It is maintained by the official PennMUSH patches. ! This is PennMUSH 1.7.2p9 Index: CHANGES *** CHANGES.orig Tue, 14 Apr 1998 14:28:36 -0500 dunemush (pennmush/h/9_CHANGES 1.10.1.1.1.1.1.1 640) 0.24 --- CHANGES Wed, 22 Apr 1998 11:54:13 -0500 dunemush (pennmush/h/9_CHANGES 1.10.1.1.1.1.1.1 640) 0.24(w) *************** *** 15,20 **** --- 15,34 ---- ========================================================================== + Version 1.7.2 patchlevel 9 April 21, 1998 + + Fixes: + * Myopic flag didn't work unless Pueblo support was on. Reported by + Rhysem@M*U*S*H. + * help debug referred to can_debug, a now-obsolete power. + Reported by Rodimus Prime @ TF2005. + * @chown to a Zone Master didn't work. The @chown code has been + rewritten to be easier to read. Report by Trispis@M*U*S*H. + * open_anywhere was mis-listed in help powers2. Report by Trispis. + * nmalloc.c is removed, and Win32 compiles should be a bit easier. + * Win32 build no longer limited to 64 sockets; 256 instead. [NJG] + + Version 1.7.2 patchlevel 8 April 2, 1998 Fixes: Index: options.h.dist *** options.h.dist.orig Wed, 04 Mar 1998 10:11:19 -0600 dunemush (pennmush/d/36_options.h. 1.2 640) 0.24 --- options.h.dist Tue, 21 Apr 1998 15:03:30 -0500 dunemush (pennmush/d/36_options.h. 1.2 640) 0.24(w) *************** *** 46,53 **** * system, you can choose to use one of the mallocs we provide instead of * your operating system's malloc. Set the value of MALLOC_PACKAGE * to one of these values: ! * 0 -- Use my system's malloc. Recommended only if nothing else works. * FreeBSD 2.2 and later seems to work best with system malloc. * 1 -- Use the CSRI malloc package in normal mode. * Recommended for most operating systems. * 2 -- Use the CSRI malloc package in debug mode. --- 46,54 ---- * system, you can choose to use one of the mallocs we provide instead of * your operating system's malloc. Set the value of MALLOC_PACKAGE * to one of these values: ! * 0 -- Use my system's malloc. Required for Win32 systems. * FreeBSD 2.2 and later seems to work best with system malloc. + * Otherwise, use only as a last resort. * 1 -- Use the CSRI malloc package in normal mode. * Recommended for most operating systems. * 2 -- Use the CSRI malloc package in debug mode. *************** *** 56,63 **** * 4 -- Use the Satoria malloc package in debug mode. * 5 -- Use the GNU malloc (gmalloc) package. Doesn't work on * Alpha processors or FreeBSD systems ! * 6 -- Use Nick Gammon's malloc wrappers for Win32. Required for Win32, ! * don't use on any other system. */ #define MALLOC_PACKAGE 1 --- 57,63 ---- * 4 -- Use the Satoria malloc package in debug mode. * 5 -- Use the GNU malloc (gmalloc) package. Doesn't work on * Alpha processors or FreeBSD systems ! * 6 -- Same as 0, kept for compatibility. */ #define MALLOC_PACKAGE 1 Index: hdrs/mymalloc.h *** hdrs/mymalloc.h.orig Tue, 14 Apr 1998 14:28:36 -0500 dunemush (pennmush/e/16_mymalloc.h 1.3 640) 0.24 --- hdrs/mymalloc.h Tue, 21 Apr 1998 15:01:49 -0500 dunemush (pennmush/e/16_mymalloc.h 1.3 640) 0.24(w) *************** *** 5,34 **** #ifndef _MYMALLOC_H #define _MYMALLOC_H - #ifdef I_MALLOC - #include <malloc.h> - #endif - - #include "options.h" - #ifdef WIN32 #undef malloc #undef calloc #undef realloc #undef free ! #define malloc(arg) Win32_malloc (arg) ! #define calloc(arg1, arg2) Win32_calloc (arg1, arg2) ! #define realloc(arg1, arg2) Win32_realloc (arg1, arg2) ! #define free(arg) Win32_free (arg) ! void *Win32_malloc(unsigned int size); ! void *Win32_calloc(unsigned int num, unsigned int size); ! void *Win32_realloc(void *memblock, unsigned int size); ! void Win32_free(void *memblock); ! void Win32_return_memory_used(long *mallocs, ! long *frees, ! long *allocated, ! long *freed); ! #endif /* WIN32 */ #if (MALLOC_PACKAGE == 1) #define CSRI --- 5,22 ---- #ifndef _MYMALLOC_H #define _MYMALLOC_H #ifdef WIN32 #undef malloc #undef calloc #undef realloc #undef free ! #endif ! ! #ifdef I_MALLOC ! #include <malloc.h> ! #endif ! ! #include "options.h" #if (MALLOC_PACKAGE == 1) #define CSRI Index: hdrs/version.h *** hdrs/version.h.orig Tue, 14 Apr 1998 14:28:36 -0500 dunemush (pennmush/e/22_version.h 1.9 640) 0.24 --- hdrs/version.h Tue, 21 Apr 1998 15:18:50 -0500 dunemush (pennmush/e/22_version.h 1.9 640) 0.24(w) *************** *** 1,2 **** ! #define VERSION "PennMUSH version 1.7.2 patchlevel 8 [4/2/98]" ! #define SHORTVN "PennMUSH 1.7.2p8" --- 1,2 ---- ! #define VERSION "PennMUSH version 1.7.2 patchlevel 9 [4/21/98]" ! #define SHORTVN "PennMUSH 1.7.2p9" Index: src/bsd.c *** src/bsd.c.orig Tue, 14 Apr 1998 14:28:36 -0500 dunemush (pennmush/e/30_bsd.c 1.6.1.1.1.1 640) 0.24 --- src/bsd.c Wed, 22 Apr 1998 11:53:23 -0500 dunemush (pennmush/e/30_bsd.c 1.6.1.1.1.1 640) 0.24(w) *************** *** 16,21 **** --- 16,22 ---- #include <sys/types.h> #endif #ifdef WIN32 + #define FD_SETSIZE 256 #include <winsock.h> #include <io.h> #undef OPAQUE /* Clashes with flags.h */ Index: src/ident.c *** src/ident.c.orig Mon, 23 Feb 1998 14:31:54 -0600 dunemush (pennmush/f/8_ident.c 1.3 640) 0.24 --- src/ident.c Wed, 22 Apr 1998 11:53:32 -0500 dunemush (pennmush/f/8_ident.c 1.3 640) 0.24(w) *************** *** 39,44 **** --- 39,45 ---- #endif #endif #ifdef WIN32 + #define FD_SETSIZE 256 #include <winsock.h> #include <io.h> #undef OPAQUE /* Clashes with flags.h */ Index: src/info_slave.c *** src/info_slave.c.orig Fri, 13 Feb 1998 14:32:30 -0600 dunemush (pennmush/f/9_info_slave 1.1 640) 0.24 --- src/info_slave.c Wed, 22 Apr 1998 11:53:40 -0500 dunemush (pennmush/f/9_info_slave 1.1 640) 0.24(w) *************** *** 16,21 **** --- 16,22 ---- #include <sys/types.h> #endif #ifdef WIN32 + #define FD_SETSIZE 256 #include <winsock.h> #include <io.h> #undef OPAQUE /* Clashes with flags.h */ Index: src/mymalloc.c *** src/mymalloc.c.orig Tue, 14 Apr 1998 14:28:36 -0500 dunemush (pennmush/f/20_mymalloc.c 1.3 640) 0.24 --- src/mymalloc.c Tue, 21 Apr 1998 15:02:25 -0500 dunemush (pennmush/f/20_mymalloc.c 1.3 640) 0.24(w) *************** *** 20,25 **** #if (MALLOC_PACKAGE == 5) #include "gmalloc.c" #endif - #if (MALLOC_PACKAGE == 6) - #include "nmalloc.c" - #endif --- 20,22 ---- Index: src/rwho.c *** src/rwho.c.orig Thu, 19 Mar 1998 12:11:46 -0600 dunemush (pennmush/f/30_rwho.c 1.4 640) 0.24 --- src/rwho.c Wed, 22 Apr 1998 11:53:45 -0500 dunemush (pennmush/f/30_rwho.c 1.4 640) 0.24(w) *************** *** 14,19 **** --- 14,20 ---- #include <fcntl.h> #ifdef WIN32 #define NO_HUGE_RESOLVER_CODE + #define FD_SETSIZE 256 #include <winsock.h> #include <io.h> #undef OPAQUE /* Clashes with flags.h */ Index: src/set.c *** src/set.c.orig Sun, 08 Mar 1998 11:37:13 -0600 dunemush (pennmush/f/32_set.c 1.2 640) 0.24 --- src/set.c Fri, 17 Apr 1998 15:26:38 -0500 dunemush (pennmush/f/32_set.c 1.2 640) 0.24(w) *************** *** 42,47 **** --- 42,48 ---- extern void charge_action _((dbref player, dbref thing, const char *awhat)); void do_name _((dbref player, const char *name, char *newname)); void do_chown _((dbref player, const char *name, const char *newobj)); + static int chown_ok _((dbref player, dbref thing, dbref newowner)); void chown_object _((dbref player, dbref thing, dbref newowner)); void do_chzone _((dbref player, const char *name, const char *newobj)); void do_attrib_flags _((dbref player, const char *obj, const char *atrname, const char *flag)); *************** *** 172,178 **** const char *newobj; { dbref thing; ! dbref owner = NOTHING; char *sp; long match_flags = MAT_POSSESSION | MAT_HERE | MAT_EXIT; --- 173,179 ---- const char *newobj; { dbref thing; ! dbref newowner = NOTHING; char *sp; long match_flags = MAT_POSSESSION | MAT_HERE | MAT_EXIT; *************** *** 192,200 **** return; if (!*newobj || !strcasecmp(newobj, "me")) { ! owner = player; } else { ! if ((owner = lookup_player(newobj)) == NOTHING) { notify(player, "I couldn't find that player."); return; } --- 193,201 ---- return; if (!*newobj || !strcasecmp(newobj, "me")) { ! newowner = player; } else { ! if ((newowner = lookup_player(newobj)) == NOTHING) { notify(player, "I couldn't find that player."); return; } *************** *** 204,239 **** notify(player, "Players always own themselves."); return; } ! /* in order to @chown an object, must fit one of the following: ! ! * 1. player is a wizard ! * 2. player owns the thing or controls the owner of the thing ! * 3. thing is CHOWN_OK, and the player is holding the object. ! * ! * The player must also control the person who is receiving ! * ownership of the object. ! * ! * There is another possibility: chowning to a Zone Master. In ! * this case the player still has to own the thing or have it ! * CHOWN_OK, but only needs to pass the enter (control) lock of ! * the Zone Master. This is automatically covered by the controls ! * check, though. We do have to check for getting stuff out of a ! * ZoneMaster's ownership, though. ! * ! */ ! ! if (!(Wizard(player) || ! ((Owns(player, thing) || ! ((Flags(thing) & CHOWN_OK) && ! ((Typeof(thing) != TYPE_THING) || (Location(thing) == player))) || ! (ZMaster(Owner(thing)) && ! eval_lock(player, Owner(thing), Zone_Lock))) && ! controls(player, owner)))) { notify(player, "Permission denied."); return; } /* chowns to the zone master don't count towards fees */ ! if (!ZMaster(owner)) { if (!can_pay_fees(player, OBJECT_DEPOSIT(Pennies(thing)))) /* not enough money or quota */ return; giveto(Owner(thing), OBJECT_DEPOSIT(Pennies(thing))); --- 205,217 ---- notify(player, "Players always own themselves."); return; } ! /* Permissions checking */ ! if (!chown_ok(player, thing, newowner)) { notify(player, "Permission denied."); return; } /* chowns to the zone master don't count towards fees */ ! if (!ZMaster(newowner)) { if (!can_pay_fees(player, OBJECT_DEPOSIT(Pennies(thing)))) /* not enough money or quota */ return; giveto(Owner(thing), OBJECT_DEPOSIT(Pennies(thing))); *************** *** 241,249 **** change_quota(Owner(thing), QUOTA_COST); #endif } ! chown_object(player, thing, owner); notify(player, "Owner changed."); } /* Actually change the ownership of something, and fix bits */ void --- 219,277 ---- change_quota(Owner(thing), QUOTA_COST); #endif } ! chown_object(player, thing, newowner); notify(player, "Owner changed."); } + + static int + chown_ok(player, thing, newowner) + dbref player; + dbref thing; + dbref newowner; + { + /* Wizards can do it all */ + if (Wizard(player)) + return 1; + + /* In order for non-wiz player to @chown thing to newowner, + * player must control newowner or newowner must be a Zone Master + * and player must pass its zone lock. + * + * In addition, one of the following must apply: + * 1. player owns thing, or + * 2. player controls Owner(thing), newowner is a zone master, + * and Owner(thing) passes newowner's zone-lock, or + * 3. thing is CHOWN_OK, and player holds thing if it's an object. + * + * The third condition is syntactic sugar to handle the situation + * where Joe owns Box, an ordinary object, and Tool, an inherit object, + * and ZMP, a Zone Master Player, is zone-locked to =tool. + * In this case, if Joe doesn't pass ZMP's lock, we don't want + * Joe to be able to @fo Tool=@chown Box=ZMP + */ + + /* Does player control newowner, or is newowner a Zone Master and player + * passes the lock? + */ + if (!(controls(player, newowner) || + (ZMaster(newowner) && eval_lock(player, newowner, Zone_Lock)))) + return 0; + + /* Target player is legitimate. Does player control the object? */ + if (Owns(player, thing)) + return 1; + + if (controls(player, Owner(thing)) && + ZMaster(newowner) && eval_lock(Owner(thing), newowner, Zone_Lock)) + return 1; + + if ((Flags(thing) & CHOWN_OK) && + ((Typeof(thing) != TYPE_THING) || (Location(thing) == player))) + return 1; + + return 0; + } + /* Actually change the ownership of something, and fix bits */ void Index: src/unparse.c *** src/unparse.c.orig Fri, 13 Feb 1998 14:32:30 -0600 dunemush (pennmush/f/41_unparse.c 1.1 640) 0.24 --- src/unparse.c Wed, 15 Apr 1998 15:30:50 -0500 dunemush (pennmush/f/41_unparse.c 1.1 640) 0.24(w) *************** *** 36,42 **** result = real_unparse(player, loc, 0); if (couldunparse) { PUSE; ! tag_wrap("A", tprintf("XCH_CMD=\"examine #%d\"", loc), real_unparse(player, loc, 0)); PEND; return pbuff; } else { --- 36,42 ---- result = real_unparse(player, loc, 0); if (couldunparse) { PUSE; ! tag_wrap("A", tprintf("XCH_CMD=\"examine #%d\"", loc), result); PEND; return pbuff; } else { *************** *** 51,60 **** { static PUEBLOBUFF; const char *result; ! result = real_unparse(player, loc, 0); if (couldunparse) { PUSE; ! tag_wrap("A", tprintf("XCH_CMD=\"examine #%d\"", loc), real_unparse(player, loc, 1)); PEND; return pbuff; } else { --- 51,60 ---- { static PUEBLOBUFF; const char *result; ! result = real_unparse(player, loc, 1); if (couldunparse) { PUSE; ! tag_wrap("A", tprintf("XCH_CMD=\"examine #%d\"", loc), result); PEND; return pbuff; } else { Index: src/wiz.c *** src/wiz.c.orig Wed, 11 Mar 1998 09:24:40 -0600 dunemush (pennmush/f/46_wiz.c 1.6 640) 0.24 --- src/wiz.c Wed, 22 Apr 1998 11:51:52 -0500 dunemush (pennmush/f/46_wiz.c 1.6 640) 0.24(w) *************** *** 2224,2230 **** Win32stats(dbref player) { /* written by NJG */ MEMORYSTATUS memstat; - long mallocs, frees, allocated, freed; double mem; #if (COMPRESSION_TYPE == 3) long items, used, total_comp, total_uncomp; --- 2224,2229 ---- *************** *** 2246,2274 **** notify(player, tprintf("%10.3f Mb available in the paging file ", mem)); mem = memstat.dwTotalPageFile / 1024.0 / 1024.0; notify(player, tprintf("%10.3f Mb total paging file size", mem)); - - notify(player, "---------- Dynamic memory allocation -------"); - - Win32_return_memory_used(&mallocs, - &frees, - &allocated, - &freed); - - mem = (allocated - freed) / 1024.0 / 1024.0; - - notify(player, tprintf("%10.3f Mb memory allocated CURRENTLY in %11ld blocks", - mem, mallocs - frees)); - - mem = allocated / 1024.0 / 1024.0; - - notify(player, tprintf("%10.3f Mb memory allocated since start in %11ld blocks", - mem, mallocs)); - - mem = freed / 1024.0 / 1024.0; - - notify(player, tprintf("%10.3f Mb memory freed since start in %11ld blocks", - mem, frees)); - #if (COMPRESSION_TYPE == 3) --- 2245,2250 ---- Index: game/txt/hlp/penncmd.hlp *** game/txt/hlp/penncmd.hlp.orig Tue, 14 Apr 1998 14:28:36 -0500 dunemush (pennmush/g/51_penncmd.hl 1.5 640) 0.24 --- game/txt/hlp/penncmd.hlp Fri, 17 Apr 1998 15:28:58 -0500 dunemush (pennmush/g/51_penncmd.hl 1.5 640) 0.24(w) *************** *** 394,403 **** @chown <object>=<player> Changes the ownership of <object> to <player>. You can chown things, ! rooms, or exits. To chown a thing, you have to be carrying it. For ! rooms or exits, you need to be standing in the room. If an object ! does not belong to you, you can only chown it if it is set ! CHOWN_OK. Examples: (for a room) @chown here=me --- 394,403 ---- @chown <object>=<player> Changes the ownership of <object> to <player>. You can chown things, ! rooms, or exits. To chown a thing, you have to be carrying it. ! If you do not own an object, you can only chown it if it is CHOWN_OK. ! If you're not a Wizard, you can only @chown objects to yourself or ! to a Zone Master whose zone-lock you pass. Examples: (for a room) @chown here=me *************** *** 405,411 **** Players can't be @chowned; they always own themselves. ! See also: CHOWN_OK & @chownall @chownall <player> [= <target_player>] --- 405,411 ---- Players can't be @chowned; they always own themselves. ! See also: CHOWN_OK, Zone Masters & @chownall @chownall <player> [= <target_player>] Index: game/txt/hlp/pennflag.hlp *** game/txt/hlp/pennflag.hlp.orig Wed, 11 Mar 1998 09:24:40 -0600 dunemush (pennmush/h/0_pennflag.h 1.2 640) 0.24 --- game/txt/hlp/pennflag.hlp Fri, 17 Apr 1998 08:37:56 -0500 dunemush (pennmush/h/0_pennflag.h 1.2 640) 0.24(w) *************** *** 201,208 **** to pinpoint exactly which evaluation is going wrong. Objects run under this flag are computationally expensive. ! Avoid leaving it set on objects. Only admin and those with the can_debug ! power can set this flag, but anyone can reset it on an object they own. During a DEBUG evaluation, the flag is temporarily reset; therefore, a test for HASFLAG(), FLAGS(), etc. in the debug execution will show --- 201,207 ---- to pinpoint exactly which evaluation is going wrong. Objects run under this flag are computationally expensive. ! Avoid leaving it set on objects. During a DEBUG evaluation, the flag is temporarily reset; therefore, a test for HASFLAG(), FLAGS(), etc. in the debug execution will show Index: game/txt/hlp/penntop.hlp *** game/txt/hlp/penntop.hlp.orig Tue, 14 Apr 1998 14:28:36 -0500 dunemush (pennmush/h/4_penntop.hl 1.3 640) 0.24 --- game/txt/hlp/penntop.hlp Tue, 21 Apr 1998 09:07:56 -0500 dunemush (pennmush/h/4_penntop.hl 1.3 640) 0.24(w) *************** *** 952,958 **** & POWERS LIST2 no_pay Doesn't need money for anything no_quota Has an unlimited quota ! open_everywhere Can @open a link from any room. pemit_all Can @pemit to HAVEN/ulocked players. poll Can use @poll command. player_create Can use @pcreate command. --- 952,958 ---- & POWERS LIST2 no_pay Doesn't need money for anything no_quota Has an unlimited quota ! open_anywhere Can @open a link from any room. pemit_all Can @pemit to HAVEN/ulocked players. poll Can use @poll command. player_create Can use @pcreate command. Index: game/txt/hlp/pennvers.hlp *** game/txt/hlp/pennvers.hlp.orig Tue, 14 Apr 1998 14:28:36 -0500 dunemush (pennmush/h/5_pennvers.h 1.9 640) 0.24 --- game/txt/hlp/pennvers.hlp Tue, 21 Apr 1998 15:19:32 -0500 dunemush (pennmush/h/5_pennvers.h 1.9 640) 0.24(w) *************** *** 30,35 **** --- 30,47 ---- 1.50p11, 1.50p12, 1.50p13, 1.50p14, 1.50p15, 1.6.0, 1.6.1, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6, 1.6.7, 1.6.8, 1.6.9, 1.6.10, 1.7.0, 1.7.1 + Version 1.7.2 patchlevel 9 April 21, 1998 + + Fixes: + * Myopic flag didn't work unless Pueblo support was on. Reported by + Rhysem@M*U*S*H. + * help debug referred to can_debug, a now-obsolete power. + Reported by Rodimus Prime @ TF2005. + * @chown to a Zone Master didn't work. The @chown code has been + rewritten to be easier to read. Report by Trispis@M*U*S*H. + * open_anywhere was mis-listed in help powers2. Report by Trispis. + * nmalloc.c is removed, and Win32 compiles should be a bit easier. + Version 1.7.2 patchlevel 8 April 2, 1998 Fixes: