1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

fsp: remember the username and the password given in the uri.

[ This is half of commit c7f6f76951
  from the witekfl branch.  The SMB half is in commit
  a0db520267.  --KON ]
This commit is contained in:
Witold Filipczyk 2007-01-27 12:38:02 +01:00 committed by Kalle Olavi Niemitalo
parent 05b19b05e6
commit e34d646f1a

View File

@ -193,7 +193,7 @@ do_fsp(struct connection *conn)
FSP_SESSION *ses; FSP_SESSION *ses;
struct stat sb; struct stat sb;
struct uri *uri = conn->uri; struct uri *uri = conn->uri;
struct auth_entry *auth = find_auth(uri); struct auth_entry *auth;
unsigned char *host = get_uri_string(uri, URI_HOST); unsigned char *host = get_uri_string(uri, URI_HOST);
unsigned char *data = get_uri_string(uri, URI_DATA); unsigned char *data = get_uri_string(uri, URI_DATA);
unsigned short port = (unsigned short)get_uri_port(uri); unsigned short port = (unsigned short)get_uri_port(uri);
@ -203,7 +203,8 @@ do_fsp(struct connection *conn)
if (uri->passwordlen) { if (uri->passwordlen) {
password = get_uri_string(uri, URI_PASSWORD); password = get_uri_string(uri, URI_PASSWORD);
} else { } else {
if (auth && auth->valid) password = auth->password; auth = find_auth(uri);
if (auth) password = auth->password;
} }
ses = fsp_open_session(host, port, password); ses = fsp_open_session(host, port, password);
@ -378,6 +379,7 @@ fsp_protocol_handler(struct connection *conn)
} }
conn->from = 0; conn->from = 0;
conn->unrestartable = 1; conn->unrestartable = 1;
find_auth(conn->uri); /* remember username and password */
cpid = fork(); cpid = fork();
if (cpid == -1) { if (cpid == -1) {