This is patch01 to PennMUSH 1.8.1. After applying this patch, you will have version 1.8.1p1 To apply this patch, save it to a file in your top-level MUSH directory, and do the following: patch -p1 < 1.8.1-patch01 make clean 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. On the off chance they appear not to be, simply rm them and re-run make. Then @shutdown and restart your MUSH. - Alan/Javelin In this patch: Fixes: * Players could set the 'internal' attribute flag, which causes confusion. Report by Cooee@PDX. * Setting attribute flags by character alias did not work properly. Prereq: 1.8.1p0 *** 1_8_1.108/Patchlevel Sat, 01 Jan 2005 10:42:23 -0600 dunemush (pennmush/5_Patchlevel 1.17.1.11.1.44 600) --- 1_8_1.112(w)/Patchlevel Mon, 27 Jun 2005 14:07:24 -0500 dunemush (pennmush/5_Patchlevel 1.17.1.11.1.45 600) *************** *** 1,2 **** Do not edit this file. It is maintained by the official PennMUSH patches. ! This is PennMUSH 1.8.1p0 --- 1,2 ---- Do not edit this file. It is maintained by the official PennMUSH patches. ! This is PennMUSH 1.8.1p1 *** 1_8_1.108/src/privtab.c Sun, 16 Jan 2005 15:15:55 -0600 dunemush (pennmush/b/31_privtab.c 1.8 660) --- 1_8_1.112(w)/src/privtab.c Mon, 27 Jun 2005 16:12:26 -0500 dunemush (pennmush/b/31_privtab.c 1.9 660) *************** *** 34,39 **** --- 34,40 ---- PRIV *c; long int yes = 0; long int no = 0; + long int ltr = 0; char *p, *r; char tbuf1[BUFFER_LEN]; int not; *************** *** 51,63 **** if (!*++p) continue; } ! for (c = table; c->name; c++) { ! if (string_prefix(c->name, p)) { ! if (not) ! no |= c->bits_to_set; ! else ! yes |= c->bits_to_set; ! break; } } } --- 52,78 ---- if (!*++p) continue; } ! ltr = 0; ! if (strlen(p) == 1) { ! /* One-letter string is treated as a character if possible */ ! ltr = letter_to_privs(table, p, 0); ! if (not) ! no |= ltr; ! else ! yes |= ltr; ! } ! /* If we didn't handle a one-char string as a character, ! * or if the string is longer than one char, use prefix-matching ! */ ! if (!ltr) { ! for (c = table; c->name; c++) { ! if (string_prefix(c->name, p)) { ! if (not) ! no |= c->bits_to_set; ! else ! yes |= c->bits_to_set; ! break; ! } } } } *************** *** 85,90 **** --- 100,106 ---- char *p, *r; char tbuf1[BUFFER_LEN]; int not; + long int ltr; int words = 0; int err = 0; int found = 0; *************** *** 104,117 **** continue; } } ! for (c = table; c->name; c++) { ! if (string_prefix(c->name, p)) { ! found++; ! if (not) ! *clrprivs |= c->bits_to_set; ! else ! *setprivs |= c->bits_to_set; ! break; } } } --- 120,146 ---- continue; } } ! ltr = 0; ! if (strlen(p) == 1) { ! /* One-letter string is treated as a character if possible */ ! ltr = letter_to_privs(table, p, 0); ! if (not) ! *clrprivs |= ltr; ! else ! *setprivs |= ltr; ! } ! if (ltr) { ! found++; ! } else { ! for (c = table; c->name; c++) { ! if (string_prefix(c->name, p)) { ! found++; ! if (not) ! *clrprivs |= c->bits_to_set; ! else ! *setprivs |= c->bits_to_set; ! break; ! } } } } *** 1_8_1.108/src/predicat.c Tue, 22 Mar 2005 16:45:23 -0600 dunemush (pennmush/b/44_predicat.c 1.1.1.34.1.1.1.3.1.4.2.38.1.13.1.2.1.11 660) --- 1_8_1.112(w)/src/predicat.c Mon, 27 Jun 2005 16:12:25 -0500 dunemush (pennmush/b/44_predicat.c 1.1.1.34.1.1.1.3.1.4.2.38.1.13.1.2.1.12 660) *************** *** 47,53 **** char const *pattern, ATTR *atr, void *args); void do_grep(dbref player, char *obj, char *lookfor, int flag, int insensitive); static int pay_quota(dbref, int); ! extern PRIV attr_privs[]; /** A generic function to generate a formatted string. The * return value is a statically allocated buffer. --- 47,53 ---- char const *pattern, ATTR *atr, void *args); void do_grep(dbref player, char *obj, char *lookfor, int flag, int insensitive); static int pay_quota(dbref, int); ! extern PRIV attr_privs_view[]; /** A generic function to generate a formatted string. The * return value is a statically allocated buffer. *************** *** 1343,1349 **** notify_format(player, "%s%s [#%d%s]%s %s", ANSI_HILITE, AL_NAME(atr), Owner(AL_CREATOR(atr)), ! privs_to_letters(attr_privs, AL_FLAGS(atr)), ANSI_NORMAL, tbuf1); return found; } --- 1343,1349 ---- notify_format(player, "%s%s [#%d%s]%s %s", ANSI_HILITE, AL_NAME(atr), Owner(AL_CREATOR(atr)), ! privs_to_letters(attr_privs_view, AL_FLAGS(atr)), ANSI_NORMAL, tbuf1); return found; } *** 1_8_1.108/src/look.c Fri, 25 Feb 2005 15:33:35 -0600 dunemush (pennmush/c/4_look.c 1.21.1.2.1.9.1.1.1.1.1.49 660) --- 1_8_1.112(w)/src/look.c Mon, 27 Jun 2005 16:12:25 -0500 dunemush (pennmush/c/4_look.c 1.21.1.2.1.9.1.1.1.1.1.50 660) *************** *** 51,57 **** int skipdef, const char *prefix); static char *parent_chain(dbref player, dbref thing); ! extern PRIV attr_privs[]; static void look_exits(dbref player, dbref loc, const char *exit_name) --- 51,57 ---- int skipdef, const char *prefix); static char *parent_chain(dbref player, dbref thing); ! extern PRIV attr_privs_view[]; static void look_exits(dbref player, dbref loc, const char *exit_name) *************** *** 316,322 **** return 0; if (parent == thing || !GoodObject(parent)) parent = NOTHING; ! strcpy(fbuf, privs_to_letters(attr_privs, AL_FLAGS(atr))); if (atr_sub_branch(atr)) strcat(fbuf, "`"); if (AF_Veiled(atr)) { --- 316,322 ---- return 0; if (parent == thing || !GoodObject(parent)) parent = NOTHING; ! strcpy(fbuf, privs_to_letters(attr_privs_view, AL_FLAGS(atr))); if (atr_sub_branch(atr)) strcat(fbuf, "`"); if (AF_Veiled(atr)) { *************** *** 378,384 **** return 0; if (parent == thing || !GoodObject(parent)) parent = NOTHING; ! strcpy(fbuf, privs_to_letters(attr_privs, AL_FLAGS(atr))); if (atr_sub_branch(atr)) strcat(fbuf, "`"); r = safe_atr_value(atr); --- 378,384 ---- return 0; if (parent == thing || !GoodObject(parent)) parent = NOTHING; ! strcpy(fbuf, privs_to_letters(attr_privs_view, AL_FLAGS(atr))); if (atr_sub_branch(atr)) strcat(fbuf, "`"); r = safe_atr_value(atr); *************** *** 1478,1486 **** /* Are we different? If so, do as usual */ int npmflags = AL_FLAGS(ptr) & (~AF_PREFIXMATCH); if (AL_FLAGS(atr) != AL_FLAGS(ptr) && AL_FLAGS(atr) != npmflags) ! privs = privs_to_string(attr_privs, AL_FLAGS(atr)); } else { ! privs = privs_to_string(attr_privs, AL_FLAGS(atr)); } if (privs && *privs) notify_format(player, "@set %s/%s=%s", dh->name, AL_NAME(atr), privs); --- 1478,1486 ---- /* Are we different? If so, do as usual */ int npmflags = AL_FLAGS(ptr) & (~AF_PREFIXMATCH); if (AL_FLAGS(atr) != AL_FLAGS(ptr) && AL_FLAGS(atr) != npmflags) ! privs = privs_to_string(attr_privs_view, AL_FLAGS(atr)); } else { ! privs = privs_to_string(attr_privs_view, AL_FLAGS(atr)); } if (privs && *privs) notify_format(player, "@set %s/%s=%s", dh->name, AL_NAME(atr), privs); *** 1_8_1.108/src/fundb.c Thu, 26 May 2005 21:54:58 -0500 dunemush (pennmush/c/17_fundb.c 1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.1.1.1.1.7.1.3.1.3.1.3.1.2.1.2.1.3.2.1.2.1.2.1.1.1.1.4.1.1.1.1.1.1.1.1.1.1.1.3.1.1.2.2.2.1.1.1.1.1.1.42.1.14.1.2 660) --- 1_8_1.112(w)/src/fundb.c Mon, 27 Jun 2005 16:12:25 -0500 dunemush (pennmush/c/17_fundb.c 1.1.1.1.1.1.1.1.1.1.1.1.1.3.1.1.1.1.1.7.1.3.1.3.1.3.1.2.1.2.1.3.2.1.2.1.2.1.1.1.1.4.1.1.1.1.1.1.1.1.1.1.1.3.1.1.2.2.2.1.1.1.1.1.1.42.1.14.1.3 660) *************** *** 31,37 **** #pragma warning( disable : 4761) /* NJG: disable warning re conversion */ #endif ! extern PRIV attr_privs[]; static lock_type get_locktype(char *str); extern struct db_stat_info *get_stats(dbref owner); static int lattr_helper(dbref player, dbref thing, dbref parent, --- 31,37 ---- #pragma warning( disable : 4761) /* NJG: disable warning re conversion */ #endif ! extern PRIV attr_privs_view[]; static lock_type get_locktype(char *str); extern struct db_stat_info *get_stats(dbref owner); static int lattr_helper(dbref player, dbref thing, dbref parent, *************** *** 468,474 **** safe_str("#-1", buff, bp); return; } ! safe_str(privs_to_letters(attr_privs, AL_FLAGS(a)), buff, bp); if (atr_sub_branch(a)) safe_chr('`', buff, bp); } else { --- 468,474 ---- safe_str("#-1", buff, bp); return; } ! safe_str(privs_to_letters(attr_privs_view, AL_FLAGS(a)), buff, bp); if (atr_sub_branch(a)) safe_chr('`', buff, bp); } else { *************** *** 501,507 **** safe_str("#-1", buff, bp); return; } ! safe_str(privs_to_string(attr_privs, AL_FLAGS(a)), buff, bp); } else { /* Object flags, visible to all */ safe_str(bits_to_string("FLAG", Flags(thing), executor, thing), buff, bp); --- 501,507 ---- safe_str("#-1", buff, bp); return; } ! safe_str(privs_to_string(attr_privs_view, AL_FLAGS(a)), buff, bp); } else { /* Object flags, visible to all */ safe_str(bits_to_string("FLAG", Flags(thing), executor, thing), buff, bp); *** 1_8_1.108/src/db.c Fri, 13 May 2005 21:13:04 -0500 dunemush (pennmush/c/25_db.c 1.26.1.1.1.1.1.6.1.1.1.30 660) --- 1_8_1.112(w)/src/db.c Mon, 27 Jun 2005 16:12:25 -0500 dunemush (pennmush/c/25_db.c 1.26.1.1.1.1.1.6.1.1.1.31 660) *************** *** 1187,1193 **** } } ! extern PRIV attr_privs[]; /** Read an attribute list for an object from a file * \param f file pointer to read from. --- 1187,1193 ---- } } ! extern PRIV attr_privs_view[]; /** Read an attribute list for an object from a file * \param f file pointer to read from. *************** *** 1211,1217 **** strcpy(name, tmp); db_read_this_labeled_dbref(f, "owner", &owner); db_read_this_labeled_string(f, "flags", &tmp); ! flags = string_to_privs(attr_privs, tmp, 0); db_read_this_labeled_number(f, "derefs", &derefs); db_read_this_labeled_string(f, "value", &tmp); strcpy(value, tmp); --- 1211,1217 ---- strcpy(name, tmp); db_read_this_labeled_dbref(f, "owner", &owner); db_read_this_labeled_string(f, "flags", &tmp); ! flags = string_to_privs(attr_privs_view, tmp, 0); db_read_this_labeled_number(f, "derefs", &derefs); db_read_this_labeled_string(f, "value", &tmp); strcpy(value, tmp); *** 1_8_1.108/src/attrib.c Sat, 21 May 2005 22:07:43 -0500 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.1.3.1.1.1.1.1.1.3.43.1.23 660) --- 1_8_1.112(w)/src/attrib.c Mon, 27 Jun 2005 16:12:24 -0500 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.1.3.1.1.1.1.1.1.3.43.1.25 660) *************** *** 36,42 **** */ StrTree atr_names; /** Table of attribute flags. */ ! extern PRIV attr_privs[]; /** A flag to show if we're in the middle of a @wipe (this changes * behaviour for atr_clr()). Yes, this is gross and ugly, but it --- 36,43 ---- */ StrTree atr_names; /** Table of attribute flags. */ ! extern PRIV attr_privs_set[]; ! extern PRIV attr_privs_view[]; /** A flag to show if we're in the middle of a @wipe (this changes * behaviour for atr_clr()). Yes, this is gross and ugly, but it *************** *** 204,216 **** string_to_atrflag(dbref player, char const *p) { int f; ! f = string_to_privs(attr_privs, p, 0); if (!f) return -1; if (!Hasprivs(player) && (f & AF_MDARK)) return -1; if (!See_All(player) && (f & AF_WIZARD)) return -1; return f; } --- 205,218 ---- string_to_atrflag(dbref player, char const *p) { int f; ! f = string_to_privs(attr_privs_set, p, 0); if (!f) return -1; if (!Hasprivs(player) && (f & AF_MDARK)) return -1; if (!See_All(player) && (f & AF_WIZARD)) return -1; + f &= ~AF_INTERNAL; return f; } *************** *** 229,241 **** { int f; *setbits = *clrbits = 0; ! f = string_to_privsets(attr_privs, p, setbits, clrbits); if (f <= 0) return -1; if (!Hasprivs(player) && ((*setbits & AF_MDARK) || (*clrbits & AF_MDARK))) return -1; if (!See_All(player) && ((*setbits & AF_WIZARD) || (*clrbits & AF_WIZARD))) return -1; return *setbits; } --- 231,244 ---- { int f; *setbits = *clrbits = 0; ! f = string_to_privsets(attr_privs_set, p, setbits, clrbits); if (f <= 0) return -1; if (!Hasprivs(player) && ((*setbits & AF_MDARK) || (*clrbits & AF_MDARK))) return -1; if (!See_All(player) && ((*setbits & AF_WIZARD) || (*clrbits & AF_WIZARD))) return -1; + f &= ~AF_INTERNAL; return *setbits; } *************** *** 247,253 **** const char * atrflag_to_string(int mask) { ! return privs_to_string(attr_privs, mask); } /*======================================================================*/ --- 250,256 ---- const char * atrflag_to_string(int mask) { ! return privs_to_string(attr_privs_view, mask); } /*======================================================================*/ *** 1_8_1.108/src/atr_tab.c Wed, 01 Jun 2005 16:30:19 -0500 dunemush (pennmush/c/41_atr_tab.c 1.39.1.1.1.2 660) --- 1_8_1.112(w)/src/atr_tab.c Mon, 27 Jun 2005 16:12:24 -0500 dunemush (pennmush/c/41_atr_tab.c 1.39.1.1.1.4 660) *************** *** 34,41 **** /** Prefix table for standard attribute names */ PTAB ptab_attrib; ! /** Attribute flags */ ! PRIV attr_privs[] = { {"no_command", '$', AF_NOPROG, AF_NOPROG}, {"no_inherit", 'i', AF_PRIVATE, AF_PRIVATE}, {"private", 'i', AF_PRIVATE, AF_PRIVATE}, --- 34,65 ---- /** Prefix table for standard attribute names */ PTAB ptab_attrib; ! /** Attribute flags for setting */ ! PRIV attr_privs_set[] = { ! {"no_command", '$', AF_NOPROG, AF_NOPROG}, ! {"no_inherit", 'i', AF_PRIVATE, AF_PRIVATE}, ! {"private", 'i', AF_PRIVATE, AF_PRIVATE}, ! {"no_clone", 'c', AF_NOCOPY, AF_NOCOPY}, ! {"wizard", 'w', AF_WIZARD, AF_WIZARD}, ! {"visual", 'v', AF_VISUAL, AF_VISUAL}, ! {"mortal_dark", 'm', AF_MDARK, AF_MDARK}, ! {"hidden", 'm', AF_MDARK, AF_MDARK}, ! {"regexp", 'R', AF_REGEXP, AF_REGEXP}, ! {"case", 'C', AF_CASE, AF_CASE}, ! {"locked", '+', AF_LOCKED, AF_LOCKED}, ! {"safe", 'S', AF_SAFE, AF_SAFE}, ! {"prefixmatch", '\0', AF_PREFIXMATCH, AF_PREFIXMATCH}, ! {"veiled", 'V', AF_VEILED, AF_VEILED}, ! {"debug", 'b', AF_DEBUG, AF_DEBUG}, ! {"public", 'p', AF_PUBLIC, AF_PUBLIC}, ! {"nearby", 'n', AF_NEARBY, AF_NEARBY}, ! {"noname", 'N', AF_NONAME, AF_NONAME}, ! {"nospace", 's', AF_NOSPACE, AF_NOSPACE}, ! {NULL, '\0', 0, 0} ! }; ! ! /** Attribute flags for viewing */ ! PRIV attr_privs_view[] = { {"no_command", '$', AF_NOPROG, AF_NOPROG}, {"no_inherit", 'i', AF_PRIVATE, AF_PRIVATE}, {"private", 'i', AF_PRIVATE, AF_PRIVATE}, *************** *** 157,163 **** return; } if (strcasecmp(perms, "none")) { ! flags = string_to_privs(attr_privs, perms, 0); if (!flags) { notify(player, T("I don't understand those permissions.")); return; --- 181,187 ---- return; } if (strcasecmp(perms, "none")) { ! flags = string_to_privs(attr_privs_set, perms, 0); if (!flags) { notify(player, T("I don't understand those permissions.")); return; *************** *** 212,218 **** } notify_format(player, T("%s -- Attribute permissions now: %s"), name, ! privs_to_string(attr_privs, flags)); } --- 236,242 ---- } notify_format(player, T("%s -- Attribute permissions now: %s"), name, ! privs_to_string(attr_privs_view, flags)); } *************** *** 325,331 **** } notify_format(player, "Attribute: %s", AL_NAME(ap)); notify_format(player, ! " Flags: %s", privs_to_string(attr_privs, AL_FLAGS(ap))); notify_format(player, " Creator: %s", unparse_dbref(AL_CREATOR(ap))); return; } --- 349,356 ---- } notify_format(player, "Attribute: %s", AL_NAME(ap)); notify_format(player, ! " Flags: %s", privs_to_string(attr_privs_view, ! AL_FLAGS(ap))); notify_format(player, " Creator: %s", unparse_dbref(AL_CREATOR(ap))); return; } *** 1_8_1.108/hdrs/version.h Sat, 25 Jun 2005 12:47:43 -0500 dunemush (pennmush/c/47_version.h 1.32.1.2.1.7.1.9.1.1.1.17.1.50 660) --- 1_8_1.112(w)/hdrs/version.h Mon, 27 Jun 2005 16:12:26 -0500 dunemush (pennmush/c/47_version.h 1.32.1.2.1.7.1.9.1.1.1.17.1.51 660) *************** *** 1,4 **** #define VERSION "1.8.1" ! #define PATCHLEVEL "0" ! #define PATCHDATE "[06/25/2005]" ! #define NUMVERSION 1008001000 --- 1,4 ---- #define VERSION "1.8.1" ! #define PATCHLEVEL "1" ! #define PATCHDATE "[06/27/2005]" ! #define NUMVERSION 1008001001 *** 1_8_1.108/game/txt/hlp/pennvOLD.hlp Wed, 08 Jun 2005 18:16:59 -0500 dunemush (pennmush/g/30_pennvOLD.h 1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.9.1.2.1.5.1.1.1.1.1.1.1.1.1.2 660) --- 1_8_1.112(w)/game/txt/hlp/pennvOLD.hlp Mon, 27 Jun 2005 16:12:26 -0500 dunemush (pennmush/g/30_pennvOLD.h 1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1.9.1.2.1.5.1.1.1.1.1.1.1.1.1.3 660) *************** *** 4417,4423 **** For information on a specific patchlevel of one of the versions listed, type 'help p'. For example, 'help 1.7.2p3' ! 1.8.1: 0 1.8.0: 0, 1, 2, 3, 4, 5, 6 1.7.7: 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, --- 4417,4423 ---- For information on a specific patchlevel of one of the versions listed, type 'help p'. For example, 'help 1.7.2p3' ! 1.8.1: 0, 1 1.8.0: 0, 1, 2, 3, 4, 5, 6 1.7.7: 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_8_1.108/game/txt/hlp/pennv181.hlp Sat, 25 Jun 2005 12:47:43 -0500 dunemush (pennmush/h/29_pennv181.h 1.37 660) --- 1_8_1.112(w)/game/txt/hlp/pennv181.hlp Mon, 27 Jun 2005 16:12:26 -0500 dunemush (pennmush/h/29_pennv181.h 1.40 660) *************** *** 1,4 **** ! & 1.8.1p0 & changes This is a list of changes in this patchlevel which are probably of interest to players. More information about new commands and functions --- 1,4 ---- ! & 1.8.1p1 & changes This is a list of changes in this patchlevel which are probably of interest to players. More information about new commands and functions *************** *** 11,16 **** --- 11,26 ---- A list of the patchlevels associated with each release can be read in 'help patchlevels'. + Version 1.8.1 patchlevel 1 June 27, 2005 + + Fixes: + * Players could set the 'internal' attribute flag, which causes + confusion. Report by Cooee@PDX. + * Setting attribute flags by character alias did not work + properly. + + + & 1.8.1p0 Version 1.8.1 patchlevel 0 June 25, 2005 Major Changes: *** 1_8_1.108/CHANGES.181 Sat, 25 Jun 2005 12:47:43 -0500 dunemush (pennmush/h/30_CHANGES.18 1.32 600) --- 1_8_1.112(w)/CHANGES.181 Mon, 27 Jun 2005 14:07:22 -0500 dunemush (pennmush/h/30_CHANGES.18 1.35 600) *************** *** 12,17 **** --- 12,26 ---- ========================================================================== + Version 1.8.1 patchlevel 1 June 27, 2005 + + Fixes: + * Players could set the 'internal' attribute flag, which causes + confusion. Report by Cooee@PDX. + * Setting attribute flags by character alias did not work + properly. + + Version 1.8.1 patchlevel 0 June 25, 2005 Major Changes: