Re: how to mask @ in ftp username?
- From: "Andrew V. Samoilov" <andrew email zp ua>
- To: mc-devel gnome org
- Cc: Jones Down <jones down gmx net>
- Subject: Re: how to mask @ in ftp username?
- Date: Mon, 27 Sep 2004 15:03:07 +0300 (EEST)
Hi, Jones!
Can you test attached patch?
> Hi,
>
> how can I mask a "@" sign in a username? I want to connect to a
> ftpserver that has some special user-authentication setup and we need
> to give our domain in the username, so it would look like this with
> mc:
>
> cd /#ftp:username example tld:password example tld
>
> mc does not find the host...
>
> any solutions or is this a bug?
--
Regards,
Andrew V. Samoilov.
diff -upr -x 'config*' -x 'Makefile*' -x '.*' -x '*.o' -x '*.a' mc-4.6.0-4asp/vfs/ftpfs.c mc-4.6.0/vfs/ftpfs.c
--- mc-4.6.0-4asp/vfs/ftpfs.c Thu Dec 26 04:21:43 2002
+++ mc-4.6.0/vfs/ftpfs.c Wed Jun 30 15:33:23 2004
@@ -220,7 +220,7 @@ ftp_split_url(char *path, char **host, c
char *p;
p = vfs_split_url (path, host, user, port, pass, FTP_COMMAND_PORT,
- URL_ALLOW_ANON);
+ URL_ALLOW_ANON|URL_AT_IN_USRNAME);
if (!*user) {
/* Look up user and password in netrc */
diff -upr -x 'config*' -x 'Makefile*' -x '.*' -x '*.o' -x '*.a' mc-4.6.0-4asp/vfs/utilvfs.c mc-4.6.0/vfs/utilvfs.c
--- mc-4.6.0-4asp/vfs/utilvfs.c Sun Dec 15 21:38:18 2002
+++ mc-4.6.0/vfs/utilvfs.c Wed Jun 30 15:28:51 2004
@@ -91,6 +91,12 @@ vfs_split_url (const char *path, char **
/* We have a username */
if (at) {
+ if (flags & URL_AT_IN_USRNAME) {
+ char *other_at = strchr (at + 1, '@');
+ char *slash = strchr (at, PATH_SEP);
+ if (other_at && (!slash || (other_at < slash)))
+ at = other_at;
+ }
*at = 0;
inner_colon = strchr (pcopy, ':');
if (inner_colon) {
diff -upr -x 'config*' -x 'Makefile*' -x '.*' -x '*.o' -x '*.a' mc-4.6.0-4asp/vfs/vfs.h mc-4.6.0/vfs/vfs.h
--- mc-4.6.0-4asp/vfs/vfs.h Wed Dec 11 11:36:51 2002
+++ mc-4.6.0/vfs/vfs.h Wed Jun 30 15:32:38 2004
@@ -318,6 +318,7 @@ extern char *vfs_get_password (char *msg
/* Flags for vfs_split_url() */
#define URL_ALLOW_ANON 1
#define URL_NOSLASH 2
+#define URL_AT_IN_USRNAME 4
extern char *vfs_split_url (const char *path, char **host, char **user,
int *port, char **pass, int default_port, int flags);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]