Login when /server is used on known hostname
This brings back old behavior where you can /server to another server in the same network and login with services but now is only sent when the server is known not every time so more secure.
This commit is contained in:
parent
b2a780e97a
commit
6e049d5975
|
@ -3336,6 +3336,7 @@ cmd_server (struct session *sess, char *tbuf, char *word[], char *word_eol[])
|
||||||
int use_ssl = FALSE;
|
int use_ssl = FALSE;
|
||||||
int is_url = TRUE;
|
int is_url = TRUE;
|
||||||
server *serv = sess->server;
|
server *serv = sess->server;
|
||||||
|
ircnet *net = NULL;
|
||||||
|
|
||||||
#ifdef USE_OPENSSL
|
#ifdef USE_OPENSSL
|
||||||
/* BitchX uses -ssl, mIRC uses -e, let's support both */
|
/* BitchX uses -ssl, mIRC uses -e, let's support both */
|
||||||
|
@ -3391,9 +3392,19 @@ cmd_server (struct session *sess, char *tbuf, char *word[], char *word_eol[])
|
||||||
serv->loginmethod = LOGIN_PASS;
|
serv->loginmethod = LOGIN_PASS;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
/* If part of a known network, login like normal */
|
||||||
|
net = servlist_net_find_from_server (server_name);
|
||||||
|
if (net)
|
||||||
|
{
|
||||||
|
safe_strcpy (serv->password, net->pass, sizeof (serv->password));
|
||||||
|
serv->loginmethod = net->logintype;
|
||||||
|
}
|
||||||
|
else /* Otherwise ensure no password is sent */
|
||||||
{
|
{
|
||||||
serv->password[0] = 0;
|
serv->password[0] = 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef USE_OPENSSL
|
#ifdef USE_OPENSSL
|
||||||
serv->use_ssl = use_ssl;
|
serv->use_ssl = use_ssl;
|
||||||
|
|
Loading…
Reference in New Issue