From c8ef2d7ace0930456c5083d5e8b8e646692426d5 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Tue, 2 Jul 2002 17:08:10 +0000 Subject: [PATCH] * ftpfs.c (send_ftp_command): Use "anonymous@" as default anonymous password. From Eduardo Perez Ureta" --- vfs/ChangeLog | 6 ++++++ vfs/ftpfs.c | 24 +++++++++--------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/vfs/ChangeLog b/vfs/ChangeLog index 64d93db8e..a468d7afd 100644 --- a/vfs/ChangeLog +++ b/vfs/ChangeLog @@ -1,3 +1,9 @@ +2002-07-02 Pavel Roskin + + * ftpfs.c (send_ftp_command): Use "anonymous@" as default + anonymous password. + From Eduardo Perez Ureta" + 2002-06-25 Pavel Roskin * vfs.c: Add protection against NULL strings to all is_*() diff --git a/vfs/ftpfs.c b/vfs/ftpfs.c index 799087013..d83b36e3e 100644 --- a/vfs/ftpfs.c +++ b/vfs/ftpfs.c @@ -1539,25 +1539,19 @@ send_ftp_command(vfs *me, char *filename, char *cmd, int flags) void ftpfs_init_passwd(void) { - struct passwd *passwd_info; - char *p, hostname[MAXHOSTNAMELEN]; - struct hostent *hp; - ftpfs_anonymous_passwd = load_anon_passwd (); if (ftpfs_anonymous_passwd) return; - if ((passwd_info = getpwuid (geteuid ())) == NULL) - p = "unknown"; - else - p = passwd_info->pw_name; - gethostname(hostname, sizeof(hostname)); - hp = gethostbyname(hostname); - if (hp != NULL) - ftpfs_anonymous_passwd = g_strconcat (p, "@", hp->h_name, NULL); - else - ftpfs_anonymous_passwd = g_strconcat (p, "@", hostname, NULL); - endpwent (); + /* If there is no anonymous ftp password specified + * then we'll just use anonymous@ + * We don't send any other thing because: + * - We want to remain anonymous + * - We want to stop SPAM + * - We don't want to let ftp sites to discriminate by the user, + * host or country. + */ + ftpfs_anonymous_passwd = g_strdup ("anonymous@"); } static int ftpfs_chmod (vfs *me, char *path, int mode)