Hello,

My hosting provider gives user names containing a @. ftpfs doesn't work
with URL like ftp://[EMAIL PROTECTED]:[EMAIL PROTECTED], because it considers
that the hostname starts after the first @.

Although @ is a reserved caracter in the URLs according to RFC3986, I
think supporting those non-standard login is harmless and useful (at
least, it is for me).

Here is the patch I use. It works fine for me and a few of the HurdFR team.

2005-06-14  Hugues Larrive  <[EMAIL PROTECTED]>

   * ftpfs.c (parse_startup_opt): User names may contain a @, so take the
   last @ of FTPFS_REMOTE_FS.
   * host.c (split_server_name): User names may contain a @, so take the
   last @ of P.

diff -Nurp hurd-orig/ftpfs/ftpfs.c hurd/ftpfs/ftpfs.c
--- hurd-orig/ftpfs/ftpfs.c     2002-05-13 19:39:37.000000000 +0200
+++ hurd/ftpfs/ftpfs.c  2005-06-14 14:42:33.000000000 +0200
@@ -255,7 +255,7 @@ parse_startup_opt (int key, char *arg, s
       {
         int h_err;            /* Host lookup error.  */
         error_t err;
-         char *sep = strchr (ftpfs_remote_fs, '@');
+         char *sep = strrchr (ftpfs_remote_fs, '@');

         if (sep)
           /* FTPFS_REMOTE_FS includes a '@', which means that it's in
diff -Nurp hurd-orig/ftpfs/host.c hurd/ftpfs/host.c
--- hurd-orig/ftpfs/host.c      1997-08-07 05:06:20.000000000 +0200
+++ hurd/ftpfs/host.c   2005-06-14 14:43:24.000000000 +0200
@@ -38,7 +38,7 @@ split_server_name (const char *server, c

/* Extract the hostname; syntax is either `HOST:...', [EMAIL PROTECTED]', or just
     HOST if there are no user parameters specified.  */
-  sep = strchr (p, '@');
+  sep = strrchr (p, '@');
  if (sep)
    /* [EMAIL PROTECTED] */
    {


_______________________________________________
Bug-hurd mailing list
Bug-hurd@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-hurd

Reply via email to