Changeset 405
- Timestamp:
- 08/12/06 06:08:07 (2 years ago)
- Files:
-
- 1.7.7/CHANGES (modified) (1 diff)
- 1.7.7/Patchlevel (modified) (1 diff)
- 1.7.7/game/txt/hlp/penncmd.hlp (modified) (2 diffs)
- 1.7.7/game/txt/hlp/pennvers.hlp (modified) (3 diffs)
- 1.7.7/hdrs/access.h (modified) (2 diffs)
- 1.7.7/hdrs/extchat.h (modified) (1 diff)
- 1.7.7/hdrs/version.h (modified) (1 diff)
- 1.7.7/src/access.c (modified) (4 diffs)
- 1.7.7/src/cmds.c (modified) (1 diff)
- 1.7.7/src/command.c (modified) (1 diff)
- 1.7.7/src/db.c (modified) (2 diffs)
- 1.7.7/src/extchat.c (modified) (2 diffs)
- 1.7.7/src/wiz.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
1.7.7/CHANGES
r403 r405 18 18 19 19 ========================================================================== 20 21 Version 1.7.7 patchlevel 3 December 25, 2002 22 23 Commands: 24 * @sitelock/check <host> tells you which rule, if any, would match. 25 Fixes: 26 * The objdata hashtable routines had a serious bug that could 27 cause crashes. 28 20 29 21 30 Version 1.7.7 patchlevel 2 December 22, 2002 1.7.7/Patchlevel
r403 r405 1 1 Do not edit this file. It is maintained by the official PennMUSH patches. 2 This is PennMUSH 1.7.7p 22 This is PennMUSH 1.7.7p3 1.7.7/game/txt/hlp/penncmd.hlp
r401 r405 2676 2676 @sitelock <host-pattern> = <options>[,<name>] 2677 2677 @sitelock[/<ban|register>] <host-pattern> 2678 @sitelock/check <host> 2678 2679 @sitelock/remove <string> 2679 2680 … … 2684 2685 @sitelock without arguments lists all sites in access.cnf. 2685 2686 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>. 2687 2689 2688 2690 @sitelock/name adds a name to the list of banned player names. 1.7.7/game/txt/hlp/pennvers.hlp
r403 r405 1 1 & changes 2 & 1.7.7p 22 & 1.7.7p3 3 3 This is a list of changes in this patchlevel which are probably of 4 4 interest to players. More information about new commands and functions … … 12 12 be read in 'help patchlevels'. 13 13 14 Version 1.7.7 patchlevel 3 December 25, 2002 15 16 Commands: 17 * @sitelock/check <host> tells you which rule, if any, would match. 18 Fixes: 19 * The objdata hashtable routines had a serious bug that could 20 cause crashes. 21 22 23 & 1.7.7p2 14 24 Version 1.7.7 patchlevel 2 December 22, 2002 15 25 … … 5875 5885 type 'help <version>p<patchlevel>'. For example, 'help 1.7.2p3' 5876 5886 5877 1.7.7: 0, 1, 2 5887 1.7.7: 0, 1, 2, 3 5878 5888 1.7.6: 0, 1, 2, 3 5879 5889 1.7.5: 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 1.7.7/hdrs/access.h
r347 r405 1 1 #ifndef __ACCESS_H 2 2 #define __ACCESS_H 3 4 /* A linked list data structure to hold the access info */ 5 struct 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 3 14 4 15 /* These flags are can/can't - a site may or may not be allowed to do them */ … … 34 45 void write_access_file(void); 35 46 int site_can_access(const char *hname, int flag, dbref who); 47 struct access *site_check_access(const char *hname, dbref who, int *rulenum); 48 int format_access(struct access *ap, int rulenum, 49 dbref who 50 __attribute__ ((__unused__)), char *buff, char **bp); 36 51 int add_access_sitelock(dbref player, const char *host, dbref who, int can, 37 52 int cant); 1.7.7/hdrs/extchat.h
r403 r405 92 92 }; 93 93 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) 96 96 97 97 /* 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.7p 2"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 82 82 #include "confmagic.h" 83 83 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 };93 84 94 85 … … 369 360 } 370 361 362 /* Like above, but returns the details of the first-matching rule */ 363 struct access * 364 site_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 392 int 393 format_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 371 437 /* Add an entry to the linked list after the @sitelock entry. 372 438 * If there is no @sitelock entry, add one to the end of the list … … 474 540 acsflag *c; 475 541 char flaglist[BUFFER_LEN]; 542 int rulenum = 0; 476 543 char *bp; 477 544 478 545 for (ap = access_top; ap; ap = ap->next) { 546 rulenum++; 479 547 if (ap->can != ACS_SITELOCK) { 480 548 bp = flaglist; … … 494 562 *bp = '\0'; 495 563 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); 498 566 notify_format(player, " COMMENT: %s", ap->comment); 499 567 } else { 1.7.7/src/cmds.c
r399 r405 819 819 else if (SW_ISSET(sw, SWITCH_REMOVE)) 820 820 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); 821 823 else 822 824 do_sitelock(player, arg_left, args_right[1], args_right[2], 0); 1.7.7/src/command.c
r403 r405 236 236 {"@SHUTDOWN", "PANIC REBOOT PARANOID", cmd_shutdown, CMD_T_ANY, WIZARD, 237 237 0, 0}, 238 {"@SITELOCK", "BAN REGISTER REMOVE NAME", cmd_sitelock,238 {"@SITELOCK", "BAN CHECK REGISTER REMOVE NAME", cmd_sitelock, 239 239 CMD_T_ANY | CMD_T_EQSPLIT | CMD_T_RS_ARGS, WIZARD, 0, 0}, 240 240 {"@STATS", "TABLES", cmd_stats, CMD_T_ANY, 0, 0, 0}, 1.7.7/src/db.c
r403 r405 1371 1371 set_objdata(dbref thing, const char *keybase, void *data) 1372 1372 { 1373 hashdelete(tprintf("%s_#%d", keybase, thing), &htab_objdata); 1373 1374 if (data) { 1374 1375 if (hashadd(tprintf("%s_#%d", keybase, thing), data, &htab_objdata) < 0) … … 1378 1379 hashadd(keybase, (void *) &newkey, &htab_objdata_keys); 1379 1380 } 1380 return data; 1381 } else { 1382 hashdelete(tprintf("%s_#%d", keybase, thing), &htab_objdata); 1383 return NULL; 1384 } 1381 } 1382 return data; 1385 1383 } 1386 1384 1.7.7/src/extchat.c
r403 r405 398 398 tmp->chan = *ch; 399 399 /* If there's no channels on the list, or if the first channel is already 400 * alphabetically greater, usershould be the first entry on the list */400 * alphabetically greater, chan should be the first entry on the list */ 401 401 /* No channels? */ 402 402 if (!Chanlist(who)) { … … 415 415 free_chanlist(tmp); 416 416 } else { 417 /* Otherwise, find which user this usershould be inserted after */417 /* Otherwise, find which channel this channel should be inserted after */ 418 418 for (; 419 419 p->next 1.7.7/src/wiz.c
r403 r405 1621 1621 const char *who; 1622 1622 int type; 1623 /* 0 = registration, 1 = siteban, 2 = names */1623 /* 0 = registration, 1 = siteban, 2 = names, 3 = remove, 4 = check */ 1624 1624 { 1625 1625 FILE *fp, *fptmp; … … 1686 1686 do_log(LT_WIZ, player, NOTHING, "*** SITELOCK *** %s", site); 1687 1687 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 } 1688 1703 case 3:{ 1689 1704 int n;
