diff options
Diffstat (limited to 'gvfs/gvfs.c')
| -rw-r--r-- | gvfs/gvfs.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/gvfs/gvfs.c b/gvfs/gvfs.c index 3f0ccd5..8ffa70e 100644 --- a/gvfs/gvfs.c +++ b/gvfs/gvfs.c @@ -31,9 +31,10 @@ -#define VERSION "0.1.0" -#define BUILD_DATE "2008-10-05" +#define VERSION "0.1.1" +#define BUILD_DATE "2008-10-06" #define DEFAULT_BLOCK_SIZE 0x10000 /* 64kB */ +#define ANON_FTP_PASS "ftpuser@tuxcmd.net" #define CONST_DEFAULT_QUERY_INFO_ATTRIBUTES G_FILE_ATTRIBUTE_STANDARD_TYPE "," G_FILE_ATTRIBUTE_STANDARD_NAME "," \ G_FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME "," G_FILE_ATTRIBUTE_STANDARD_SIZE "," \ @@ -50,6 +51,7 @@ struct TVFSGlobs { GMainLoop *mount_main_loop; TVFSResult mount_result; gchar *mount_password; + gboolean ftp_anonymous; gboolean break_get_dir_size; guint32 block_size; @@ -126,18 +128,23 @@ ask_password_cb (GMountOperation *op, g_assert (globs != NULL); g_print ("(WW) ask_password_cb: message = '%s'\n", message); + if (globs->ftp_anonymous) + g_print ("(II) Trying anonymous FTP login...\n"); if (flags & G_ASK_PASSWORD_NEED_USERNAME) { g_print (" need username...\n"); -/* FIXME: need proper API and spawn callback + if (globs->ftp_anonymous) + g_mount_operation_set_username (op, "anonymous"); + +/* FIXME: need proper API to spawn a callback g_mount_operation_set_username (op, s); */ } if (flags & G_ASK_PASSWORD_NEED_DOMAIN) { g_print (" need domain...\n"); -/* FIXME: need proper API and spawn callback +/* FIXME: need proper API to spawn a callback g_mount_operation_set_domain (op, s); */ } @@ -146,6 +153,9 @@ ask_password_cb (GMountOperation *op, g_print (" need password...\n"); if (globs->mount_password) g_mount_operation_set_password (op, globs->mount_password); + else + if (globs->ftp_anonymous) + g_mount_operation_set_password (op, ANON_FTP_PASS); } g_mount_operation_reply (op, G_MOUNT_OPERATION_HANDLED); @@ -290,6 +300,7 @@ VFSOpen (struct TVFSGlobs *globs, char *sName) globs->file = NULL; globs->mount_password = NULL; + globs->ftp_anonymous = FALSE; uri = NULL; /* Rip out password as GVFS URIs should contain only username (and domain). */ @@ -341,6 +352,11 @@ VFSOpen (struct TVFSGlobs *globs, char *sName) if (uri_service) free (uri_service); } + else + { + /* should be anonymous */ + globs->ftp_anonymous = strcasestr (sName, "ftp://") == sName; + } g_print ("(II) VFSOpen: opening URI '%s'\n", uri ? uri : sName); |
