X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/b552cf8745b82e9ba8a27c45ec84664be174b5a5..4859b814a5d8e99a85a951c21360c6b4922920a6:/src/s_serv.c?ds=sidebyside diff --git a/src/s_serv.c b/src/s_serv.c index 65e8e0f..161dc81 100644 --- a/src/s_serv.c +++ b/src/s_serv.c @@ -157,7 +157,7 @@ hunt_server(struct Client *client_p, struct Client *source_p, */ if(!target_p && wilds) { - RB_DLINK_FOREACH(ptr, global_client_list.head) + RB_DLINK_FOREACH(ptr, global_serv_list.head) { if(match(new, ((struct Client *) (ptr->data))->name)) { @@ -320,20 +320,31 @@ check_server(const char *name, struct Client *client_p) { error = -2; - if(ServerConfEncrypted(tmp_p)) + if(tmp_p->passwd) { - if(!strcmp(tmp_p->passwd, rb_crypt(client_p->localClient->passwd, - tmp_p->passwd))) + if(ServerConfEncrypted(tmp_p)) { - server_p = tmp_p; - break; + if(!strcmp(tmp_p->passwd, rb_crypt(client_p->localClient->passwd, + tmp_p->passwd))) + { + server_p = tmp_p; + break; + } + else + continue; } + else if(strcmp(tmp_p->passwd, client_p->localClient->passwd)) + continue; } - else if(!strcmp(tmp_p->passwd, client_p->localClient->passwd)) + + if(tmp_p->certfp) { - server_p = tmp_p; - break; + if(!client_p->certfp || strcasecmp(tmp_p->certfp, client_p->certfp) != 0) + continue; } + + server_p = tmp_p; + break; } } @@ -679,9 +690,9 @@ burst_TS6(struct Client *client_p) chptr->topic); if(IsCapable(client_p, CAP_MLOCK)) - sendto_one(client_p, ":%s MLOCK %ld %s %s", + sendto_one(client_p, ":%s MLOCK %ld %s :%s", me.id, (long) chptr->channelts, chptr->chname, - channel_mlock(chptr, client_p)); + EmptyString(chptr->mode_lock) ? "" : chptr->mode_lock); hchaninfo.chptr = chptr; call_hook(h_burst_channel, &hchaninfo); @@ -781,15 +792,9 @@ server_estab(struct Client *client_p) if(IsUnknown(client_p)) { - /* - * jdc -- 1. Use EmptyString(), not [0] index reference. - * 2. Check ->spasswd, not ->passwd. - */ - if(!EmptyString(server_p->spasswd)) - { - sendto_one(client_p, "PASS %s TS %d :%s", - server_p->spasswd, TS_CURRENT, me.id); - } + /* the server may be linking based on certificate fingerprint now. --nenolod */ + sendto_one(client_p, "PASS %s TS %d :%s", + EmptyString(server_p->spasswd) ? "*" : server_p->spasswd, TS_CURRENT, me.id); /* pass info to new server */ send_capabilities(client_p, default_server_capabs @@ -1350,11 +1355,9 @@ serv_connect_callback(rb_fde_t *F, int status, void *data) /* Next, send the initial handshake */ SetHandshake(client_p); - if(!EmptyString(server_p->spasswd)) - { - sendto_one(client_p, "PASS %s TS %d :%s", - server_p->spasswd, TS_CURRENT, me.id); - } + /* the server may be linking based on certificate fingerprint now. --nenolod */ + sendto_one(client_p, "PASS %s TS %d :%s", + EmptyString(server_p->spasswd) ? "*" : server_p->spasswd, TS_CURRENT, me.id); /* pass my info to the new server */ send_capabilities(client_p, default_server_capabs