Changeset 725 for branches/ithildin-1.1
- Timestamp:
- 05/03/06 22:12:57 (6 years ago)
- Location:
- branches/ithildin-1.1/modules/ircd
- Files:
-
- 5 edited
-
addons/acl.c (modified) (5 diffs)
-
addons/acl.h (modified) (1 diff)
-
doc/conf.txt (modified) (1 diff)
-
ircd.c (modified) (1 diff)
-
send.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/ithildin-1.1/modules/ircd/addons/acl.c
r662 r725 217 217 if (ap->info != NULL) 218 218 free(ap->info); 219 if (ap->redirect != NULL) 220 free(ap->redirect); 219 221 if (ap->timer != TIMER_INVALID) 220 222 destroy_timer(ap->timer); … … 409 411 /* okay, it actually matches. */ 410 412 if (ap->access == ACL_DENY) { 413 /* Is this a redirect? Maybe so, let's send them the 414 * redirect message if it is. */ 415 if (ap->redirect != NULL) 416 sendto_one(cp->cli, RPL_FMT(cp->cli, RPL_REDIR), 417 ap->redirect, ap->redirect_port); 418 411 419 /* if there's a reason for the ban and they weren't already 412 * denied set ret, otherwise just leave it alone */ 420 * denied set ret, otherwise just leave it alone. Why? 421 * this is possible if there is no more room in their 422 * connection class. We want them to know that they 423 * would be authorized if the class wasn't full, instead 424 * of telling them they are not at all authorized. */ 413 425 ret = (ret != NULL ? ret : ap->reason); 414 426 break; /* we'll return below. */ … … 448 460 conf_list_t *clp; 449 461 acl_t *ap, *ap2; 450 int stg, acc; 451 char *s, *class, *pass, *info, *reason; 462 int stg, acc, redirect_port = 0; 463 char *s, *class, *pass, *info, *reason, *redir; 464 char redirect[SERVLEN + 1]; 452 465 class_t *cls; 453 466 int odr, rn, dcr; /* Old Default Rule, Rule Number, Default Conf Rule */ … … 522 535 pass = conf_find_entry("pass", clp, 1); 523 536 info = conf_find_entry("info", clp, 1); 524 if (acc ess== ACL_DENY) {537 if (acc == ACL_DENY) { 525 538 if ((reason = conf_find_entry("reason", clp, 1)) == NULL) 526 539 reason = "You are not authorised to use this server."; 527 540 } 541 542 if ((redir = conf_find_entry("redirect", clp, 1)) != NULL) { 543 /* try finding the port .. */ 544 if ((s = strchr(redir, ':')) != NULL) { 545 strlcpy(redirect, redir, (s - redir <= SERVLEN ? 546 (s - redir) + 1 : SERVLEN + 1)); 547 if ((redirect_port = str_conv_int(s + 1, 0)) == 0) 548 log_warn("Could not parse server:port combo for redirect " 549 "%s", redir); 550 } else { 551 strlcpy(redirect, redir, SERVLEN + 1); 552 redirect_port = 6667; 553 } 554 555 if (acc != ACL_DENY) { 556 log_warn("Redirection forces a DENY ACL type."); 557 acc = ACL_DENY; 558 } 559 } else 560 *redirect = '\0'; 561 562 528 563 529 564 /* now iterate through all the host lists and all the regular hosts and … … 546 581 if (str_conv_bool(conf_find_entry("skip-ident", clp, 1), 0)) \ 547 582 ap->flags |= ACL_FL_SKIP_IDENT; \ 583 if (*redirect != '\0' && redirect_port != 0) { \ 584 ap->redirect = strdup(redirect); \ 585 ap->redirect_port = redirect_port; \ 586 } \ 548 587 } while (0) 549 588 -
branches/ithildin-1.1/modules/ircd/addons/acl.h
r662 r725 31 31 only) */ 32 32 char *pass; /* password */ 33 char *redirect; /* redirect server (or NULL if none) */ 34 int redirect_port; /* redirect port */ 35 33 36 time_t added; /* when it was added */ 34 37 time_t expire; /* when this will expire */ -
branches/ithildin-1.1/modules/ircd/doc/conf.txt
r579 r725 65 65 // connection. This only works for deny entries. 66 66 reason "You are not authorized to use this server."; 67 68 // redirect: (optional) 69 // This specifies that a connection should be redirected to the 70 // specified server/port (server:port form). If the port is left off 71 // it is assumed to be the default port (typically 6667). This applies 72 // only to entries in stage 3. 73 // NB: redirect ACLs are always deny type. That is, the redirect message 74 // is provided and then the connection is closed. 75 redirect <some-irc-server:some-port>; 67 76 68 77 // skip-dns: (optional) -
branches/ithildin-1.1/modules/ircd/ircd.c
r579 r725 443 443 CMSG("004", "%s %s %s %s"); /* rpl_myinfo */ 444 444 CMSG("005", "%s :are available on this server."); /* rpl_isupport */ 445 CMSG("010", "%s %d :Please redirect your client to this server and " 446 "port."); /* rpl_redir */ 445 447 CMSG("263", ":Server load is temporarily too heavy, please wait a " 446 448 "while and try again."); /* rpl_loadtoohigh */ -
branches/ithildin-1.1/modules/ircd/send.h
r593 r725 172 172 #define RPL_MYINFO 004 173 173 #define RPL_ISUPPORT 005 174 #define RPL_REDIR 010 174 175 #define RPL_LOADTOOHIGH 263 175 176
Note: See TracChangeset
for help on using the changeset viewer.
