* ftpfs.c (ftp_split_url): Implement looking up password in
.netrc for known user.
Этот коммит содержится в:
родитель
e88191dd7c
Коммит
afd132617d
@ -1,5 +1,8 @@
|
|||||||
2002-07-12 Pavel Roskin <proski@gnu.org>
|
2002-07-12 Pavel Roskin <proski@gnu.org>
|
||||||
|
|
||||||
|
* ftpfs.c (ftp_split_url): Implement looking up password in
|
||||||
|
.netrc for known user.
|
||||||
|
|
||||||
* ftpfs.c (ftp_split_url): Don't expect lookup_netrc() to always
|
* ftpfs.c (ftp_split_url): Don't expect lookup_netrc() to always
|
||||||
return a username.
|
return a username.
|
||||||
(netrc_has_incorrect_mode): Don't free anything, it can result
|
(netrc_has_incorrect_mode): Don't free anything, it can result
|
||||||
|
16
vfs/ftpfs.c
16
vfs/ftpfs.c
@ -226,12 +226,28 @@ ftp_split_url(char *path, char **host, char **user, int *port, char **pass)
|
|||||||
URL_ALLOW_ANON);
|
URL_ALLOW_ANON);
|
||||||
|
|
||||||
if (!*user) {
|
if (!*user) {
|
||||||
|
/* Look up user and password in netrc */
|
||||||
if (use_netrc)
|
if (use_netrc)
|
||||||
lookup_netrc (*host, user, pass);
|
lookup_netrc (*host, user, pass);
|
||||||
if (!*user)
|
if (!*user)
|
||||||
*user = g_strdup ("anonymous");
|
*user = g_strdup ("anonymous");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Look up password in netrc for known user */
|
||||||
|
if (use_netrc && *user && pass && !*pass) {
|
||||||
|
char *new_user;
|
||||||
|
|
||||||
|
lookup_netrc (*host, &new_user, pass);
|
||||||
|
|
||||||
|
/* If user is different, remove password */
|
||||||
|
if (new_user && strcmp (*user, new_user)) {
|
||||||
|
g_free (*pass);
|
||||||
|
*pass = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
g_free (new_user);
|
||||||
|
}
|
||||||
|
|
||||||
if (p)
|
if (p)
|
||||||
g_free (p);
|
g_free (p);
|
||||||
}
|
}
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user