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

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

This commit is contained in:
Witold Filipczyk 2007-01-27 12:38:02 +01:00 committed by Witold Filipczyk
parent 9aab8b0ceb
commit c7f6f76951
2 changed files with 6 additions and 3 deletions

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) {

View File

@ -252,7 +252,7 @@ do_smb(struct connection *conn)
unsigned char *url; unsigned char *url;
int dir; int dir;
if ((uri->userlen && uri->passwordlen) || !auth || !auth->valid) { if ((uri->userlen && uri->passwordlen) || !auth) {
url = get_uri_string(uri, URI_BASE); url = get_uri_string(uri, URI_BASE);
} else { } else {
unsigned char *uri_string = get_uri_string(uri, URI_HOST | URI_PORT | URI_DATA); unsigned char *uri_string = get_uri_string(uri, URI_HOST | URI_PORT | URI_DATA);
@ -448,6 +448,7 @@ smb_protocol_handler(struct connection *conn)
} }
conn->from = 0; conn->from = 0;
conn->unrestartable = 1; conn->unrestartable = 1;
find_auth(conn->uri); /* remember useranme and password */
cpid = fork(); cpid = fork();
if (cpid == -1) { if (cpid == -1) {