PennMUSH Community

Changeset 405

Show
Ignore:
Timestamp:
08/12/06 06:08:07 (2 years ago)
Author:
pennmush
Message:

PennMUSH 1.7.7p3 Archival

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • 1.7.7/CHANGES

    r403 r405  
    1818 
    1919========================================================================== 
     20 
     21Version 1.7.7 patchlevel 3                      December 25, 2002 
     22 
     23Commands: 
     24  * @sitelock/check <host> tells you which rule, if any, would match. 
     25Fixes: 
     26  * The objdata hashtable routines had a serious bug that could 
     27    cause crashes. 
     28 
    2029 
    2130Version 1.7.7 patchlevel 2                      December 22, 2002 
  • 1.7.7/Patchlevel

    r403 r405  
    11Do not edit this file. It is maintained by the official PennMUSH patches. 
    2 This is PennMUSH 1.7.7p2 
     2This is PennMUSH 1.7.7p3 
  • 1.7.7/game/txt/hlp/penncmd.hlp

    r401 r405  
    26762676  @sitelock <host-pattern> = <options>[,<name>] 
    26772677  @sitelock[/<ban|register>] <host-pattern> 
     2678  @sitelock/check <host> 
    26782679  @sitelock/remove <string> 
    26792680 
     
    26842685  @sitelock without arguments lists all sites in access.cnf. 
    26852686  Rules are processed in the order listed, and the first matching 
    2686   rule is applied. 
     2687  rule is applied. @sitelock/check tells you which rule will match 
     2688  for a given <host>. 
    26872689 
    26882690  @sitelock/name adds a name to the list of banned player names. 
  • 1.7.7/game/txt/hlp/pennvers.hlp

    r403 r405  
    11& changes 
    2 & 1.7.7p2 
     2& 1.7.7p3 
    33This is a list of changes in this patchlevel which are probably of 
    44interest to players. More information about new commands and functions 
     
    1212be read in 'help patchlevels'. 
    1313 
     14Version 1.7.7 patchlevel 3                      December 25, 2002 
     15 
     16Commands: 
     17  * @sitelock/check <host> tells you which rule, if any, would match. 
     18Fixes: 
     19  * The objdata hashtable routines had a serious bug that could 
     20    cause crashes. 
     21 
     22 
     23& 1.7.7p2 
    1424Version 1.7.7 patchlevel 2                      December 22, 2002 
    1525 
     
    58755885type 'help <version>p<patchlevel>'. For example, 'help 1.7.2p3' 
    58765886 
    5877 1.7.7: 0, 1, 2 
     58871.7.7: 0, 1, 2, 3 
    587858881.7.6: 0, 1, 2, 3 
    587958891.7.5: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 
  • 1.7.7/hdrs/access.h

    r347 r405  
    11#ifndef __ACCESS_H 
    22#define __ACCESS_H 
     3 
     4/* A linked list data structure to hold the access info */ 
     5struct access { 
     6  char host[BUFFER_LEN]; 
     7  char comment[BUFFER_LEN]; 
     8  dbref who; 
     9  int can; 
     10  int cant; 
     11  struct access *next; 
     12}; 
     13 
    314 
    415/* These flags are can/can't - a site may or may not be allowed to do them */ 
     
    3445void write_access_file(void); 
    3546int site_can_access(const char *hname, int flag, dbref who); 
     47struct access *site_check_access(const char *hname, dbref who, int *rulenum); 
     48int format_access(struct access *ap, int rulenum, 
     49          dbref who 
     50          __attribute__ ((__unused__)), char *buff, char **bp); 
    3651int add_access_sitelock(dbref player, const char *host, dbref who, int can, 
    3752            int cant); 
  • 1.7.7/hdrs/extchat.h

    r403 r405  
    9292}; 
    9393 
    94 #define Chanlist(x) get_objdata(x, "CHANNELS"
    95 #define s_Chanlist(x, y) set_objdata(x, "CHANNELS", y) 
     94#define Chanlist(x) ((struct chanlist *)get_objdata(x, "CHANNELS")
     95#define s_Chanlist(x, y) set_objdata(x, "CHANNELS", (void *)y) 
    9696 
    9797/* Channel type flags and macros */ 
  • 1.7.7/hdrs/version.h

    r403 r405  
    1 #define VERSION "PennMUSH version 1.7.7 patchlevel 2 [12/22/2002]" 
    2 #define SHORTVN "PennMUSH 1.7.7p2
     1#define VERSION "PennMUSH version 1.7.7 patchlevel 3 [12/25/2002]" 
     2#define SHORTVN "PennMUSH 1.7.7p3
  • 1.7.7/src/access.c

    r399 r405  
    8282#include "confmagic.h" 
    8383 
    84 /* A linked list data structure to hold the access info */ 
    85 struct access { 
    86   char host[BUFFER_LEN]; 
    87   char comment[BUFFER_LEN]; 
    88   dbref who; 
    89   int can; 
    90   int cant; 
    91   struct access *next; 
    92 }; 
    9384 
    9485 
     
    369360} 
    370361 
     362/* Like above, but returns the details of the first-matching rule */ 
     363struct access * 
     364site_check_access(const char *hname, dbref who, int *rulenum) 
     365{ 
     366  struct access *ap; 
     367  char *p; 
     368 
     369  *rulenum = 0; 
     370  if (!hname || !*hname) 
     371    return 0; 
     372 
     373  if ((p = strchr(hname, '@'))) 
     374    p++; 
     375 
     376  for (ap = access_top; ap; ap = ap->next) { 
     377    (*rulenum)++; 
     378    if (!(ap->can & ACS_SITELOCK) 
     379    && ((ap->can & ACS_REGEXP) 
     380        ? (regexp_match_case(ap->host, hname, 0) 
     381           || (p && regexp_match_case(ap->host, p, 0))) 
     382        : (quick_wild(ap->host, hname) 
     383           || (p && quick_wild(ap->host, p)))) 
     384    && (ap->who == AMBIGUOUS || ap->who == who)) { 
     385      /* Got one */ 
     386      return ap; 
     387    } 
     388  } 
     389  return NULL; 
     390} 
     391 
     392int 
     393format_access(struct access *ap, int rulenum, 
     394          dbref who __attribute__ ((__unused__)), char *buff, char **bp) 
     395{ 
     396  if (ap) { 
     397    safe_format(buff, bp, T("Matched line %d: %s %s"), rulenum, ap->host, 
     398        (ap->can & ACS_REGEXP) ? "(regexp)" : ""); 
     399    safe_chr('\n', buff, bp); 
     400    safe_format(buff, bp, T("Comment: %s"), ap->comment); 
     401    safe_chr('\n', buff, bp); 
     402    safe_str(T("Connections allowed by: "), buff, bp); 
     403    if (ap->cant & ACS_CONNECT) 
     404      safe_str(T("No one"), buff, bp); 
     405    else if (ap->cant & ACS_ADMIN) 
     406      safe_str(T("All but admin"), buff, bp); 
     407    else if (ap->cant & ACS_WIZARD) 
     408      safe_str(T("All but wizards"), buff, bp); 
     409    else if (ap->cant & ACS_GOD) 
     410      safe_str(T("All but God"), buff, bp); 
     411    else 
     412      safe_str(T("All"), buff, bp); 
     413    safe_chr('\n', buff, bp); 
     414    if (ap->cant & ACS_GUEST) 
     415      safe_str(T("Guest connections are NOT allowed"), buff, bp); 
     416    else 
     417      safe_str(T("Guest connections are allowed"), buff, bp); 
     418    safe_chr('\n', buff, bp); 
     419    if (ap->cant & ACS_CREATE) 
     420      safe_str(T("Creation is NOT allowed"), buff, bp); 
     421    else 
     422      safe_str(T("Creation is allowed"), buff, bp); 
     423    safe_chr('\n', buff, bp); 
     424    if (ap->can & ACS_REGISTER) 
     425      safe_str(T("Email registration is allowed"), buff, bp); 
     426    if (ap->can & ACS_SUSPECT) 
     427      safe_str(T("Players connecting are set SUSPECT"), buff, bp); 
     428    if (ap->can & ACS_DENY_SILENT) 
     429      safe_str(T("Denied connections are not logged"), buff, bp); 
     430  } else { 
     431    safe_str(T("No matching access rule"), buff, bp); 
     432  } 
     433  return 0; 
     434} 
     435 
     436 
    371437/* Add an entry to the linked list after the @sitelock entry. 
    372438 * If there is no @sitelock entry, add one to the end of the list 
     
    474540  acsflag *c; 
    475541  char flaglist[BUFFER_LEN]; 
     542  int rulenum = 0; 
    476543  char *bp; 
    477544 
    478545  for (ap = access_top; ap; ap = ap->next) { 
     546    rulenum++; 
    479547    if (ap->can != ACS_SITELOCK) { 
    480548      bp = flaglist; 
     
    494562      *bp = '\0'; 
    495563      notify_format(player, 
    496             "SITE: %-20s  DBREF: %-6s FLAGS:%s", ap->host
    497             unparse_dbref(ap->who), flaglist); 
     564            "%3d SITE: %-20s  DBREF: %-6s FLAGS:%s", rulenum
     565            ap->host, unparse_dbref(ap->who), flaglist); 
    498566      notify_format(player, " COMMENT: %s", ap->comment); 
    499567    } else { 
  • 1.7.7/src/cmds.c

    r399 r405  
    819819  else if (SW_ISSET(sw, SWITCH_REMOVE)) 
    820820    do_sitelock(player, arg_left, NULL, NULL, 3); 
     821  else if (SW_ISSET(sw, SWITCH_CHECK)) 
     822    do_sitelock(player, arg_left, NULL, NULL, 4); 
    821823  else 
    822824    do_sitelock(player, arg_left, args_right[1], args_right[2], 0); 
  • 1.7.7/src/command.c

    r403 r405  
    236236  {"@SHUTDOWN", "PANIC REBOOT PARANOID", cmd_shutdown, CMD_T_ANY, WIZARD, 
    237237   0, 0}, 
    238   {"@SITELOCK", "BAN REGISTER REMOVE NAME", cmd_sitelock, 
     238  {"@SITELOCK", "BAN CHECK REGISTER REMOVE NAME", cmd_sitelock, 
    239239   CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_RS_ARGS, WIZARD, 0, 0}, 
    240240  {"@STATS", "TABLES", cmd_stats, CMD_T_ANY, 0, 0, 0}, 
  • 1.7.7/src/db.c

    r403 r405  
    13711371set_objdata(dbref thing, const char *keybase, void *data) 
    13721372{ 
     1373  hashdelete(tprintf("%s_#%d", keybase, thing), &htab_objdata); 
    13731374  if (data) { 
    13741375    if (hashadd(tprintf("%s_#%d", keybase, thing), data, &htab_objdata) < 0) 
     
    13781379      hashadd(keybase, (void *) &newkey, &htab_objdata_keys); 
    13791380    } 
    1380     return data; 
    1381   } else { 
    1382     hashdelete(tprintf("%s_#%d", keybase, thing), &htab_objdata); 
    1383     return NULL; 
    1384   } 
     1381  } 
     1382  return data; 
    13851383} 
    13861384 
  • 1.7.7/src/extchat.c

    r403 r405  
    398398  tmp->chan = *ch; 
    399399  /* If there's no channels on the list, or if the first channel is already 
    400    * alphabetically greater, user should be the first entry on the list */ 
     400   * alphabetically greater, chan should be the first entry on the list */ 
    401401  /* No channels? */ 
    402402  if (!Chanlist(who)) { 
     
    415415    free_chanlist(tmp); 
    416416  } else { 
    417     /* Otherwise, find which user this user should be inserted after */ 
     417    /* Otherwise, find which channel this channel should be inserted after */ 
    418418    for (; 
    419419     p->next 
  • 1.7.7/src/wiz.c

    r403 r405  
    16211621    const char *who; 
    16221622    int type; 
    1623   /* 0 = registration, 1 = siteban, 2 = names */ 
     1623  /* 0 = registration, 1 = siteban, 2 = names, 3 = remove, 4 = check */ 
    16241624{ 
    16251625  FILE *fp, *fptmp; 
     
    16861686      do_log(LT_WIZ, player, NOTHING, "*** SITELOCK *** %s", site); 
    16871687      break; 
     1688    case 4:{ 
     1689    struct access *ap; 
     1690    char tbuf[BUFFER_LEN], *bp; 
     1691    int rulenum; 
     1692    if (!site || !*site) { 
     1693      do_list_access(player); 
     1694      return; 
     1695    } 
     1696    ap = site_check_access(site, AMBIGUOUS, &rulenum); 
     1697    bp = tbuf; 
     1698    format_access(ap, rulenum, AMBIGUOUS, tbuf, &bp); 
     1699    *bp = '\0'; 
     1700    notify(player, tbuf); 
     1701    break; 
     1702      } 
    16881703    case 3:{ 
    16891704    int n;