Changeset 830 for branches/ithildin-1.1
- Timestamp:
- 01/25/09 23:08:01 (3 years ago)
- Location:
- branches/ithildin-1.1/modules/ircd
- Files:
-
- 5 edited
-
addons/acl.c (modified) (5 diffs)
-
addons/acl.h (modified) (1 diff)
-
commands/acl.c (modified) (6 diffs)
-
commands/akill.c (modified) (5 diffs)
-
support.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/ithildin-1.1/modules/ircd/addons/acl.c
r772 r830 38 38 acl_t *create_acl(int stage, int acc, char *host, const char *type, int rule) { 39 39 acl_t *ap, *ap2; 40 char *at, hostcopy[ USERLEN +HOSTLEN + 2];40 char *at, hostcopy[ACL_USERLEN + ACL_HOSTLEN + 2]; 41 41 struct acl_list *list; 42 42 … … 59 59 ap->stage = stage; 60 60 ap->access = acc; 61 strlcpy(hostcopy, host, USERLEN +HOSTLEN + 2);61 strlcpy(hostcopy, host, ACL_USERLEN + ACL_HOSTLEN + 2); 62 62 at = strchr(hostcopy, '@'); 63 63 if (at == NULL) 64 strlcpy(ap->host, hostcopy, HOSTLEN + 1);64 strlcpy(ap->host, hostcopy, ACL_HOSTLEN + 1); 65 65 else { 66 66 *at = '\0'; 67 strlcpy(ap->user, hostcopy, USERLEN + 1);68 strlcpy(ap->host, at + 1, HOSTLEN + 1);67 strlcpy(ap->user, hostcopy, ACL_USERLEN + 1); 68 strlcpy(ap->host, at + 1, ACL_HOSTLEN + 1); 69 69 } 70 70 ap->type = strdup(type); … … 156 156 int rule, char *pass, char *info) { 157 157 struct acl_list *list; 158 char *at, hostcopy[ USERLEN + HOSTLEN + 2], user[USERLEN + 1];159 char host[ HOSTLEN + 1];158 char *at, hostcopy[ACL_USERLEN + ACL_HOSTLEN + 2], user[ACL_USERLEN + 1]; 159 char host[ACL_HOSTLEN + 1]; 160 160 acl_t *ap; 161 161 162 162 163 163 /* extract user@host data */ 164 strlcpy(hostcopy, hostmask, USERLEN +HOSTLEN + 2);164 strlcpy(hostcopy, hostmask, ACL_USERLEN + ACL_HOSTLEN + 2); 165 165 at = strchr(hostcopy, '@'); 166 166 if (at == NULL) { 167 167 *user = '\0'; 168 strlcpy(host, hostcopy, HOSTLEN + 1);168 strlcpy(host, hostcopy, ACL_HOSTLEN + 1); 169 169 } else { 170 170 *at = '\0'; 171 strlcpy(user, hostcopy, USERLEN + 1);172 strlcpy(host, at + 1, HOSTLEN + 1);171 strlcpy(user, hostcopy, ACL_USERLEN + 1); 172 strlcpy(host, at + 1, ACL_HOSTLEN + 1); 173 173 } 174 174 … … 348 348 connection_t *cp = (connection_t *)data; 349 349 uint32_t hash, iphash; 350 char ip[ HOSTLEN + 1];351 352 get_socket_address(isock_raddr(cp->sock), ip, HOSTLEN + 1, NULL);350 char ip[ACL_HOSTLEN + 1]; 351 352 get_socket_address(isock_raddr(cp->sock), ip, ACL_HOSTLEN + 1, NULL); 353 353 354 354 hash = get_acl_hash(cp->host); … … 392 392 connection_t *cp = (connection_t *)data; 393 393 uint32_t hash, iphash; 394 char ip[ HOSTLEN + 1];394 char ip[ACL_HOSTLEN + 1]; 395 395 void *ret = NULL; 396 396 397 get_socket_address(isock_raddr(cp->sock), ip, HOSTLEN + 1, NULL);397 get_socket_address(isock_raddr(cp->sock), ip, ACL_HOSTLEN + 1, NULL); 398 398 399 399 hash = get_acl_hash(cp->host); -
branches/ithildin-1.1/modules/ircd/addons/acl.h
r731 r830 24 24 uint32_t hash; /* hash of the acl */ 25 25 26 #define ACL_USERLEN (USERLEN * 2) 27 #define ACL_HOSTLEN HOSTLEN 28 26 29 class_t *cls; /* the class clients in the ACL are 27 30 placed in (optional) */ 28 char user[ USERLEN + 1]; /* username to match against (optional) */29 char host[ HOSTLEN + 1]; /* hostname/mask to match against */31 char user[ACL_USERLEN + 1]; /* username to match against (optional) */ 32 char host[ACL_HOSTLEN + 1]; /* hostname/mask to match against */ 30 33 char *reason; /* ban reason */ 31 34 char *info; /* "info" line to match against (stage 3 -
branches/ithildin-1.1/modules/ircd/commands/acl.c
r731 r830 49 49 int oarg = 1; 50 50 const char *type = acl_acl_type; 51 char mask[ USERLEN +HOSTLEN + 2];51 char mask[ACL_USERLEN + ACL_HOSTLEN + 2]; 52 52 int stage = -1; 53 53 int acc = -1; … … 77 77 stage = ACL_STAGE_REGISTER; 78 78 acc = ACL_DENY; 79 strlcpy(mask, argv[oarg++], USERLEN +HOSTLEN + 2);79 strlcpy(mask, argv[oarg++], ACL_USERLEN + ACL_HOSTLEN + 2); 80 80 if (argc > oarg) 81 81 strlcpy(reason, argv[oarg], XINFO_LEN); … … 92 92 stage = ACL_STAGE_REGISTER; 93 93 acc = ACL_DENY; 94 strlcpy(mask, argv[oarg++], USERLEN +HOSTLEN + 2);94 strlcpy(mask, argv[oarg++], ACL_USERLEN + ACL_HOSTLEN + 2); 95 95 } else if (!strcasecmp(argv[0], "ZLINE")) { 96 96 if (argc <= oarg || (strchr(argv[oarg], '!') != NULL || … … 105 105 stage = ACL_STAGE_CONNECT; 106 106 acc = ACL_DENY; 107 strlcpy(mask, argv[oarg++], USERLEN +HOSTLEN + 2);107 strlcpy(mask, argv[oarg++], ACL_USERLEN + ACL_HOSTLEN + 2); 108 108 if (argc > oarg) 109 109 strlcpy(reason, argv[oarg], XINFO_LEN); … … 120 120 stage = ACL_STAGE_CONNECT; 121 121 acc = ACL_DENY; 122 strlcpy(mask, argv[oarg++], USERLEN +HOSTLEN + 2);122 strlcpy(mask, argv[oarg++], ACL_USERLEN + ACL_HOSTLEN + 2); 123 123 } else { 124 124 /* treat it like it was a real ACL command. */ … … 162 162 oarg++; 163 163 if (argc > oarg) 164 strlcpy(mask, argv[oarg++], USERLEN +HOSTLEN + 2);164 strlcpy(mask, argv[oarg++], ACL_USERLEN + ACL_HOSTLEN + 2); 165 165 else { 166 166 sendto_one(cli, "NOTICE", -
branches/ithildin-1.1/modules/ircd/commands/akill.c
r734 r830 45 45 SERVER_COMMAND(akill, 0, 0, 0) { 46 46 acl_t *ap = NULL; 47 char mask[ USERLEN +HOSTLEN + 2];47 char mask[ACL_USERLEN + ACL_HOSTLEN + 2]; 48 48 #define ACL_ADD 0 49 49 #define ACL_DEL 1 … … 93 93 reason = argv[6]; 94 94 } 95 snprintf(mask, USERLEN +HOSTLEN + 2, "%s@%s", user, host);95 snprintf(mask, ACL_USERLEN + ACL_HOSTLEN + 2, "%s@%s", user, host); 96 96 97 97 /* propogate out. If we're getting data from a 'SHORTAKILL' server … … 111 111 } 112 112 113 snprintf(mask, USERLEN +HOSTLEN + 2, "%s@%s", argv[2], argv[1]);113 snprintf(mask, ACL_USERLEN + ACL_HOSTLEN + 2, "%s@%s", argv[2], argv[1]); 114 114 op = ACL_DEL; 115 115 sendto_serv_butone(sptr, NULL, srv, NULL, "RAKILL", "%s %s", argv[1], … … 125 125 stage = ACL_STAGE_CONNECT; 126 126 type = acl_szline_type; 127 strlcpy(mask, argv[1], HOSTLEN + 1);127 strlcpy(mask, argv[1], ACL_HOSTLEN + 1); 128 128 if (argc > 2) 129 129 reason = argv[2]; … … 143 143 stage = ACL_STAGE_CONNECT; 144 144 type = acl_szline_type; 145 strlcpy(mask, argv[1], HOSTLEN + 1);145 strlcpy(mask, argv[1], ACL_HOSTLEN + 1); 146 146 147 147 sendto_serv_butone(sptr, NULL, srv, NULL, "UNSZLINE", "%s", argv[1]); -
branches/ithildin-1.1/modules/ircd/support.c
r777 r830 212 212 if (xhp->func == func) { 213 213 LIST_REMOVE(xhp, lp); 214 destroy_privilege(xhp->priv); 214 215 free(xhp->desc); 215 216 free(xhp);
Note: See TracChangeset
for help on using the changeset viewer.
