diff options
Diffstat (limited to 'ftp.c')
-rw-r--r-- | ftp.c | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -1,4 +1,4 @@ -/* $Id: ftp.c,v 1.34 2003/10/22 18:44:31 ukai Exp $ */ +/* $Id: ftp.c,v 1.35 2004/04/16 18:47:19 ukai Exp $ */ #include <stdio.h> #include <pwd.h> #include <Str.h> @@ -320,6 +320,7 @@ openFTPStream(ParsedURL *pu, URLFile *uf) int status; char *user = NULL; char *pass = NULL; + Str uname = NULL; Str pwd = NULL; int add_auth_cookie_flag = FALSE; char *realpathname = NULL; @@ -328,7 +329,6 @@ openFTPStream(ParsedURL *pu, URLFile *uf) return NULL; if (pu->user == NULL && pu->pass == NULL) { - Str uname, pwd; if (find_auth_user_passwd(pu, NULL, &uname, &pwd, 0)) { if (uname) user = uname->ptr; @@ -361,7 +361,8 @@ openFTPStream(ParsedURL *pu, URLFile *uf) else if (pu->pass) pass = pu->pass; else if (pu->user) { - pwd = find_auth_cookie(pu->host, pu->port, pu->file, pu->user); + pwd = NULL; + find_auth_user_passwd(pu, NULL, &uname, &pwd, 0); if (pwd == NULL) { if (fmInitialized) { term_raw(); @@ -394,7 +395,7 @@ openFTPStream(ParsedURL *pu, URLFile *uf) return NULL; } if (add_auth_cookie_flag) - add_auth_cookie(pu->host, pu->port, pu->file, pu->user, pwd); + add_auth_user_passwd(pu, NULL, uname, pwd, 0); ftp_read: ftp_command(¤t_ftp, "TYPE", "I", &status); |