This is patch02 to PennMUSH 1.7.5. After applying this patch, you will have version 1.7.5p2 To apply this patch, save it to a file in your top-level MUSH directory, and do the following: patch -p1 < 1.7.5-patch02 make install If you use GNU patch 2.2, you probably want the above to be 'patch -b -p1', not just 'patch -p1'. Unix (or cygwin) users need not worry about failed hunks in src/switchinc.c, hdrs/switches.h, hdrs/cmds.h, or hdrs/funs.h. These files are automatically rebuilt on compile. Then @shutdown and restart your MUSH. - Alan/Javelin In this patch: Major changes: * Implementations for softcode functions get the lengths of their arguments passed to them, and this is taken advantage of in a number of places. [SW] Minor changes: * It's harder to get a partial dbref because of end-of-buffer truncation. [SW] * Code cleanup. In particular, safe_str() and friends are no longer macros for a safe_copy_str() or the like, because hardly anything used a different buffer length than BUFFER_LEN, and those places can be handled other ways. [SW] Fixes: * Win32 portability fixes by Noltar@Korongil and Eric Koske. * When you have two hidden connections, one idle over the inactivity limit, and the other not, @hide/off on the active connection unhides both, but you also see the Inactivity re-hide message from the other connection. Reported by Trispis. * iname() function actually added to function table so it works. Reported by K. Shirow. * @lock obj=attrib:value locks didn't work properly. Reported by Linda Antonsson. * Fixes from 1.7.4p14. Prereq: 1.7.5p1 *** 1_7_5.45/Patchlevel Mon, 03 Dec 2001 10:28:03 -0600 dunemush (pennmush/5_Patchlevel 1.17.1.2 600) --- 1_7_5.63(w)/Patchlevel Wed, 23 Jan 2002 10:11:53 -0600 dunemush (pennmush/5_Patchlevel 1.17.1.2 600) *************** *** 1,2 **** Do not edit this file. It is maintained by the official PennMUSH patches. ! This is PennMUSH 1.7.5p1 --- 1,2 ---- Do not edit this file. It is maintained by the official PennMUSH patches. ! This is PennMUSH 1.7.5p2 *** 1_7_5.45/CHANGES.174 Mon, 03 Dec 2001 10:13:02 -0600 dunemush (pennmush/8_CHANGES 1.219.1.58 600) --- 1_7_5.63(w)/CHANGES.174 Wed, 23 Jan 2002 10:12:04 -0600 dunemush (pennmush/8_CHANGES 1.219.1.66 600) *************** *** 17,22 **** --- 17,45 ---- ========================================================================== + Version 1.7.4 patchlevel 14 January 4, 2002 + + Minor Changes: + * The global function invocation limit is now 5 times the per-evaluation + function invocation limit, to provide some flexibility in cases + where you run a small number of functions that cause a larger + number of other functions to be evaluated (e.g., using tel() + to move players into rooms with function-laden descriptions). [TAP] + Fixes: + * Mortals are now restricted in which html tags they can generate + when pueblo support is enabled. Suggested by BladedThoth. + * @sitelock/name ! was improperly case-sensitive in its + matching. Reported by Linda Antonsson. + * Better invocation count checking and aborting on reaching limit. + Reported by Ashen-Shugar. [TAP] + * Beep characters are ignored when matching object listen patterns. + Suggested by Wayne@PDX. + * The end-of-dump marker is checked when reading the chat database. + Suggested by Bellemore@M*U*S*H. [SW] + * @lock obj=attrib:value locks were broken. Reported by Linda + Antonsson. + * Minor help fixes. + Version 1.7.4 patchlevel 13 November 30, 2001 Minor changes: *** 1_7_5.45/CHANGES Mon, 03 Dec 2001 10:28:03 -0600 dunemush (pennmush/g/7_CHANGES 1.12 600) --- 1_7_5.63(w)/CHANGES Wed, 23 Jan 2002 10:11:37 -0600 dunemush (pennmush/g/7_CHANGES 1.20 600) *************** *** 17,22 **** --- 17,45 ---- ========================================================================== + Version 1.7.5 patchlevel 2 January 23, 2002 + + Major changes: + * Implementations for softcode functions get the lengths of their arguments + passed to them, and this is taken advantage of in a number of places. [SW] + Minor changes: + * It's harder to get a partial dbref because of end-of-buffer truncation. [SW] + * Code cleanup. In particular, safe_str() and friends are no longer + macros for a safe_copy_str() or the like, because hardly anything + used a different buffer length than BUFFER_LEN, and those places + can be handled other ways. [SW] + Fixes: + * Win32 portability fixes by Noltar@Korongil and Eric Koske. + * When you have two hidden connections, one idle over the inactivity limit, + and the other not, @hide/off on the active connection unhides both, + but you also see the Inactivity re-hide message from the other + connection. Reported by Trispis. + * iname() function actually added to function table so it works. + Reported by K. Shirow. + * @lock obj=attrib:value locks didn't work properly. Reported by + Linda Antonsson. + * Fixes from 1.7.4p14. + Version 1.7.5 patchlevel 1 December 3, 2001 Minor Changes: *** 1_7_5.45/game/txt/hlp/pennvers.hlp Mon, 03 Dec 2001 10:28:03 -0600 dunemush (pennmush/12_pennvers.h 1.169.1.47 600) --- 1_7_5.63(w)/game/txt/hlp/pennvers.hlp Wed, 23 Jan 2002 10:13:05 -0600 dunemush (pennmush/12_pennvers.h 1.169.1.42.1.6 600) *************** *** 1,5 **** & changes ! & 1.7.5p1 This is a list of changes in this patchlevel which are probably of interest to players. More information about new commands and functions can probably be gotten via 'help '. 'help credits' --- 1,5 ---- & changes ! & 1.7.5p2 This is a list of changes in this patchlevel which are probably of interest to players. More information about new commands and functions can probably be gotten via 'help '. 'help credits' *************** *** 11,16 **** --- 11,40 ---- A list of the patchlevels associated with each release can be read in 'help patchlevels'. + Version 1.7.5 patchlevel 2 January 23, 2002 + + Major changes: + * Implementations for softcode functions get the lengths of their arguments + passed to them, and this is taken advantage of in a number of places. [SW] + Minor changes: + * It's harder to get a partial dbref because of end-of-buffer truncation. [SW] + * Code cleanup. In particular, safe_str() and friends are no longer + macros for a safe_copy_str() or the like, because hardly anything + used a different buffer length than BUFFER_LEN, and those places + can be handled other ways. [SW] + Fixes: + * Win32 portability fixes by Noltar@Korongil and Eric Koske. + * When you have two hidden connections, one idle over the inactivity limit, + and the other not, @hide/off on the active connection unhides both, + but you also see the Inactivity re-hide message from the other + connection. Reported by Trispis. + * iname() function actually added to function table so it works. + Reported by K. Shirow. + * @lock obj=attrib:value locks didn't work properly. Reported by + Linda Antonsson. + * Fixes from 1.7.4p14. + + & 1.7.5p1 Version 1.7.5 patchlevel 1 December 3, 2001 Minor Changes: *************** *** 93,98 **** --- 117,146 ---- * Indentation fixes [SW] * Fixes up to 1.7.4p12 merged in. + & 1.7.4p14 + Version 1.7.4 patchlevel 14 January 4, 2002 + + Minor Changes: + * The global function invocation limit is now 5 times the per-evaluation + function invocation limit, to provide some flexibility in cases + where you run a small number of functions that cause a larger + number of other functions to be evaluated (e.g., using tel() + to move players into rooms with function-laden descriptions). [TAP] + Fixes: + * Mortals are now restricted in which html tags they can generate + when pueblo support is enabled. Suggested by BladedThoth. + * @sitelock/name ! was improperly case-sensitive in its + matching. Reported by Linda Antonsson. + * Better invocation count checking and aborting on reaching limit. + Reported by Ashen-Shugar. [TAP] + * Beep characters are ignored when matching object listen patterns. + Suggested by Wayne@PDX. + * The end-of-dump marker is checked when reading the chat database. + Suggested by Bellemore@M*U*S*H. [SW] + * @lock obj=attrib:value locks were broken. Reported by Linda + Antonsson. + * Minor help fixes. + & 1.7.4p13 Version 1.7.4 patchlevel 13 November 30, 2001 *************** *** 5078,5085 **** For information on a specific patchlevel of one of the versions listed, type 'help p'. For example, 'help 1.7.2p3' ! 1.7.5: 0, 0, 1, 1 ! 1.7.4: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13 1.7.3: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 1.7.2: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35 --- 5126,5133 ---- For information on a specific patchlevel of one of the versions listed, type 'help p'. For example, 'help 1.7.2p3' ! 1.7.5: 0, 0, 1, 1, 2 ! 1.7.4: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 1.7.3: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 1.7.2: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35 *** 1_7_5.45/game/txt/hlp/pennpueb.hlp Tue, 04 Sep 2001 08:19:24 -0500 dunemush (pennmush/14_pennpueb.h 1.2.1.1 600) --- 1_7_5.63(w)/game/txt/hlp/pennpueb.hlp Fri, 07 Dec 2001 23:26:28 -0600 dunemush (pennmush/14_pennpueb.h 1.2.1.3 600) *************** *** 1,7 **** & PUEBLO & PUEBLO() Pueblo is a client made by Chaco (a now defunct company). ! It attempts to MIX HTML with MUSH, and does a decent job at it. There are other clients (notably MUSHclient) that also offer Pueblo features. If compiled into the MUSH, PennMUSH offers support for the enhanced features of Pueblo. --- 1,7 ---- & PUEBLO & PUEBLO() Pueblo is a client made by Chaco (a now defunct company). ! It attempts to mix HTML with MUSH, and does a decent job at it. There are other clients (notably MUSHclient) that also offer Pueblo features. If compiled into the MUSH, PennMUSH offers support for the enhanced features of Pueblo. *************** *** 75,84 **** Each of these produces the HTML output: PennMUSH & HTML() Function: html() ! This will output string as a HTML Tag. Example: think [html(B)] --- 75,87 ---- Each of these produces the HTML output: PennMUSH + Mortals are restricted in the tags they may use. Most standard HTML + tags are ok; protocol-specific tags like SEND and XCH_CMD can only be + sent by Wizards. In addition, the html() function is Wizard-only. & HTML() Function: html() ! This wizard-only function will output string as a HTML Tag. Example: think [html(B)] *************** *** 86,91 **** --- 89,95 ---- Will output (in HTML): + Non-wizards should see the tag(), endtag(), and tagwrap() functions. & TAG() Function: tag(,[param1[,param2...]]) *** 1_7_5.45/game/txt/hlp/pennfunc.hlp Tue, 20 Nov 2001 17:08:09 -0600 dunemush (pennmush/16_pennfunc.h 1.2.1.50.1.1.1.1.1.2.1.7.1.8.1.1.1.1.1.4 600) --- 1_7_5.63(w)/game/txt/hlp/pennfunc.hlp Sun, 06 Jan 2002 20:44:55 -0600 dunemush (pennmush/16_pennfunc.h 1.2.1.50.1.1.1.1.1.2.1.7.1.8.1.1.1.1.1.1.1.2 600) *************** *** 1437,1445 **** > say [map(strlen_fun, This is a test string)] > say [iter(lnum(3), ##, ,%r)] ! You say, "1 ! 2 ! 3" & ILEV() & ITEXT() & INUM() --- 1437,1445 ---- > say [map(strlen_fun, This is a test string)] > say [iter(lnum(3), ##, ,%r)] ! You say, "0 ! 1 ! 2" & ILEV() & ITEXT() & INUM() *** 1_7_5.45/src/wiz.c Thu, 22 Nov 2001 15:42:40 -0600 dunemush (pennmush/b/23_wiz.c 1.44.1.1.1.1.1.2.1.7.1.5 660) --- 1_7_5.63(w)/src/wiz.c Wed, 23 Jan 2002 10:24:32 -0600 dunemush (pennmush/b/23_wiz.c 1.44.1.1.1.1.1.2.1.7.1.1.1.4 660) *************** *** 1290,1297 **** for (n = 0; n < nresults; n++) { if (first) first = 0; ! else ! safe_chr(' ', buff, bp); if (safe_dbref(results[n], buff, bp)) break; } --- 1290,1297 ---- for (n = 0; n < nresults; n++) { if (first) first = 0; ! else if (safe_chr(' ', buff, bp)) ! break; if (safe_dbref(results[n], buff, bp)) break; } *************** *** 1299,1306 **** for (n = nresults - 1; n >= 0; n--) { if (first) first = 0; ! else ! safe_chr(' ', buff, bp); if (safe_dbref(results[n], buff, bp)) break; } --- 1299,1306 ---- for (n = nresults - 1; n >= 0; n--) { if (first) first = 0; ! else if (safe_chr(' ', buff, bp)) ! break; if (safe_dbref(results[n], buff, bp)) break; } *************** *** 1815,1821 **** while (fgets(buffer, 79, fp)) { if ((p = strrchr(buffer, '\n'))) *p = '\0'; ! if (strcmp(buffer, site + 1) != 0) fprintf(fptmp, "%s\n", buffer); } fclose(fp); --- 1815,1821 ---- while (fgets(buffer, 79, fp)) { if ((p = strrchr(buffer, '\n'))) *p = '\0'; ! if (strcasecmp(buffer, site + 1) != 0) fprintf(fptmp, "%s\n", buffer); } fclose(fp); *** 1_7_5.45/src/unparse.c Tue, 04 Sep 2001 09:41:50 -0500 dunemush (pennmush/b/28_unparse.c 1.16.1.3 660) --- 1_7_5.63(w)/src/unparse.c Wed, 23 Jan 2002 10:24:31 -0600 dunemush (pennmush/b/28_unparse.c 1.16.1.4 660) *************** *** 193,203 **** unparse_dbref(num) dbref num; { ! static char str[16]; char *strp; strp = str; ! safe_dbref_len(num, str, &strp, sizeof(str)); *strp = '\0'; return str; } --- 193,204 ---- unparse_dbref(num) dbref num; { ! /* Not BUFFER_LEN, but no dbref will come near this long */ ! static char str[SBUF_LEN]; char *strp; strp = str; ! safe_dbref(num, str, &strp); *strp = '\0'; return str; } *************** *** 207,217 **** unparse_integer(num) int num; { ! static char str[16]; char *strp; strp = str; ! safe_integer_len(num, str, &strp, sizeof(str)); *strp = '\0'; return str; } --- 208,218 ---- unparse_integer(num) int num; { ! static char str[SBUF_LEN]; char *strp; strp = str; ! safe_integer_sbuf(num, str, &strp); *strp = '\0'; return str; } *** 1_7_5.45/src/switchinc.c Mon, 03 Dec 2001 10:28:03 -0600 dunemush (pennmush/b/32_switchinc. 1.3.1.2.1.6.1.18.1.2.1.2.2.5.1.4.2.4.1.1.1.2.1.5.1.4 660) --- 1_7_5.63(w)/src/switchinc.c Wed, 23 Jan 2002 10:24:31 -0600 dunemush (pennmush/b/32_switchinc. 1.3.1.2.1.6.1.18.1.2.1.2.2.5.1.4.2.4.1.1.1.2.1.5.1.5 660) *************** *** 1,516 **** { ! "ACCESS", SWITCH_ACCESS ! } ! , ! { ! "ADD", SWITCH_ADD ! } ! , ! { ! "ALL", SWITCH_ALL ! } ! , ! { ! "ATTRIBS", SWITCH_ATTRIBS ! } ! , ! { ! "BAN", SWITCH_BAN ! } ! , ! { ! "BLIND", SWITCH_BLIND ! } ! , ! { ! "BRIEF", SWITCH_BRIEF ! } ! , ! { ! "CHECK", SWITCH_CHECK ! } ! , ! { ! "CHOWN", SWITCH_CHOWN ! } ! , ! { ! "CLEAR", SWITCH_CLEAR ! } ! , ! { ! "CMD", SWITCH_CMD ! } ! , ! { ! "COMMANDS", SWITCH_COMMANDS ! } ! , ! { ! "CONN", SWITCH_CONN ! } ! , ! { ! "CONNECT", SWITCH_CONNECT ! } ! , ! { ! "CONNECTED", SWITCH_CONNECTED ! } ! , ! { ! "CONTENTS", SWITCH_CONTENTS ! } ! , ! { ! "COSTS", SWITCH_COSTS ! } ! , ! { ! "COUNT", SWITCH_COUNT ! } ! , ! { ! "CREATE", SWITCH_CREATE ! } ! , ! { ! "DATABASE", SWITCH_DATABASE ! } ! , ! { ! "DB", SWITCH_DB ! } ! , ! { ! "DEBUG", SWITCH_DEBUG ! } ! , ! { ! "DECOMPILE", SWITCH_DECOMPILE ! } ! , ! { ! "DEFAULTS", SWITCH_DEFAULTS ! } ! , ! { ! "DELETE", SWITCH_DELETE ! } ! , ! { ! "DELIMIT", SWITCH_DELIMIT ! } ! , ! { ! "DESCRIBE", SWITCH_DESCRIBE ! } ! , ! { ! "DESTROY", SWITCH_DESTROY ! } ! , ! { ! "DISABLE", SWITCH_DISABLE ! } ! , ! { ! "DOWN", SWITCH_DOWN ! } ! , ! { ! "DSTATS", SWITCH_DSTATS ! } ! , ! { ! "EMIT", SWITCH_EMIT ! } ! , ! { ! "ENABLE", SWITCH_ENABLE ! } ! , ! { ! "ERR", SWITCH_ERR ! } ! , ! { ! "EXITS", SWITCH_EXITS ! } ! , ! { ! "FILE", SWITCH_FILE ! } ! , ! { ! "FIRST", SWITCH_FIRST ! } ! , ! { ! "FLAGS", SWITCH_FLAGS ! } ! , ! { ! "FOLDERS", SWITCH_FOLDERS ! } ! , ! { ! "FORWARD", SWITCH_FORWARD ! } ! , ! { ! "FSTATS", SWITCH_FSTATS ! } ! , ! { ! "FULL", SWITCH_FULL ! } ! , ! { ! "FUNCTIONS", SWITCH_FUNCTIONS ! } ! , ! { ! "FWD", SWITCH_FWD ! } ! , ! { ! "GAG", SWITCH_GAG ! } ! , ! { ! "GLOBALS", SWITCH_GLOBALS ! } ! , ! { ! "HEADER", SWITCH_HEADER ! } ! , ! { ! "HERE", SWITCH_HERE ! } ! , ! { ! "HIDE", SWITCH_HIDE ! } ! , ! { ! "ILIST", SWITCH_ILIST ! } ! , ! { ! "INVENTORY", SWITCH_INVENTORY ! } ! , ! { ! "IPRINT", SWITCH_IPRINT ! } ! , ! { ! "JOIN", SWITCH_JOIN ! } ! , ! { ! "LIST", SWITCH_LIST ! } ! , ! { ! "LOWERCASE", SWITCH_LOWERCASE ! } ! , ! { ! "ME", SWITCH_ME ! } ! , ! { ! "MEMBERS", SWITCH_MEMBERS ! } ! , ! { ! "MOD", SWITCH_MOD ! } ! , ! { ! "MORTAL", SWITCH_MORTAL ! } ! , ! { ! "MOTD", SWITCH_MOTD ! } ! , ! { ! "MUTE", SWITCH_MUTE ! } ! , ! { ! "NAME", SWITCH_NAME ! } ! , ! { ! "NO", SWITCH_NO ! } ! , ! { ! "NOEVAL", SWITCH_NOEVAL ! } ! , ! { ! "NOFLAGCOPY", SWITCH_NOFLAGCOPY ! } ! , ! { ! "NOISY", SWITCH_NOISY ! } ! , ! { ! "NOSIG", SWITCH_NOSIG ! } ! , ! { ! "NOSPACE", SWITCH_NOSPACE ! } ! , ! { ! "NOTIFY", SWITCH_NOTIFY ! } ! , ! { ! "NUKE", SWITCH_NUKE ! } ! , ! { ! "OFF", SWITCH_OFF ! } ! , ! { ! "ON", SWITCH_ON ! } ! , ! { ! "OUTSIDE", SWITCH_OUTSIDE ! } ! , ! { ! "OVERRIDE", SWITCH_OVERRIDE ! } ! , ! { ! "PANIC", SWITCH_PANIC ! } ! , ! { ! "PARANOID", SWITCH_PARANOID ! } ! , ! { ! "PLAYERS", SWITCH_PLAYERS ! } ! , ! { ! "PORT", SWITCH_PORT ! } ! , ! { ! "POSE", SWITCH_POSE ! } ! , ! { ! "PRESERVE", SWITCH_PRESERVE ! } ! , ! { ! "PRINT", SWITCH_PRINT ! } ! , ! { ! "PRIVS", SWITCH_PRIVS ! } ! , ! { ! "PURGE", SWITCH_PURGE ! } ! , ! { ! "QUICK", SWITCH_QUICK ! } ! , ! { ! "QUIET", SWITCH_QUIET ! } ! , ! { ! "READ", SWITCH_READ ! } ! , ! { ! "REBOOT", SWITCH_REBOOT ! } ! , ! { ! "REGISTER", SWITCH_REGISTER ! } ! , ! { ! "REMOVE", SWITCH_REMOVE ! } ! , ! { ! "RENAME", SWITCH_RENAME ! } ! , ! { ! "RESTORE", SWITCH_RESTORE ! } ! , ! { ! "RESTRICT", SWITCH_RESTRICT ! } ! , ! { ! "RETROACTIVE", SWITCH_RETROACTIVE ! } ! , ! { ! "ROOM", SWITCH_ROOM ! } ! , ! { ! "ROOMS", SWITCH_ROOMS ! } ! , ! { ! "ROYALTY", SWITCH_ROYALTY ! } ! , ! { ! "SEE", SWITCH_SEE ! } ! , ! { ! "SEEFLAG", SWITCH_SEEFLAG ! } ! , ! { ! "SELF", SWITCH_SELF ! } ! , ! { ! "SEND", SWITCH_SEND ! } ! , ! { ! "SET", SWITCH_SET ! } ! , ! { ! "SILENT", SWITCH_SILENT ! } ! , ! { ! "SKIPDEFAULTS", SWITCH_SKIPDEFAULTS ! } ! , ! { ! "SPEAK", SWITCH_SPEAK ! } ! , ! { ! "STATS", SWITCH_STATS ! } ! , ! { ! "SUMMARY", SWITCH_SUMMARY ! } ! , ! { ! "TABLES", SWITCH_TABLES ! } ! , ! { ! "TAG", SWITCH_TAG ! } ! , ! { ! "TELEPORT", SWITCH_TELEPORT ! } ! , ! { ! "TF", SWITCH_TF ! } ! , ! { ! "THINGS", SWITCH_THINGS ! } ! , ! { ! "TITLE", SWITCH_TITLE ! } ! , ! { ! "TRACE", SWITCH_TRACE ! } ! , ! { ! "UNCLEAR", SWITCH_UNCLEAR ! } ! , ! { ! "UNFOLDER", SWITCH_UNFOLDER ! } ! , ! { ! "UNGAG", SWITCH_UNGAG ! } ! , ! { ! "UNHIDE", SWITCH_UNHIDE ! } ! , ! { ! "UNMUTE", SWITCH_UNMUTE ! } ! , ! { ! "UNTAG", SWITCH_UNTAG ! } ! , ! { ! "UNTIL", SWITCH_UNTIL ! } ! , ! { ! "URGENT", SWITCH_URGENT ! } ! , ! { ! "USEFLAG", SWITCH_USEFLAG ! } ! , ! { ! "WHAT", SWITCH_WHAT ! } ! , ! { ! "WHO", SWITCH_WHO ! } ! , ! { ! "WIPE", SWITCH_WIPE ! } ! , ! { ! "WIZ", SWITCH_WIZ ! } ! , ! { ! "WIZARD", SWITCH_WIZARD ! } ! , ! { ! "YES", SWITCH_YES ! } ! , ! { ! "ZONE", SWITCH_ZONE ! } , --- 1,388 ---- { ! "ACCESS", SWITCH_ACCESS} ! ! , { ! "ADD", SWITCH_ADD} ! ! , { ! "ALL", SWITCH_ALL} ! ! , { ! "ATTRIBS", SWITCH_ATTRIBS} ! ! , { ! "BAN", SWITCH_BAN} ! ! , { ! "BLIND", SWITCH_BLIND} ! ! , { ! "BRIEF", SWITCH_BRIEF} ! ! , { ! "CHECK", SWITCH_CHECK} ! ! , { ! "CHOWN", SWITCH_CHOWN} ! ! , { ! "CLEAR", SWITCH_CLEAR} ! ! , { ! "CMD", SWITCH_CMD} ! ! , { ! "COMMANDS", SWITCH_COMMANDS} ! ! , { ! "CONN", SWITCH_CONN} ! ! , { ! "CONNECT", SWITCH_CONNECT} ! ! , { ! "CONNECTED", SWITCH_CONNECTED} ! ! , { ! "CONTENTS", SWITCH_CONTENTS} ! ! , { ! "COSTS", SWITCH_COSTS} ! ! , { ! "COUNT", SWITCH_COUNT} ! ! , { ! "CREATE", SWITCH_CREATE} ! ! , { ! "DATABASE", SWITCH_DATABASE} ! ! , { ! "DB", SWITCH_DB} ! ! , { ! "DEBUG", SWITCH_DEBUG} ! ! , { ! "DECOMPILE", SWITCH_DECOMPILE} ! ! , { ! "DEFAULTS", SWITCH_DEFAULTS} ! ! , { ! "DELETE", SWITCH_DELETE} ! ! , { ! "DELIMIT", SWITCH_DELIMIT} ! ! , { ! "DESCRIBE", SWITCH_DESCRIBE} ! ! , { ! "DESTROY", SWITCH_DESTROY} ! ! , { ! "DISABLE", SWITCH_DISABLE} ! ! , { ! "DOWN", SWITCH_DOWN} ! ! , { ! "DSTATS", SWITCH_DSTATS} ! ! , { ! "EMIT", SWITCH_EMIT} ! ! , { ! "ENABLE", SWITCH_ENABLE} ! ! , { ! "ERR", SWITCH_ERR} ! ! , { ! "EXITS", SWITCH_EXITS} ! ! , { ! "FILE", SWITCH_FILE} ! ! , { ! "FIRST", SWITCH_FIRST} ! ! , { ! "FLAGS", SWITCH_FLAGS} ! ! , { ! "FOLDERS", SWITCH_FOLDERS} ! ! , { ! "FORWARD", SWITCH_FORWARD} ! ! , { ! "FSTATS", SWITCH_FSTATS} ! ! , { ! "FULL", SWITCH_FULL} ! ! , { ! "FUNCTIONS", SWITCH_FUNCTIONS} ! ! , { ! "FWD", SWITCH_FWD} ! ! , { ! "GAG", SWITCH_GAG} ! ! , { ! "GLOBALS", SWITCH_GLOBALS} ! ! , { ! "HEADER", SWITCH_HEADER} ! ! , { ! "HERE", SWITCH_HERE} ! ! , { ! "HIDE", SWITCH_HIDE} ! ! , { ! "ILIST", SWITCH_ILIST} ! ! , { ! "INVENTORY", SWITCH_INVENTORY} ! ! , { ! "IPRINT", SWITCH_IPRINT} ! ! , { ! "JOIN", SWITCH_JOIN} ! ! , { ! "LIST", SWITCH_LIST} ! ! , { ! "LOWERCASE", SWITCH_LOWERCASE} ! ! , { ! "ME", SWITCH_ME} ! ! , { ! "MEMBERS", SWITCH_MEMBERS} ! ! , { ! "MOD", SWITCH_MOD} ! ! , { ! "MORTAL", SWITCH_MORTAL} ! ! , { ! "MOTD", SWITCH_MOTD} ! ! , { ! "MUTE", SWITCH_MUTE} ! ! , { ! "NAME", SWITCH_NAME} ! ! , { ! "NO", SWITCH_NO} ! ! , { ! "NOEVAL", SWITCH_NOEVAL} ! ! , { ! "NOFLAGCOPY", SWITCH_NOFLAGCOPY} ! ! , { ! "NOISY", SWITCH_NOISY} ! ! , { ! "NOSIG", SWITCH_NOSIG} ! ! , { ! "NOSPACE", SWITCH_NOSPACE} ! ! , { ! "NOTIFY", SWITCH_NOTIFY} ! ! , { ! "NUKE", SWITCH_NUKE} ! ! , { ! "OFF", SWITCH_OFF} ! ! , { ! "ON", SWITCH_ON} ! ! , { ! "OUTSIDE", SWITCH_OUTSIDE} ! ! , { ! "OVERRIDE", SWITCH_OVERRIDE} ! ! , { ! "PANIC", SWITCH_PANIC} ! ! , { ! "PARANOID", SWITCH_PARANOID} ! ! , { ! "PLAYERS", SWITCH_PLAYERS} ! ! , { ! "PORT", SWITCH_PORT} ! ! , { ! "POSE", SWITCH_POSE} ! ! , { ! "PRESERVE", SWITCH_PRESERVE} ! ! , { ! "PRINT", SWITCH_PRINT} ! ! , { ! "PRIVS", SWITCH_PRIVS} ! ! , { ! "PURGE", SWITCH_PURGE} ! ! , { ! "QUICK", SWITCH_QUICK} ! ! , { ! "QUIET", SWITCH_QUIET} ! ! , { ! "READ", SWITCH_READ} ! ! , { ! "REBOOT", SWITCH_REBOOT} ! ! , { ! "REGISTER", SWITCH_REGISTER} ! ! , { ! "REMOVE", SWITCH_REMOVE} ! ! , { ! "RENAME", SWITCH_RENAME} ! ! , { ! "RESTORE", SWITCH_RESTORE} ! ! , { ! "RESTRICT", SWITCH_RESTRICT} ! ! , { ! "RETROACTIVE", SWITCH_RETROACTIVE} ! ! , { ! "ROOM", SWITCH_ROOM} ! ! , { ! "ROOMS", SWITCH_ROOMS} ! ! , { ! "ROYALTY", SWITCH_ROYALTY} ! ! , { ! "SEE", SWITCH_SEE} ! ! , { ! "SEEFLAG", SWITCH_SEEFLAG} ! ! , { ! "SELF", SWITCH_SELF} ! ! , { ! "SEND", SWITCH_SEND} ! ! , { ! "SET", SWITCH_SET} ! ! , { ! "SILENT", SWITCH_SILENT} ! ! , { ! "SKIPDEFAULTS", SWITCH_SKIPDEFAULTS} ! ! , { ! "SPEAK", SWITCH_SPEAK} ! ! , { ! "STATS", SWITCH_STATS} ! ! , { ! "SUMMARY", SWITCH_SUMMARY} ! ! , { ! "TABLES", SWITCH_TABLES} ! ! , { ! "TAG", SWITCH_TAG} ! ! , { ! "TELEPORT", SWITCH_TELEPORT} ! ! , { ! "TF", SWITCH_TF} ! ! , { ! "THINGS", SWITCH_THINGS} ! ! , { ! "TITLE", SWITCH_TITLE} ! ! , { ! "TRACE", SWITCH_TRACE} ! ! , { ! "UNCLEAR", SWITCH_UNCLEAR} ! ! , { ! "UNFOLDER", SWITCH_UNFOLDER} ! ! , { ! "UNGAG", SWITCH_UNGAG} ! ! , { ! "UNHIDE", SWITCH_UNHIDE} ! ! , { ! "UNMUTE", SWITCH_UNMUTE} ! ! , { ! "UNTAG", SWITCH_UNTAG} ! ! , { ! "UNTIL", SWITCH_UNTIL} ! ! , { ! "URGENT", SWITCH_URGENT} ! ! , { ! "USEFLAG", SWITCH_USEFLAG} ! ! , { ! "WHAT", SWITCH_WHAT} ! ! , { ! "WHO", SWITCH_WHO} ! ! , { ! "WIPE", SWITCH_WIPE} ! ! , { ! "WIZ", SWITCH_WIZ} ! ! , { ! "WIZARD", SWITCH_WIZARD} ! ! , { ! "YES", SWITCH_YES} ! ! , { ! "ZONE", SWITCH_ZONE} ! , *** 1_7_5.45/src/strutil.c Tue, 20 Nov 2001 17:08:09 -0600 dunemush (pennmush/b/33_strutil.c 1.28.1.3.1.3.1.9 660) --- 1_7_5.63(w)/src/strutil.c Wed, 23 Jan 2002 10:24:31 -0600 dunemush (pennmush/b/33_strutil.c 1.28.1.3.1.3.1.11 660) *************** *** 24,29 **** --- 24,30 ---- #include "mymalloc.h" #include "confmagic.h" + #include "log.h" char *next_token _((char *str, char sep)); static int format_long _((long val, char *buff, char **bp, int maxlen)); *************** *** 182,188 **** * string c to the end of buff, starting at *bp. */ #define APPEND_ARGS int len, blen, clen ! #define APPEND_TO_BUF(mlen) \ /* Trivial cases */ \ if (c[0] == '\0') \ return 0; \ --- 183,189 ---- * string c to the end of buff, starting at *bp. */ #define APPEND_ARGS int len, blen, clen ! #define APPEND_TO_BUF \ /* Trivial cases */ \ if (c[0] == '\0') \ return 0; \ *************** *** 191,202 **** return safe_chr(c[0], buff, bp); \ len = strlen(c); \ blen = *bp - buff; \ ! if (blen > (mlen)) \ return len; \ ! if ((len + blen) <= (mlen)) \ clen = len; \ else \ ! clen = (mlen) - blen; \ memcpy(*bp, c, clen); \ *bp += clen; \ return len - clen --- 192,203 ---- return safe_chr(c[0], buff, bp); \ len = strlen(c); \ blen = *bp - buff; \ ! if (blen > (BUFFER_LEN - 1)) \ return len; \ ! if ((len + blen) <= (BUFFER_LEN - 1)) \ clen = len; \ else \ ! clen = (BUFFER_LEN - 1) - blen; \ memcpy(*bp, c, clen); \ *bp += clen; \ return len - clen *************** *** 223,245 **** c[BUFFER_LEN - 1] = '\0'; va_end(args); ! APPEND_TO_BUF(BUFFER_LEN - 1); } int ! safe_integer_len(int i, char *buff, char **bp, int maxlen) { /* Adds a int to a string, being careful not to overflow buffer */ ! return format_long(i, buff, bp, maxlen); } int ! safe_dbref_len(dbref d, char *buff, char **bp, int maxlen) { ! /* Adds a dbref to a string, being careful not to overflow buffer */ ! if (safe_chr('#', buff, bp)) return 1; ! return format_long(d, buff, bp, maxlen); } --- 224,261 ---- c[BUFFER_LEN - 1] = '\0'; va_end(args); ! APPEND_TO_BUF; } int ! safe_integer(int i, char *buff, char **bp) { /* Adds a int to a string, being careful not to overflow buffer */ ! return format_long(i, buff, bp, BUFFER_LEN); } int ! safe_integer_sbuf(int i, char *buff, char **bp) { ! /* Adds a int to a string, being careful not to overflow buffer */ ! return format_long(i, buff, bp, SBUF_LEN); ! } ! ! int ! safe_dbref(dbref d, char *buff, char **bp) ! { ! /* Adds a dbref to a string, being careful not to overflow buffer and ! avoiding writing partial dbrefs */ ! char *saved = *bp; ! if (safe_chr('#', buff, bp)) { ! *bp = saved; return 1; ! } ! if (format_long(d, buff, bp, BUFFER_LEN)) { ! *bp = saved; ! return 1; ! } ! return 0; } *************** *** 251,300 **** APPEND_ARGS; c = unparse_number(n); ! APPEND_TO_BUF(BUFFER_LEN - 1); } - /* safe_chr and safe_str are essentially straight out of the 2.0 code, - * but safe_chr now returns 1 on FAILURE, not success, to match safe_copy_str - */ - #ifdef SAFE_CHR_FUNCTION int ! safe_chr(char c, char *buf, char **bufp) { ! /* adds a character to a string, being careful not to overflow buffer */ ! if ((*bufp - buf >= BUFFER_LEN - 1)) ! return 1; ! *(*bufp)++ = c; ! return 0; } - #endif int ! safe_copy_str(c, buff, bp, maxlen) ! const char *c; ! char *buff; ! char **bp; ! int maxlen; { ! /* copies a string into a buffer, making sure there's no overflow. */ ! APPEND_ARGS; ! if (!c || !*c) return 0; ! APPEND_TO_BUF(maxlen); } int ! safe_ansi_len(src, copylen, buff, bp, maxlen) ! const char *src; ! int copylen; ! char *buff; ! char **bp; ! int maxlen; { char tbuf[BUFFER_LEN]; char ansibuf[BUFFER_LEN], *ap = ansibuf; --- 267,312 ---- APPEND_ARGS; c = unparse_number(n); ! APPEND_TO_BUF; } int ! safe_str(const char *c, char *buff, char **bp) { ! /* copies a string into a buffer, making sure there's no overflow. */ ! APPEND_ARGS; ! if (!c || !*c) ! return 0; ! APPEND_TO_BUF; } int ! safe_strl(const char *s, int len, char *buff, char **bp) { ! int blen, clen; ! if (!s || !*s) return 0; + if (len == 1) + return safe_chr(*s, buff, bp); ! blen = *bp - buff; ! if (blen > BUFFER_LEN - 2) ! return len; ! if ((len + blen) <= BUFFER_LEN - 2) ! clen = len; ! else ! clen = BUFFER_LEN - 2 - blen; ! memcpy(*bp, s, clen); ! *bp += clen; ! return len - clen; } int ! safe_ansi(const char *src, int copylen, char *buff, char **bp) { char tbuf[BUFFER_LEN]; char ansibuf[BUFFER_LEN], *ap = ansibuf; *************** *** 306,314 **** len = ansi_align(tbuf, len); if (len < BUFFER_LEN) tbuf[len] = '\0'; ! if (safe_copy_str(tbuf, buff, bp, maxlen)) return 1; ! return safe_copy_str(ansibuf, buff, bp, maxlen); } #undef APPEND_ARGS --- 318,326 ---- len = ansi_align(tbuf, len); if (len < BUFFER_LEN) tbuf[len] = '\0'; ! if (safe_str(tbuf, buff, bp)) return 1; ! return safe_str(ansibuf, buff, bp); } #undef APPEND_ARGS *************** *** 667,672 **** --- 679,688 ---- * This will someday take extra arguments for use with our version * of snprintf. Please try not to use it. */ + /* maxlen = total length of string. + buf[maxlen - 1] = place where \0 will go. + buf[maxlen - 2] = last visible character. + */ static int format_long(long val, char *buff, char **bp, int maxlen) { *************** *** 719,725 **** size = stack + sizeof(stack) - current; ! if (size <= (int) ((buff + maxlen - 1) - *bp)) { switch (size % 8) { case 0: while (current < stack + sizeof(stack)) { --- 735,742 ---- size = stack + sizeof(stack) - current; ! // if (size < (int) ((buff + maxlen - 1) - *bp)) { ! if (((int) (*bp - buff)) + size < maxlen - 2) { switch (size % 8) { case 0: while (current < stack + sizeof(stack)) { *************** *** 743,750 **** } else { while (current < stack + sizeof(stack)) { if (*bp - buff >= maxlen - 1) { ! size = stack + sizeof(stack) - current; ! return size; } *((*bp)++) = *(current++); } --- 760,766 ---- } else { while (current < stack + sizeof(stack)) { if (*bp - buff >= maxlen - 1) { ! return 1; } *((*bp)++) = *(current++); } *** 1_7_5.45/src/parse.c Mon, 30 Jul 2001 13:14:13 -0500 dunemush (pennmush/b/48_parse.c 1.23.1.10 660) --- 1_7_5.63(w)/src/parse.c Wed, 23 Jan 2002 10:24:31 -0600 dunemush (pennmush/b/48_parse.c 1.23.1.10.1.4 660) *************** *** 486,492 **** } break; case '%': /* Percent substitutions */ ! if (!(eflags & PE_EVALUATE)) { /* peak -- % escapes (at least) one character */ char savec; --- 486,492 ---- } break; case '%': /* Percent substitutions */ ! if (!(eflags & PE_EVALUATE) || (*bp - buff >= BUFFER_LEN - 1)) { /* peak -- % escapes (at least) one character */ char savec; *************** *** 497,502 **** --- 497,518 ---- goto exit_sequence; safe_chr(savec, buff, bp); (*str)++; + switch (savec) { + case 'Q': + case 'q': + case 'V': + case 'v': + case 'W': + case 'w': + case 'X': + case 'x': + /* These sequences escape two characters */ + savec = **str; + if (!savec) + goto exit_sequence; + safe_chr(savec, buff, bp); + (*str)++; + } break; } else { char savec, nextc; *************** *** 716,721 **** --- 732,739 ---- } else { char *sargs[10]; char **fargs; + int sarglens[10]; + int *arglens; int args_alloced; int nfargs; int j; *************** *** 724,732 **** FUN *fp; int temp_tflags; int denied; fargs = sargs; ! for (j = 0; j < 10; j++) fargs[j] = NULL; args_alloced = 10; eflags &= ~PE_FUNCTION_CHECK; /* Get the function name */ --- 742,754 ---- FUN *fp; int temp_tflags; int denied; + fargs = sargs; ! arglens = sarglens; ! for (j = 0; j < 10; j++) { fargs[j] = NULL; + arglens[j] = 0; + } args_alloced = 10; eflags &= ~PE_FUNCTION_CHECK; /* Get the function name */ *************** *** 745,751 **** PE_NOTHING, PT_PAREN, pe_info); if (**str == ')') (*str)++; ! goto exit_sequence; } safe_chr('(', buff, bp); if (**str == ' ') { --- 767,773 ---- PE_NOTHING, PT_PAREN, pe_info); if (**str == ')') (*str)++; ! break; } safe_chr('(', buff, bp); if (**str == ' ') { *************** *** 763,768 **** --- 785,815 ---- break; } *bp = startpos; + + /* Check for the invocation limit */ + if ((pe_info->fun_invocations >= FUNCTION_LIMIT) || + (global_fun_invocations >= FUNCTION_LIMIT * 5)) { + int e_len = strlen(e_invoke); + if ((buff + e_len > *bp) || strcmp(e_invoke, *bp - e_len)) + safe_str(T(e_invoke), buff, bp); + process_expression(name, &tp, str, + executor, caller, enactor, + PE_NOTHING, PT_PAREN, pe_info); + if (**str == ')') + (*str)++; + break; + } + /* Check for the recursion limit */ + if ((pe_info->fun_depth + 1 >= RECURSION_LIMIT) || + (global_fun_recursions + 1 >= RECURSION_LIMIT * 5)) { + safe_str(T("#-1 FUNCTION RECURSION LIMIT EXCEEDED"), buff, bp); + process_expression(name, &tp, str, + executor, caller, enactor, + PE_NOTHING, PT_PAREN, pe_info); + if (**str == ')') + (*str)++; + break; + } /* Get the arguments */ temp_eflags = (eflags & ~PE_FUNCTION_MANDATORY) | PE_COMPRESS_SPACES | PE_EVALUATE | PE_FUNCTION_CHECK; *************** *** 789,802 **** temp_tflags = PT_PAREN; if (nfargs >= args_alloced) { char **nargs; nargs = (char **) mush_malloc((nfargs + 10) * sizeof(char *), "process_expression.function_arglist"); ! for (j = 0; j < nfargs; j++) nargs[j] = fargs[j]; if (fargs != sargs) mush_free((Malloc_t) fargs, "process_expression.function_arglist"); fargs = nargs; args_alloced += 10; } fargs[nfargs] = (char *) mush_malloc(BUFFER_LEN, --- 836,858 ---- temp_tflags = PT_PAREN; if (nfargs >= args_alloced) { char **nargs; + int *narglens; nargs = (char **) mush_malloc((nfargs + 10) * sizeof(char *), "process_expression.function_arglist"); ! narglens = (int *) mush_malloc((nfargs + 10) * sizeof(int), ! "process_expression.function_arglens"); ! for (j = 0; j < nfargs; j++) { nargs[j] = fargs[j]; + narglens[j] = arglens[j]; + } if (fargs != sargs) mush_free((Malloc_t) fargs, "process_expression.function_arglist"); + if (arglens != sarglens) + mush_free((Malloc_t) arglens, + "process_expression.function_arglens"); fargs = nargs; + arglens = narglens; args_alloced += 10; } fargs[nfargs] = (char *) mush_malloc(BUFFER_LEN, *************** *** 806,817 **** --- 862,876 ---- executor, caller, enactor, temp_eflags, temp_tflags, pe_info); *argp = '\0'; + arglens[nfargs] = argp - fargs[nfargs]; (*str)++; nfargs++; } while ((*str)[-1] == ','); if ((*str)[-1] != ')') (*str)--; /* See if this function is enabled */ + /* Can't do this check earlier, because of possible side effects + * from the functions. Bah. */ if (denied) { if (fp->flags & FN_DISABLED) safe_str(T(e_disabled), buff, bp); *************** *** 827,832 **** --- 886,892 ---- mush_free((Malloc_t) fargs[0], "process_expression.function_argument"); fargs[0] = NULL; + arglens[0] = 0; nfargs = 0; } if ((nfargs < fp->minargs) || (nfargs > abs(fp->maxargs))) { *************** *** 852,870 **** } else { global_fun_recursions++; pe_info->fun_depth++; ! if ((pe_info->fun_invocations >= FUNCTION_LIMIT) || ! (global_fun_invocations >= FUNCTION_LIMIT)) { ! int e_len = strlen(e_invoke); ! if ((buff + e_len > *bp) || strcmp(e_invoke, *bp - e_len)) ! safe_str(T(e_invoke), buff, bp); ! } else if ((pe_info->fun_depth >= RECURSION_LIMIT) || ! (global_fun_recursions >= RECURSION_LIMIT)) { ! safe_str(T("#-1 FUNCTION RECURSION LIMIT EXCEEDED"), buff, bp); ! } else if (fp->flags & FN_BUILTIN) { global_fun_invocations++; pe_info->fun_invocations++; ! fp->where.fun(buff, bp, nfargs, fargs, executor, caller, enactor, ! fp->name, pe_info); } else { dbref thing; ATTR *attrib; --- 912,922 ---- } else { global_fun_recursions++; pe_info->fun_depth++; ! if (fp->flags & FN_BUILTIN) { global_fun_invocations++; pe_info->fun_invocations++; ! fp->where.fun(buff, bp, nfargs, fargs, arglens, executor, caller, ! enactor, fp->name, pe_info); } else { dbref thing; ATTR *attrib; *************** *** 898,903 **** --- 950,957 ---- "process_expression.function_argument"); if (fargs != sargs) mush_free((Malloc_t) fargs, "process_expression.function_arglist"); + if (arglens != sarglens) + mush_free((Malloc_t) arglens, "process_expression.function_arglens"); } break; /* Space compression */ *** 1_7_5.45/src/log.c Tue, 20 Nov 2001 17:08:09 -0600 dunemush (pennmush/c/5_log.c 1.10.1.2.1.1 660) --- 1_7_5.63(w)/src/log.c Wed, 23 Jan 2002 10:24:30 -0600 dunemush (pennmush/c/5_log.c 1.10.1.2.1.2 660) *************** *** 11,19 **** #include #ifdef I_SYS_TIME #include - #else - #include #endif #ifdef I_SYS_TYPES #include #endif --- 11,18 ---- #include #ifdef I_SYS_TIME #include #endif + #include #ifdef I_SYS_TYPES #include #endif *************** *** 130,136 **** * log types are defined in log.h */ struct tm *ttm; ! char timebuf[16]; char tbuf1[BUFFER_LEN + 50]; va_list args; FILE *f = NULL; --- 129,135 ---- * log types are defined in log.h */ struct tm *ttm; ! char timebuf[18]; char tbuf1[BUFFER_LEN + 50]; va_list args; FILE *f = NULL; *************** *** 145,156 **** va_end(args); ttm = localtime(&mudtime); ! sprintf(timebuf, "%d%d/%d%d %d%d:%d%d:%d%d", ! (((ttm->tm_mon) + 1) / 10), (((ttm->tm_mon) + 1) % 10), ! (ttm->tm_mday / 10), (ttm->tm_mday % 10), ! (ttm->tm_hour / 10), (ttm->tm_hour % 10), ! (ttm->tm_min / 10), (ttm->tm_min % 10), ! (ttm->tm_sec / 10), (ttm->tm_sec % 10)); switch (logtype) { case LT_ERR: --- 144,151 ---- va_end(args); ttm = localtime(&mudtime); ! ! strftime(timebuf, sizeof timebuf, "[%m/%d %H:%M:%S]", ttm); switch (logtype) { case LT_ERR: *************** *** 178,184 **** f = stderr; break; } ! fprintf(f, "%s %s\n", timebuf, tbuf1); fflush(f); } --- 173,179 ---- f = stderr; break; } ! fprintf(f, "%s %s\n", timebuf, tbuf1); fflush(f); } *** 1_7_5.45/src/info_slave.c Tue, 20 Nov 2001 17:08:09 -0600 dunemush (pennmush/c/7_info_slave 1.9.1.3 660) --- 1_7_5.63(w)/src/info_slave.c Wed, 23 Jan 2002 10:24:30 -0600 dunemush (pennmush/c/7_info_slave 1.9.1.4 660) *************** *** 70,76 **** #endif int ! safe_copy_str(const char *c, char *buff, char **bp, int maxlen) { /* copies a string into a buffer, making sure there's no overflow. */ APPEND_ARGS; --- 70,76 ---- #endif int ! safe_str(const char *c, char *buff, char **bp) { /* copies a string into a buffer, making sure there's no overflow. */ APPEND_ARGS; *************** *** 78,84 **** if (!c || !*c) return 0; ! APPEND_TO_BUF(maxlen); } #undef APPEND_ARGS --- 78,84 ---- if (!c || !*c) return 0; ! APPEND_TO_BUF(BUFFER_LEN); } #undef APPEND_ARGS *** 1_7_5.45/src/ident.c Tue, 20 Nov 2001 17:08:09 -0600 dunemush (pennmush/c/8_ident.c 1.19.1.4.1.4 660) --- 1_7_5.63(w)/src/ident.c Wed, 23 Jan 2002 10:24:30 -0600 dunemush (pennmush/c/8_ident.c 1.19.1.4.1.5 660) *************** *** 213,219 **** --- 213,221 ---- fd_set rs, ws, es; struct timeval to; int res; + #ifndef WIN32 int tmperrno; + #endif if ((id = (ident_t *) malloc(sizeof(*id))) == 0) return 0; *** 1_7_5.45/src/game.c Tue, 20 Nov 2001 17:08:09 -0600 dunemush (pennmush/c/10_game.c 1.50.1.8.1.1.1.1.2.1.1.1.2.1.1.4.1.1.1.4 660) --- 1_7_5.63(w)/src/game.c Wed, 23 Jan 2002 10:24:30 -0600 dunemush (pennmush/c/10_game.c 1.50.1.8.1.1.1.1.2.1.1.1.2.1.1.4.1.1.1.1.1.1.1.2 660) *************** *** 664,673 **** do_rawlog(LT_ERR, T("MUSH restarted, PID %d, at %s"), (int) getpid(), ctime(&start_time)); ! /* initialize all the hash tables: flags, functions, and attributes. */ init_flag_hashtab(); init_func_hashtab(); init_math_hashtab(); init_aname_hashtab(); init_atr_name_tree(); init_locks(); --- 664,674 ---- do_rawlog(LT_ERR, T("MUSH restarted, PID %d, at %s"), (int) getpid(), ctime(&start_time)); ! /* initialize all the hash tables */ init_flag_hashtab(); init_func_hashtab(); init_math_hashtab(); + init_tag_hashtab(); init_aname_hashtab(); init_atr_name_tree(); init_locks(); *************** *** 1910,1915 **** --- 1911,1917 ---- extern HASHTAB htab_function; extern HASHTAB htab_user_function; extern HASHTAB htab_math; + extern HASHTAB htab_tag; extern HASHTAB htab_player_list; extern HASHTAB htab_reserved_aliases; extern HASHTAB help_files; *************** *** 1929,1934 **** --- 1931,1937 ---- hash_stats(player, &htab_function, "Functions"); hash_stats(player, &htab_user_function, "@Functions"); hash_stats(player, &htab_math, "Math funs"); + hash_stats(player, &htab_tag, "HTML tags"); hash_stats(player, &htab_player_list, "Players"); hash_stats(player, &htab_reserved_aliases, "Aliases"); hash_stats(player, &help_files, "HelpFiles"); *** 1_7_5.45/src/funstr.c Thu, 25 Oct 2001 15:04:15 -0500 dunemush (pennmush/c/13_funstr.c 1.28.1.1.1.2.1.4.1.6.1.1.1.1.1.3 660) --- 1_7_5.63(w)/src/funstr.c Wed, 23 Jan 2002 10:24:30 -0600 dunemush (pennmush/c/13_funstr.c 1.28.1.1.1.2.1.4.1.6.1.1.1.1.1.2.1.1.1.1.1.4 660) *************** *** 18,23 **** --- 18,24 ---- #include "flags.h" #include "dbdefs.h" #include "mushdb.h" + #include "htab.h" #include "lock.h" #include "confmagic.h" *************** *** 25,30 **** --- 26,33 ---- #pragma warning( disable : 4761) /* NJG: disable warning re conversion */ #endif + HASHTAB htab_tag; + static int wraplen _((char *str, int maxlen)); int *************** *** 88,99 **** char *p; p = skip_leading_ansi(args[0]); if (!p) { ! safe_str(args[0], buff, bp); return; } else if (p != args[0]) { char x = *p; *p = '\0'; ! safe_str(args[0], buff, bp); *p = x; } if (*p) { --- 91,102 ---- char *p; p = skip_leading_ansi(args[0]); if (!p) { ! safe_strl(args[0], arglens[0], buff, bp); return; } else if (p != args[0]) { char x = *p; *p = '\0'; ! safe_strl(args[0], arglens[0], buff, bp); *p = x; } if (*p) { *************** *** 191,197 **** m = j; } } ! safe_str(args[m], buff, bp); } /* ARGSUSED */ --- 194,200 ---- m = j; } } ! safe_strl(args[m], arglens[m], buff, bp); } /* ARGSUSED */ *************** *** 211,217 **** m = j; } } ! safe_str(args[m], buff, bp); } /* ARGSUSED */ --- 214,220 ---- m = j; } } ! safe_strl(args[m], arglens[m], buff, bp); } /* ARGSUSED */ *************** *** 283,289 **** as = parse_ansi_string(args[0]); if (len > as->len) ! safe_str(args[0], buff, bp); else safe_ansi_string(as, as->len - len, as->len, buff, bp); free_ansi_string(as); --- 286,292 ---- as = parse_ansi_string(args[0]); if (len > as->len) ! safe_strl(args[0], arglens[0], buff, bp); else safe_ansi_string(as, as->len - len, as->len, buff, bp); free_ansi_string(as); *************** *** 311,324 **** if (pos > as->len) { /* Fast special case - concatenate args[2] to args[0] */ ! safe_str(args[0], buff, bp); ! safe_str(args[2], buff, bp); free_ansi_string(as); return; } safe_ansi_string(as, 0, pos, buff, bp); ! safe_str(args[2], buff, bp); safe_ansi_string(as, pos, as->len, buff, bp); free_ansi_string(as); --- 314,327 ---- if (pos > as->len) { /* Fast special case - concatenate args[2] to args[0] */ ! safe_strl(args[0], arglens[0], buff, bp); ! safe_strl(args[2], arglens[0], buff, bp); free_ansi_string(as); return; } safe_ansi_string(as, 0, pos, buff, bp); ! safe_strl(args[2], arglens[2], buff, bp); safe_ansi_string(as, pos, as->len, buff, bp); free_ansi_string(as); *************** *** 347,353 **** as = parse_ansi_string(args[0]); if (pos > as->len || num <= 0) { ! safe_str(args[0], buff, bp); free_ansi_string(as); return; } --- 350,356 ---- as = parse_ansi_string(args[0]); if (pos > as->len || num <= 0) { ! safe_strl(args[0], arglens[0], buff, bp); free_ansi_string(as); return; } *************** *** 410,416 **** int j; for (j = 0; j < nargs; j++) ! safe_str(args[j], buff, bp); } /* ARGSUSED */ --- 413,419 ---- int j; for (j = 0; j < nargs; j++) ! safe_strl(args[j], arglens[j], buff, bp); } /* ARGSUSED */ *************** *** 538,548 **** ap = args[0] + strlen(args[0]); while (times) { if (times & 1) { ! if (safe_str(args[0], buff, bp) != 0) break; } safe_str(args[0], args[0], &ap); *ap = '\0'; times = times >> 1; } } --- 541,552 ---- ap = args[0] + strlen(args[0]); while (times) { if (times & 1) { ! if (safe_strl(args[0], arglens[0], buff, bp) != 0) break; } safe_str(args[0], args[0], &ap); *ap = '\0'; + arglens[0] = strlen(args[0]); times = times >> 1; } } *************** *** 596,602 **** if (!delim_check(buff, bp, nargs, args, 3, &sep)) return; ! safe_str(args[0], buff, bp); for (; spaces > 0; spaces--) safe_chr(sep, buff, bp); } --- 600,606 ---- if (!delim_check(buff, bp, nargs, args, 3, &sep)) return; ! safe_strl(args[0], arglens[0], buff, bp); for (; spaces > 0; spaces--) safe_chr(sep, buff, bp); } *************** *** 622,628 **** for (; spaces > 0; spaces--) safe_chr(sep, buff, bp); ! safe_str(args[0], buff, bp); } /* ARGSUSED */ --- 626,632 ---- for (; spaces > 0; spaces--) safe_chr(sep, buff, bp); ! safe_strl(args[0], arglens[0], buff, bp); } /* ARGSUSED */ *************** *** 650,656 **** for (; lsp > 0; lsp--) safe_chr(sep, buff, bp); ! safe_str(args[0], buff, bp); for (; rsp > 0; rsp--) safe_chr(sep, buff, bp); } --- 654,660 ---- for (; lsp > 0; lsp--) safe_chr(sep, buff, bp); ! safe_strl(args[0], arglens[0], buff, bp); for (; rsp > 0; rsp--) safe_chr(sep, buff, bp); } *************** *** 668,674 **** char const *asave, *ap, *lp; char cbuf[2]; char *tptr[2]; ! char place[16]; int placenr = 0; int funccount; char *oldbp; --- 672,678 ---- char const *asave, *ap, *lp; char cbuf[2]; char *tptr[2]; ! char place[SBUF_LEN]; int placenr = 0; int funccount; char *oldbp; *************** *** 716,722 **** } oldbp = place; placenr = (tmp + 1) - lp; ! safe_integer_len(placenr, place, &oldbp, sizeof(place)); oldbp = *bp; *tmp = '\0'; --- 720,726 ---- } oldbp = place; placenr = (tmp + 1) - lp; ! safe_integer_sbuf(placenr, place, &oldbp); oldbp = *bp; *tmp = '\0'; *************** *** 736,742 **** if (*bp == oldbp && pe_info->fun_invocations == funccount) break; oldbp = place; ! safe_integer_len(++placenr, place, &oldbp, sizeof(place)); *oldbp = '\0'; oldbp = *bp; funccount = pe_info->fun_invocations; --- 740,746 ---- if (*bp == oldbp && pe_info->fun_invocations == funccount) break; oldbp = place; ! safe_integer_sbuf(++placenr, place, &oldbp); *oldbp = '\0'; oldbp = *bp; funccount = pe_info->fun_invocations; *************** *** 777,783 **** } p++; } ! safe_str(args[0], buff, bp); } /* ARGSUSED */ --- 781,787 ---- } p++; } ! safe_strl(args[0], arglens[0], buff, bp); } /* ARGSUSED */ *************** *** 861,867 **** } /* Cut off the trailing stuff, if appropriate. */ if ((trim != 1) && (*p != '\0')) { ! q = args[0] + strlen(args[0]) - 1; while ((q > p) && (*q == sep)) q--; q[1] = '\0'; --- 865,871 ---- } /* Cut off the trailing stuff, if appropriate. */ if ((trim != 1) && (*p != '\0')) { ! q = args[0] + arglens[0] - 1; while ((q > p) && (*q == sep)) q--; q[1] = '\0'; *************** *** 873,879 **** FUNCTION(fun_lit) { /* Just returns the argument, literally */ ! safe_str(args[0], buff, bp); } /* ARGSUSED */ --- 877,883 ---- FUNCTION(fun_lit) { /* Just returns the argument, literally */ ! safe_strl(args[0], arglens[0], buff, bp); } /* ARGSUSED */ *************** *** 896,902 **** /* get rid of trailing spaces first, so we don't have to worry about * them later. */ ! tp = args[0] + strlen(args[0]) - 1; while ((tp > args[0]) && (*tp == sep)) tp--; tp[1] = '\0'; --- 900,906 ---- /* get rid of trailing spaces first, so we don't have to worry about * them later. */ ! tp = args[0] + arglens[0] - 1; while ((tp > args[0]) && (*tp == sep)) tp--; tp[1] = '\0'; *************** *** 960,997 **** safe_chr(BEEP_CHAR, buff, bp); } /* ARGSUSED */ FUNCTION(fun_html) { ! safe_tag(args[0], buff, bp); } /* ARGSUSED */ FUNCTION(fun_tag) { int i; ! safe_chr(TAG_START, buff, bp); ! safe_str(args[0], buff, bp); ! for (i = 1; i < nargs; i++) { ! safe_chr(' ', buff, bp); ! safe_str(args[i], buff, bp); } - safe_chr(TAG_END, buff, bp); } /* ARGSUSED */ FUNCTION(fun_endtag) { ! safe_tag_cancel(args[0], buff, bp); } /* ARGSUSED */ FUNCTION(fun_tagwrap) { ! if (nargs == 2) ! safe_tag_wrap(args[0], NULL, args[1], buff, bp); ! else ! safe_tag_wrap(args[0], args[1], args[2], buff, bp); } #define COL_FLASH (1) --- 964,1039 ---- safe_chr(BEEP_CHAR, buff, bp); } + /* All the safe tags from HTML 4.0 */ + void + init_tag_hashtab() + { + static char dummy = 1; + int i = 0; + static const char *safetags[] = { "A", "B", "I", "U", "STRONG", "EM", + "ADDRESS", "BLOCKQUOTE", "CENTER", "DEL", "DIV", + "H1", "H2", "H3", "H4", "H5", "H6", "HR", "INS", + "P", "PRE", "DIR", "DL", "DT", "DD", "LI", "MENU", "OL", "UL", + "TABLE", "CAPTION", "COLGROUP", "COL", "THEAD", "TFOOT", + "TBODY", "TR", "TD", "TH", + "BR", "FONT", "IMG", "SPAN", "SUB", "SUP", + "ABBR", "ACRONYM", "CITE", "CODE", "DFN", "KBD", "SAMP", "VAR", + "BIG", "S", "SMALL", "STRIKE", "TT", + NULL + }; + hashinit(&htab_tag, 64, 1); + while (safetags[i]) { + hashadd(safetags[i], (void *) &dummy, &htab_tag); + i++; + } + } + /* ARGSUSED */ FUNCTION(fun_html) { ! if (!Wizard(executor)) ! safe_str(T(e_perm), buff, bp); ! else ! safe_tag(args[0], buff, bp); } /* ARGSUSED */ FUNCTION(fun_tag) { int i; ! if (!Wizard(executor) && !hash_find(&htab_tag, strupper(args[0]))) ! safe_str("#-1", buff, bp); ! else { ! safe_chr(TAG_START, buff, bp); ! safe_strl(args[0], arglens[0], buff, bp); ! for (i = 1; i < nargs; i++) { ! safe_chr(' ', buff, bp); ! safe_strl(args[i], arglens[i], buff, bp); ! } ! safe_chr(TAG_END, buff, bp); } } /* ARGSUSED */ FUNCTION(fun_endtag) { ! if (!Wizard(executor) && !hash_find(&htab_tag, strupper(args[0]))) ! safe_str("#-1", buff, bp); ! else ! safe_tag_cancel(args[0], buff, bp); } /* ARGSUSED */ FUNCTION(fun_tagwrap) { ! if (!Wizard(executor) && !hash_find(&htab_tag, strupper(args[0]))) ! safe_str("#-1", buff, bp); ! else { ! if (nargs == 2) ! safe_tag_wrap(args[0], NULL, args[1], buff, bp); ! else ! safe_tag_wrap(args[0], args[1], args[2], buff, bp); ! } } #define COL_FLASH (1) *************** *** 1225,1231 **** char postbuf[BUFFER_LEN], *postp; postp = postbuf; ! safe_str(args[0], postbuf, &postp); *postp = '\0'; for (i = 1; i < nargs - 1; i += 2) { /* Old postbuf is new prebuf */ --- 1267,1273 ---- char postbuf[BUFFER_LEN], *postp; postp = postbuf; ! safe_strl(args[0], arglens[0], postbuf, &postp); *postp = '\0'; for (i = 1; i < nargs - 1; i += 2) { /* Old postbuf is new prebuf */ *** 1_7_5.45/src/funmisc.c Mon, 13 Aug 2001 19:51:56 -0500 dunemush (pennmush/c/14_funmisc.c 1.30 660) --- 1_7_5.63(w)/src/funmisc.c Wed, 23 Jan 2002 10:24:30 -0600 dunemush (pennmush/c/14_funmisc.c 1.31 660) *************** *** 159,165 **** && renv[qindex]) { strcpy(renv[qindex], args[1]); if (!strcmp(called_as, "SETR")) ! safe_str(args[1], buff, bp); } else safe_str(T("#-1 REGISTER OUT OF RANGE"), buff, bp); } --- 159,165 ---- && renv[qindex]) { strcpy(renv[qindex], args[1]); if (!strcmp(called_as, "SETR")) ! safe_strl(args[1], arglens[1], buff, bp); } else safe_str(T("#-1 REGISTER OUT OF RANGE"), buff, bp); } *** 1_7_5.45/src/funmath.c Tue, 20 Nov 2001 17:08:09 -0600 dunemush (pennmush/c/15_funmath.c 1.40 660) --- 1_7_5.63(w)/src/funmath.c Wed, 23 Jan 2002 10:24:30 -0600 dunemush (pennmush/c/15_funmath.c 1.41 660) *************** *** 1247,1257 **** } if (parse_number(args[0]) < parse_number(args[1])) ! safe_str(args[1], buff, bp); else if (nargs == 3 && parse_number(args[0]) > parse_number(args[2])) ! safe_str(args[2], buff, bp); else ! safe_str(args[0], buff, bp); } FUNCTION(fun_band) --- 1247,1257 ---- } if (parse_number(args[0]) < parse_number(args[1])) ! safe_strl(args[1], arglens[1], buff, bp); else if (nargs == 3 && parse_number(args[0]) > parse_number(args[2])) ! safe_strl(args[2], arglens[2], buff, bp); else ! safe_strl(args[0], arglens[0], buff, bp); } FUNCTION(fun_band) *** 1_7_5.45/src/funlist.c Tue, 20 Nov 2001 17:08:09 -0600 dunemush (pennmush/c/16_funlist.c 1.3.1.1.1.5.1.2.1.1.1.1.1.4.1.2.1.2.1.19.1.2.1.1.1.2.1.5.1.6 660) --- 1_7_5.63(w)/src/funlist.c Wed, 23 Jan 2002 10:24:30 -0600 dunemush (pennmush/c/16_funlist.c 1.3.1.1.1.5.1.2.1.1.1.1.1.4.1.2.1.2.1.19.1.2.1.1.1.2.1.5.1.1.1.1.1.1.1.1 660) *************** *** 19,24 **** --- 19,25 ---- #include "lock.h" #include "confmagic.h" + #define ALPHANUM_LIST 0 #define NUMERIC_LIST 1 #define DBREF_LIST 2 *************** *** 357,362 **** --- 358,364 ---- char *cp; char *tptr[2]; char sep; + int funccount; if (!delim_check(buff, bp, nargs, args, 4, &sep)) return; *************** *** 397,402 **** --- 399,405 ---- PE_DEFAULT, PT_DEFAULT, pe_info); *rp = '\0'; strcpy(rsave, result); + funccount = pe_info->fun_invocations; /* handle the rest of the cases */ while (cp && *cp) { *************** *** 407,412 **** --- 410,419 ---- process_expression(result, &rp, &ap, thing, executor, enactor, PE_DEFAULT, PT_DEFAULT, pe_info); *rp = '\0'; + if (pe_info->fun_invocations >= FUNCTION_LIMIT && + pe_info->fun_invocations == funccount && !strcmp(rsave, result)) + break; + funccount = pe_info->fun_invocations; strcpy(rsave, result); } safe_str(rsave, buff, bp); *************** *** 1535,1544 **** { int i; ! safe_str(args[0], buff, bp); for (i = 1; i < nargs; i++) { safe_chr(' ', buff, bp); ! safe_str(args[i], buff, bp); } } --- 1542,1551 ---- { int i; ! safe_strl(args[0], arglens[0], buff, bp); for (i = 1; i < nargs; i++) { safe_chr(' ', buff, bp); ! safe_strl(args[i], arglens[i], buff, bp); } } *************** *** 1851,1857 **** p = strstr(args[0], args[1]); if (p) *p = '\0'; ! safe_str(args[0], buff, bp); } /* ARGSUSED */ --- 1858,1864 ---- p = strstr(args[0], args[1]); if (p) *p = '\0'; ! safe_strl(args[0], arglens[0], buff, bp); } /* ARGSUSED */ *** 1_7_5.45/src/function.c Tue, 20 Nov 2001 17:08:09 -0600 dunemush (pennmush/c/18_function.c 1.29.1.14.1.3.1.10 660) --- 1_7_5.63(w)/src/function.c Wed, 23 Jan 2002 10:24:30 -0600 dunemush (pennmush/c/18_function.c 1.29.1.14.1.3.1.11 660) *************** *** 263,268 **** --- 263,269 ---- {"IF", fun_if, 2, 3, FN_NOPARSE}, {"IFELSE", fun_if, 3, 3, FN_NOPARSE}, {"ILEV", fun_ilev, 0, 0, FN_REG}, + {"INAME", fun_iname, 1, 1, FN_REG}, {"INC", fun_inc, 1, 1, FN_REG}, {"INDEX", fun_index, 4, 4, FN_REG}, {"INSERT", fun_insert, 3, 4, FN_REG}, *** 1_7_5.45/src/extmail.c Tue, 25 Sep 2001 16:27:49 -0500 dunemush (pennmush/c/22_extmail.c 1.44.1.6 660) --- 1_7_5.63(w)/src/extmail.c Wed, 23 Jan 2002 10:24:30 -0600 dunemush (pennmush/c/22_extmail.c 1.44.1.8 660) *************** *** 1855,1861 **** count++; } ! OUTPUT(fprintf(fp, "***END OF DUMP***\n")); fflush(fp); if (count != mdb_top) { --- 1855,1861 ---- count++; } ! OUTPUT(fputs(EOD, fp)); fflush(fp); if (count != mdb_top) { *************** *** 1974,1985 **** if (!mail_top) { /* mail_top could be 0 from an error or actually be 0. */ if (nbuf1[0] == '0' && nbuf1[1] == '\n') { ! char eodbuf[20]; ! fgets(eodbuf, sizeof(eodbuf), fp); ! if (eodbuf && !strcmp(eodbuf, (mail_flags & MDBF_NEW_EOD) ! ? "***END OF DUMP***\n" : "*** END OF DUMP ***\n")) return 1; ! do_rawlog(LT_ERR, T("MAIL: Trailing garbage in the mail database.")); } return 0; } --- 1974,1989 ---- if (!mail_top) { /* mail_top could be 0 from an error or actually be 0. */ if (nbuf1[0] == '0' && nbuf1[1] == '\n') { ! char buff[20]; ! fgets(buff, sizeof buff, fp); ! if (!buff) ! do_rawlog(LT_ERR, ! T("MAIL: Missing end-of-dump marker in mail database.")); ! else if (strcmp(buff, (mail_flags & MDBF_NEW_EOD) ! ? "***END OF DUMP***\n" : "*** END OF DUMP ***\n") == 0) return 1; ! else ! do_rawlog(LT_ERR, T("MAIL: Trailing garbage in the mail database.")); } return 0; } *************** *** 2068,2080 **** mail_top, i); } { ! char eodbuf[20]; ! fgets(eodbuf, sizeof(eodbuf), fp); ! if (!(eodbuf && !strcmp(eodbuf, (mail_flags & MDBF_NEW_EOD) ! ? "***END OF DUMP***\n" : "*** END OF DUMP ***\n"))) { /* There's still stuff. Icky. */ do_rawlog(LT_ERR, T("MAIL: Trailing garbage in the mail database.")); - } } do_mail_debug(GOD, (char *) "fix", (char *) ""); --- 2072,2086 ---- mail_top, i); } { ! char buff[20]; ! fgets(buff, sizeof buff, fp); ! if (!buff) ! do_rawlog(LT_ERR, ! T("MAIL: Missing end-of-dump marker in mail database.")); ! else if (strcmp(buff, (mail_flags & MDBF_NEW_EOD) ! ? EOD : "*** END OF DUMP ***\n") != 0) /* There's still stuff. Icky. */ do_rawlog(LT_ERR, T("MAIL: Trailing garbage in the mail database.")); } do_mail_debug(GOD, (char *) "fix", (char *) ""); *** 1_7_5.45/src/extchat.c Mon, 03 Dec 2001 10:28:03 -0600 dunemush (pennmush/c/23_extchat.c 1.1.1.1.1.1.1.1.1.2.1.1.1.3.1.1.1.5.1.1.1.1.1.5.1.2.1.3.1.3.1.1.1.4.1.2.1.6.1.2.1.1.2.4.2.9.1.2.1.2.1.3.1.2.1.2.1.2 660) --- 1_7_5.63(w)/src/extchat.c Wed, 23 Jan 2002 10:24:29 -0600 dunemush (pennmush/c/23_extchat.c 1.1.1.1.1.1.1.1.1.2.1.1.1.3.1.1.1.5.1.1.1.1.1.5.1.2.1.3.1.3.1.1.1.4.1.2.1.6.1.2.1.1.2.4.2.9.1.2.1.2.1.3.1.2.1.2.1.1.1.2 660) *************** *** 155,160 **** --- 155,161 ---- { int i; CHAN *ch; + char buff[20]; /* How many channels? */ num_channels = getref(fp); *************** *** 176,182 **** insert_channel(&ch); } num_channels = i; ! /* There may be an END OF DUMP line, but we ignore it */ return 1; } --- 177,189 ---- insert_channel(&ch); } num_channels = i; ! ! /* Check for **END OF DUMP*** */ ! fgets(buff, sizeof buff, fp); ! if (!buff) ! do_rawlog(LT_ERR, T("CHAT: No end-of-dump marker in the chat database.")); ! else if (strcmp(buff, EOD) != 0) ! do_rawlog(LT_ERR, T("CHAT: Trailing garbage in the chat database.")); return 1; } *************** *** 585,591 **** for (ch = channels; ch; ch = ch->next) { save_channel(fp, ch); } ! OUTPUT(fputs("***END OF DUMP***\n", fp)); return 1; } --- 592,598 ---- for (ch = channels; ch; ch = ch->next) { save_channel(fp, ch); } ! OUTPUT(fputs(EOD, fp)); return 1; } *** 1_7_5.45/src/db.c Mon, 03 Dec 2001 10:28:03 -0600 dunemush (pennmush/c/25_db.c 1.31 660) --- 1_7_5.63(w)/src/db.c Wed, 23 Jan 2002 10:24:29 -0600 dunemush (pennmush/c/25_db.c 1.26.1.1.1.1 660) *************** *** 57,62 **** --- 57,64 ---- dbref errobj; + const char *EOD = "***END OF DUMP***\n"; + #ifndef DB_INITIAL_SIZE #define DB_INITIAL_SIZE 5000 #endif /* DB_INITIAL_SIZE */ *************** *** 634,640 **** OUTPUT(fprintf(f, "!%d\n", i)); db_write_object(f, i); } ! OUTPUT(fputs("***END OF DUMP***\n", f)); /* fflush(f); */ return (db_top); } --- 636,642 ---- OUTPUT(fprintf(f, "!%d\n", i)); db_write_object(f, i); } ! OUTPUT(fputs(EOD, f)); /* fflush(f); */ return (db_top); } *************** *** 792,798 **** if (i % paranoid_checkpt == 0) do_rawlog(LT_CHECK, T("\t...wrote up to object #%d\n"), i); } ! OUTPUT(fputs("***END OF DUMP***\n", f)); do_rawlog(LT_CHECK, T("\t...finished at object #%d\n"), i - 1); do_rawlog(LT_CHECK, "END OF PARANOID WRITE.\n"); return (db_top); --- 794,800 ---- if (i % paranoid_checkpt == 0) do_rawlog(LT_CHECK, T("\t...wrote up to object #%d\n"), i); } ! OUTPUT(fputs(EOD, f)); do_rawlog(LT_CHECK, T("\t...finished at object #%d\n"), i - 1); do_rawlog(LT_CHECK, "END OF PARANOID WRITE.\n"); return (db_top); *************** *** 1383,1398 **** break; case '*': ! end = getstring_noalloc(f); ! if (!strcmp(end, "***END OF DUMP***")) { ! do_rawlog(LT_ERR, T("ERROR: No end of dump %d"), i); ! return -1; ! } else { ! do_rawlog(LT_ERR, "READING: done"); ! loading_db = 0; ! fix_free_list(); ! dbck(); ! return db_top; } default: do_rawlog(LT_ERR, T("ERROR: failed object %d"), i); --- 1385,1404 ---- break; case '*': ! { ! char buff[80]; ! ungetc('*', f); ! fgets(buff, sizeof buff, f); ! if (strcmp(buff, EOD) != 0) { ! do_rawlog(LT_ERR, T("ERROR: No end of dump after object #%d"), i - 1); ! return -1; ! } else { ! do_rawlog(LT_ERR, "READING: done"); ! loading_db = 0; ! fix_free_list(); ! dbck(); ! return db_top; ! } } default: do_rawlog(LT_ERR, T("ERROR: failed object %d"), i); *** 1_7_5.45/src/bsd.c Fri, 23 Nov 2001 18:36:56 -0600 dunemush (pennmush/c/38_bsd.c 1.58.1.11.1.2.1.5.1.7.1.14.1.13.1.9.1.4.1.2.1.12.1.1.1.1.1.2.1.1.1.13.1.1.1.1.1.1.1.8 660) --- 1_7_5.63(w)/src/bsd.c Wed, 23 Jan 2002 10:24:29 -0600 dunemush (pennmush/c/38_bsd.c 1.58.1.11.1.2.1.5.1.7.1.14.1.13.1.9.1.4.1.2.1.12.1.1.1.1.1.2.1.1.1.13.1.1.1.1.1.1.1.1.1.3 660) *************** *** 19,24 **** --- 19,25 ---- #define EINTR WSAEINTR #define EWOULDBLOCK WSAEWOULDBLOCK #define MAXHOSTNAMELEN 32 + #define LC_MESSAGES 6 void shutdown_checkpoint _((void)); #else /* WIN32 */ #ifdef I_SYS_FILE *************** *** 1109,1114 **** --- 1110,1116 ---- p++; break; case '\r': + case BEEP_CHAR: break; case ESC_CHAR: while (*p && *p != 'm') *************** *** 4949,4955 **** else if (!Can_Idle(d->player)) { ! notify(d->player, T("\n*** Inactivity timeout ***\n")); do_log(LT_CONN, 0, 0, T("[%d/%s/%s] Logout by %s(#%d) "), d->descriptor, d->addr, d->ip, Name(d->player), d->player); --- 4951,4957 ---- else if (!Can_Idle(d->player)) { ! queue_string(d, T("\n*** Inactivity timeout ***\n")); do_log(LT_CONN, 0, 0, T("[%d/%s/%s] Logout by %s(#%d) "), d->descriptor, d->addr, d->ip, Name(d->player), d->player); *************** *** 4958,4966 **** } else if (Unfind(d->player)) { if ((Can_Hide(d->player)) && (!Hidden(d))) { ! notify(d->player, ! T ! ("\n*** Inactivity limit reached. You are now HIDDEN. ***\n")); d->hide = 1; } } --- 4960,4968 ---- } else if (Unfind(d->player)) { if ((Can_Hide(d->player)) && (!Hidden(d))) { ! queue_string(d, ! T ! ("\n*** Inactivity limit reached. You are now HIDDEN. ***\n")); d->hide = 1; } } *** 1_7_5.45/src/boolexp.c Fri, 23 Nov 2001 18:31:24 -0600 dunemush (pennmush/c/39_boolexp.c 1.1.1.23 660) --- 1_7_5.63(w)/src/boolexp.c Wed, 23 Jan 2002 10:24:29 -0600 dunemush (pennmush/c/39_boolexp.c 1.1.1.17.1.1 660) *************** *** 275,285 **** case BOOLEXP_OWNER: return Owner(b->thing) == Owner(player); case BOOLEXP_ATR: ! a = atr_complete_match(player, b->data.atr_lock->name, target); ! if (!a) return 0; strcpy(tbuf1, b->data.atr_lock->text); ! strcpy(tbuf2, (const char *) (a->value)); return local_wild_match(tbuf1, tbuf2); case BOOLEXP_EVAL: strcpy(tbuf1, b->data.atr_lock->text); --- 275,285 ---- case BOOLEXP_OWNER: return Owner(b->thing) == Owner(player); case BOOLEXP_ATR: ! a = atr_get(player, b->data.atr_lock->name); ! if (!a || !Can_Read_Attr(target, player, a)) return 0; strcpy(tbuf1, b->data.atr_lock->text); ! strcpy(tbuf2, uncompress(a->value)); return local_wild_match(tbuf1, tbuf2); case BOOLEXP_EVAL: strcpy(tbuf1, b->data.atr_lock->text); *** 1_7_5.45/src/attrib.c Tue, 20 Nov 2001 17:08:09 -0600 dunemush (pennmush/c/40_attrib.c 1.15.1.2.1.5.1.1.1.3.1.3.1.2.1.2.1.2.2.1.1.2.1.2.1.4 660) --- 1_7_5.63(w)/src/attrib.c Wed, 23 Jan 2002 10:24:29 -0600 dunemush (pennmush/c/40_attrib.c 1.15.1.2.1.5.1.1.1.3.1.3.1.2.1.2.1.2.2.1.1.2.1.2.1.2.1.1 660) *************** *** 514,519 **** --- 514,521 ---- return result; } + #ifdef NEVER + /* Old code that we don't use any more */ ATTR * atr_complete_match(player, atr, privs) dbref player; *************** *** 534,539 **** --- 536,542 ---- return NULL; } + #endif void atr_free(thing) *** 1_7_5.45/src/access.c Thu, 31 May 2001 11:19:20 -0500 dunemush (pennmush/c/43_access.c 1.11.1.2 660) --- 1_7_5.63(w)/src/access.c Wed, 23 Jan 2002 10:24:29 -0600 dunemush (pennmush/c/43_access.c 1.11.1.3 660) *************** *** 197,202 **** --- 197,203 ---- do_log(LT_ERR, GOD, GOD, T("No %s file found."), ACCESS_FILE); retval = 0; } else { + do_rawlog(LT_ERR, "Reading %s", ACCESS_FILE); fgets(buf, BUFFER_LEN, fp); while (!feof(fp)) { /* Strip newline */ *** 1_7_5.45/hdrs/version.h Mon, 03 Dec 2001 10:28:03 -0600 dunemush (pennmush/c/47_version.h 1.32.1.2.1.7.1.9.1.1.1.5 660) --- 1_7_5.63(w)/hdrs/version.h Wed, 23 Jan 2002 10:24:32 -0600 dunemush (pennmush/c/47_version.h 1.32.1.2.1.7.1.9.1.1.1.5 660) *************** *** 1,2 **** ! #define VERSION "PennMUSH version 1.7.5 patchlevel 1 [12/03/2001]" ! #define SHORTVN "PennMUSH 1.7.5p1" --- 1,2 ---- ! #define VERSION "PennMUSH version 1.7.5 patchlevel 2 [01/23/2002]" ! #define SHORTVN "PennMUSH 1.7.5p2" *** 1_7_5.45/hdrs/parse.h Tue, 20 Nov 2001 17:08:09 -0600 dunemush (pennmush/c/51_parse.h 1.11 660) --- 1_7_5.63(w)/hdrs/parse.h Wed, 23 Jan 2002 10:24:32 -0600 dunemush (pennmush/c/51_parse.h 1.12 660) *************** *** 82,93 **** #define FUNCTION(fun_name) \ /* ARGSUSED */ /* try to keep lint happy */ \ void fun_name (char *buff, char **bp, int nargs, char *args[], \ ! dbref executor, dbref caller, dbref enactor, \ char const *called_as, PE_Info *pe_info); \ void fun_name(char *buff __attribute__ ((__unused__)), \ char **bp __attribute__ ((__unused__)), \ int nargs __attribute__ ((__unused__)), \ char *args[] __attribute__ ((__unused__)), \ dbref executor __attribute__ ((__unused__)), \ dbref caller __attribute__ ((__unused__)), \ dbref enactor __attribute__ ((__unused__)), \ --- 82,94 ---- #define FUNCTION(fun_name) \ /* ARGSUSED */ /* try to keep lint happy */ \ void fun_name (char *buff, char **bp, int nargs, char *args[], \ ! int arglens[], dbref executor, dbref caller, dbref enactor, \ char const *called_as, PE_Info *pe_info); \ void fun_name(char *buff __attribute__ ((__unused__)), \ char **bp __attribute__ ((__unused__)), \ int nargs __attribute__ ((__unused__)), \ char *args[] __attribute__ ((__unused__)), \ + int arglens[] __attribute__ ((__unused__)), \ dbref executor __attribute__ ((__unused__)), \ dbref caller __attribute__ ((__unused__)), \ dbref enactor __attribute__ ((__unused__)), \ *** 1_7_5.45/hdrs/game.h Thu, 22 Nov 2001 15:42:40 -0600 dunemush (pennmush/d/12_game.h 1.28.1.2.1.3 660) --- 1_7_5.63(w)/hdrs/game.h Wed, 23 Jan 2002 10:24:32 -0600 dunemush (pennmush/d/12_game.h 1.28.1.2.1.1.1.1.1.2 660) *************** *** 17,22 **** --- 17,23 ---- extern void init_math_hashtab _((void)); /* funmath.c */ extern void init_aname_hashtab _((void)); /* atr_tab.c */ extern void init_flag_hashtab _((void)); /* flags.c */ + extern void init_tag_hashtab _((void)); /* funstr.c */ /* From bsd.c */ extern void fcache_init _((void)); *** 1_7_5.45/hdrs/function.h Tue, 20 Nov 2001 17:08:09 -0600 dunemush (pennmush/d/13_function.h 1.13 660) --- 1_7_5.63(w)/hdrs/function.h Wed, 23 Jan 2002 10:24:32 -0600 dunemush (pennmush/d/13_function.h 1.14 660) *************** *** 33,40 **** typedef struct fun FUN; ! typedef void (*function_func) (char *, char **, int, char *[], dbref, dbref, ! dbref, const char *, PE_Info *); union fun_call { function_func fun; --- 33,40 ---- typedef struct fun FUN; ! typedef void (*function_func) (char *, char **, int, char *[], int[], dbref, ! dbref, dbref, const char *, PE_Info *); union fun_call { function_func fun; *************** *** 85,91 **** #define FUNCTION_PROTO(fun_name) \ extern void fun_name (char *buff, char **bp, int nargs, char *args[], \ ! dbref executor, dbref caller, dbref enactor, \ char const *called_as, PE_Info *pe_info) extern void function_add(const char *name, function_func fun, int minargs, int maxargs, int ftype); --- 85,91 ---- #define FUNCTION_PROTO(fun_name) \ extern void fun_name (char *buff, char **bp, int nargs, char *args[], \ ! int arglen[], dbref executor, dbref caller, dbref enactor, \ char const *called_as, PE_Info *pe_info) extern void function_add(const char *name, function_func fun, int minargs, int maxargs, int ftype); *** 1_7_5.45/hdrs/externs.h Fri, 23 Nov 2001 18:31:24 -0600 dunemush (pennmush/d/16_externs.h 1.1.1.53.1.2.1.13 660) --- 1_7_5.63(w)/hdrs/externs.h Wed, 23 Jan 2002 10:24:32 -0600 dunemush (pennmush/d/16_externs.h 1.1.1.53.1.2.1.14 660) *************** *** 53,62 **** extern void do_doing _((dbref player, const char *message)); /* the following symbols are provided by game.c */ - - - - #define SBUF_LEN 32 #define DOING_LEN 40 extern void process_command _((dbref player, char *command, --- 53,58 ---- *************** *** 316,358 **** extern int strncasecoll _((const char *s1, const char *s2, Size_t t)); /* Append a character to the end of a BUFFER_LEN long string. ! * Two versions here - one an inline macro, the other a function. ! * #define SAFE_CHR_FUNCTION to use the function form. ! * You shouldn't use arguments with side effects in the ! * macro form */ ! #ifndef SAFE_CHR_FUNCTION #define safe_chr(x, buf, bp) \ ((*(bp) - (buf) >= BUFFER_LEN - 1) ? \ 1 : (*(*(bp))++ = (x), 0)) - #else - extern int safe_chr _((char c, char *buf, char **bufp)); - #endif /* Like sprintf */ ! extern int safe_format _((char *buff, char **bp, const char *fmt, ...)) __attribute__ ((__format__(__printf__, 3, 4))); ! /* Append an int to the end of a string */ ! #define safe_integer(i, buf, bufp) \ ! safe_integer_len((i), (buf), (bufp), BUFFER_LEN) ! /* Append an int to a string with a max length of maxlen */ ! extern int safe_integer_len _((int i, char *buff, char **bp, int maxlen)); /* Append a NVAL to a string */ ! extern int safe_number _((NVAL n, char *buff, char **bp)); ! /* Append a dbref to a string */ ! #define safe_dbref(d, buf, bufp) \ ! safe_dbref_len((d), (buf), (bufp), BUFFER_LEN) ! /* Append a dbref to a string with a max length of maxlen */ ! extern int safe_dbref_len _((dbref d, char *buff, char **bp, int maxlen)); ! /* Append a string to the end of another string */ ! extern int safe_copy_str _((const char *c, char *buff, char **bp, int maxlen)); /* Append a boolean to the end of a string */ #define safe_boolean(x, buf, bufp) \ safe_chr((x) ? '1' : '0', (buf), (bufp)) /* Append X characters to the end of a string, taking ansi and html codes into account. */ ! extern int safe_ansi_len ! _((const char *src, int copylen, char *buff, char **bp, int maxlen)); ! #define safe_ansi(src, copylen, buff, bp) \ ! safe_ansi_len((src), (copylen), (buff), (bp), BUFFER_LEN) extern char *replace_string _((const char *old, const char *newbit, const char *string)); extern char *trim_space_sep _((char *str, char sep)); --- 312,344 ---- extern int strncasecoll _((const char *s1, const char *s2, Size_t t)); /* Append a character to the end of a BUFFER_LEN long string. ! * You shouldn't use arguments with side effects with this macro. ! */ #define safe_chr(x, buf, bp) \ ((*(bp) - (buf) >= BUFFER_LEN - 1) ? \ 1 : (*(*(bp))++ = (x), 0)) /* Like sprintf */ ! extern int safe_format(char *buff, char **bp, const char *fmt, ...) __attribute__ ((__format__(__printf__, 3, 4))); ! /* Append an int to the end of a buffer */ ! extern int safe_integer(int i, char *buff, char **bp); ! /* Same, but for a SBUF_LEN buffer, not BUFFER_LEN */ ! #define SBUF_LEN 64 ! extern int safe_integer_sbuf(int i, char *buff, char **bp); /* Append a NVAL to a string */ ! extern int safe_number(NVAL n, char *buff, char **bp); ! /* Append a dbref to a buffer */ ! extern int safe_dbref(dbref d, char *buff, char **bp); ! /* Append a string to a buffer */ ! extern int safe_str(const char *s, char *buff, char **bp); ! /* Append len characters of a string to a buffer */ ! extern int safe_strl(const char *s, int len, char *buff, char **bp); /* Append a boolean to the end of a string */ #define safe_boolean(x, buf, bufp) \ safe_chr((x) ? '1' : '0', (buf), (bufp)) /* Append X characters to the end of a string, taking ansi and html codes into account. */ ! extern int safe_ansi(const char *src, int copylen, char *buff, char **bp); extern char *replace_string _((const char *old, const char *newbit, const char *string)); extern char *trim_space_sep _((char *str, char sep)); *************** *** 361,368 **** extern char *remove_word _((char *list, char *word, char sep)); extern char *next_in_list _((char **head)); - #define safe_str(s,b,p) safe_copy_str(s,b,p,BUFFER_LEN - 1) - #define safe_short_str(s,b,p) safe_copy_str(s,b,p,SBUF_LEN - 1) extern int ansi_strlen _((char *string)); extern int ansi_strnlen _((char *string, unsigned int numchars)); --- 347,352 ---- *** 1_7_5.45/hdrs/dbdefs.h Tue, 20 Nov 2001 17:08:09 -0600 dunemush (pennmush/d/18_dbdefs.h 1.1.1.1.1.1.1.1.1.1.1.2.1.2 660) --- 1_7_5.63(w)/hdrs/dbdefs.h Wed, 23 Jan 2002 10:24:32 -0600 dunemush (pennmush/d/18_dbdefs.h 1.1.1.1.1.1.1.1.1.1.1.2.2.2 660) *************** *** 310,313 **** --- 310,315 ---- #endif /* USE_MAILER */ + extern const char *EOD; + #endif /* __DBDEFS_H */ *** 1_7_5.45/Makefile.SH Tue, 13 Nov 2001 17:37:52 -0600 dunemush (pennmush/d/30_Makefile.S 1.14.1.1.1.2 700) --- 1_7_5.63(w)/Makefile.SH Thu, 13 Dec 2001 20:18:27 -0600 dunemush (pennmush/d/30_Makefile.S 1.14.1.1.1.3 700) *************** *** 210,215 **** --- 210,216 ---- gzip /tmp/dist.tar dist.tar: distclean versions + -rm -f hdrs/timestamp (cd utils; sh mkcmds.sh) makedist -c pennmush tar -cvf /tmp/dist.tar pennmush *** 1_7_5.45/src/mysocket.c Tue, 20 Nov 2001 17:08:09 -0600 dunemush (pennmush/f/0_mysocket.c 1.16.1.1.1.1.1.1.1.4.1.7 660) --- 1_7_5.63(w)/src/mysocket.c Wed, 23 Jan 2002 10:24:31 -0600 dunemush (pennmush/f/0_mysocket.c 1.16.1.1.1.1.1.1.1.4.1.9 660) *************** *** 16,21 **** --- 16,24 ---- #endif #ifdef I_NETINET_IN + #ifdef WIN32 + #undef EINTR + #endif #include #else #ifdef I_SYS_IN *************** *** 596,604 **** * SOFTWARE. */ - #if defined(LIBC_SCCS) && !defined(lint) - static char rcsid[] = "$Id$"; - #endif /* LIBC_SCCS and not lint */ /* * WARNING: Don't even consider trying to compile this on a system where --- 599,604 ---- *** 1_7_5.45/win32/config.h Tue, 20 Nov 2001 17:08:09 -0600 dunemush (pennmush/f/14_config.h 1.3 600) --- 1_7_5.63(w)/win32/config.h Sat, 08 Dec 2001 00:02:03 -0600 dunemush (pennmush/f/14_config.h 1.4 600) *************** *** 140,146 **** * This symbol, if defined, indicates that the strcasecmp() routine is * available for case-insensitive string compares. */ ! #define HAS_STRCASECMP /**/ /* HAS_STRDUP: * This symbol, if defined, indicates that the strdup routine is --- 140,146 ---- * This symbol, if defined, indicates that the strcasecmp() routine is * available for case-insensitive string compares. */ ! /* #define HAS_STRCASECMP /**/ /* HAS_STRDUP: * This symbol, if defined, indicates that the strdup routine is *************** *** 484,490 **** * This symbol, if defined, indicates that the getnameinfo() routine is * available to lookup host names in some data base or other. */ ! #define HAS_GETNAMEINFO /**/ /* HAS_GETPAGESIZE: * This symbol, if defined, indicates that the getpagesize system call --- 484,490 ---- * This symbol, if defined, indicates that the getnameinfo() routine is * available to lookup host names in some data base or other. */ ! /* #define HAS_GETNAMEINFO /**/ /* HAS_GETPAGESIZE: * This symbol, if defined, indicates that the getpagesize system call *************** *** 714,720 **** * available to printf with a pointer to an argument list. If not, you * may need to write your own, probably in terms of _doprnt(). */ ! #define HAS_VSNPRINTF /**/ /* I_ARPA_NAMESER: * This symbol, if defined, indicates to the C program that it should --- 714,720 ---- * available to printf with a pointer to an argument list. If not, you * may need to write your own, probably in terms of _doprnt(). */ ! /* #define HAS_VSNPRINTF /**/ /* I_ARPA_NAMESER: * This symbol, if defined, indicates to the C program that it should