Changeset 772
- Timestamp:
- 09/27/06 05:15:07 (6 years ago)
- Location:
- branches/ithildin-1.1/modules/ircd
- Files:
-
- 8 edited
-
addons/acl.c (modified) (1 diff)
-
addons/hostmask.c (modified) (1 diff)
-
client.c (modified) (1 diff)
-
commands/pass.c (modified) (1 diff)
-
commands/server.c (modified) (1 diff)
-
connection.c (modified) (1 diff)
-
connection.h (modified) (3 diffs)
-
server.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/ithildin-1.1/modules/ircd/addons/acl.c
r751 r772 411 411 /* check password/info first, since they're cheaper than all the 412 412 * match calls (I guess */ 413 if (ap->pass != NULL && strcmp(ap->pass, cp->pass))413 if (ap->pass != NULL && cp->pass != NULL && strcmp(ap->pass, cp->pass)) 414 414 continue; /* password incorrect */ 415 415 if (ap->info != NULL && !match(ap->info, cp->cli->info)) -
branches/ithildin-1.1/modules/ircd/addons/hostmask.c
r579 r772 65 65 HOOK_FUNCTION(hostmask_cc_hook) { 66 66 client_t *cli = (client_t *)data; 67 char *mask = NULL;67 char *mask; 68 68 69 if (cli->conn != NULL)70 mask = mdext(cli->conn->cls, class_hostmask_mdi);69 if (cli->conn == NULL) 70 return NULL; /* nothing to do */ 71 71 72 mask = mdext(cli->conn->cls, class_hostmask_mdi); 72 73 if (mask != NULL && *mask != '\0') { 74 if (!strcasecmp(mask, "cgi:irc")) { 75 /* Special CGI:IRC hack. We take the password, if supplied, and 76 * use it as a hostname (as long as it's valid) */ 77 if (cli->conn->pass != NULL && *cli->conn->pass != '\0' && 78 istr_okay(ircd.maps.host, cli->conn->pass)) 79 mask = cli->conn->pass; 80 else { 81 log_warn("cgi:irc hostmasked connection did not provide a " 82 "valid host (%s!%s@%s)", cli->nick, cli->user, 83 cli->host); 84 return NULL; 85 } 86 /* fallthrough to normal mask case. */ 87 } 73 88 sendto_flag(SFLAG("SPY"), "Changing hostname for %s!%s@%s to %s", 74 89 cli->nick, cli->user, cli->host, mask); -
branches/ithildin-1.1/modules/ircd/client.c
r758 r772 200 200 LIST_INSERT_HEAD(ircd.connections.clients, cp, lp); 201 201 ircd.stats.serv.unkclients--; 202 203 /* clean out their password */ 204 if (cp->pass != NULL) { 205 free(cp->pass); 206 cp->pass = NULL; 207 } 202 208 } 203 209 204 210 cli->signon = cli->ts = me.now; 205 211 cli->hops = 0; /* our client, they're 0 hops from us <G> */ 212 206 213 } 207 214 -
branches/ithildin-1.1/modules/ircd/commands/pass.c
r577 r772 17 17 */ 18 18 19 static void copy_in_pass(connection_t *, char *); 20 19 21 CLIENT_COMMAND(pass, 1, 1, COMMAND_FL_UNREGISTERED) { 22 20 23 /* just copy the pass in */ 21 strncpy(cli->conn->pass, argv[1], PASSWDLEN); 22 24 copy_in_pass(cli->conn, argv[1]); 23 25 return COMMAND_WEIGHT_NONE; 24 26 } 25 27 26 28 SERVER_COMMAND(pass, 1, 1, COMMAND_FL_UNREGISTERED) { 29 27 30 /* just copy the pass in */ 28 strncpy(srv->conn->pass, argv[1], PASSWDLEN); 29 31 copy_in_pass(srv->conn, argv[1]); 30 32 return 0; 31 33 } 34 35 static void copy_in_pass(connection_t *conn, char *pass) { 36 37 /* Hack to support CGI IRC, which sends the 'real hostname' as the client 38 * password. What? Let's use HOSTLEN I guess! */ 39 if (conn->pass != NULL) 40 free(conn->pass); /* dump whatever was there before.. */ 41 conn->pass = malloc(HOSTLEN + 1); 42 strlcpy(conn->pass, pass, HOSTLEN + 1); 43 } 44 32 45 /* vi:set ts=8 sts=4 sw=4 tw=76 et: */ -
branches/ithildin-1.1/modules/ircd/commands/server.c
r717 r772 118 118 } 119 119 120 if (s trcmp(pass, srv->conn->pass)) {120 if (srv->conn->pass == NULL || strcmp(pass, srv->conn->pass)) { 121 121 destroy_connection(srv->conn, "password mismatch"); 122 122 return IRCD_CONNECTION_CLOSED; /* password mismatch */ -
branches/ithildin-1.1/modules/ircd/connection.c
r728 r772 58 58 sendq_pop(c); 59 59 } 60 61 if (c->pass != NULL) 62 free(c->pass); 60 63 61 64 if (c->buf != NULL) -
branches/ithildin-1.1/modules/ircd/connection.h
r717 r772 2 2 * connection.h: support structures/prototypes for connection.c 3 3 * 4 * Copyright 2002 the Ithildin Project.4 * Copyright 2002-2006 the Ithildin Project. 5 5 * See the COPYING file for more information on licensing and use. 6 6 * … … 8 8 */ 9 9 10 #ifndef IRCD_ SOCKET_H11 #define IRCD_ SOCKET_H10 #ifndef IRCD_CONNECTION_H 11 #define IRCD_CONNECTION_H 12 12 13 13 struct connection { … … 18 18 identd/dns) */ 19 19 char user[USERLEN + 1]; 20 char pass[PASSWDLEN + 1]; /* password, after registration feel 21 free to use this as empty bufferspace */ 20 char *pass; /* password, if not NULL it must be 21 malloc'd memory. It will be 22 destroyed after client registration. */ 22 23 23 24 char *buf; /* temporary buffer pointer, possibly -
branches/ithildin-1.1/modules/ircd/server.c
r728 r772 293 293 LIST_REMOVE(sp->conn, lp); 294 294 LIST_INSERT_HEAD(ircd.connections.servers, sp->conn, lp); 295 296 /* clean out the password area */ 297 if (sp->conn->pass != NULL) { 298 free(sp->conn->pass); 299 sp->conn->pass = NULL; 300 } 295 301 } 296 302
Note: See TracChangeset
for help on using the changeset viewer.
