* vfs.c (vfs_translate_url): Add support for smb://, sh://,
ssh:// and mc:// filesystem requests. Introduced separate table for vfs aliases. * util.c (strip_password): Modifications to take the aliases into account while eliminating passwords. The original patch was extended by Roland Illig.
Этот коммит содержится в:
родитель
0a545794da
Коммит
5d55e9b92f
@ -1,3 +1,13 @@
|
||||
2005-02-12 Jindrich Novy <jnovy@redhat.com>
|
||||
|
||||
* vfs.c (vfs_translate_url): Add support for smb://, sh://,
|
||||
ssh:// and mc:// filesystem requests. Introduced separate table
|
||||
for vfs aliases.
|
||||
* util.c (strip_password): Modifications to take the aliases into
|
||||
account while eliminating passwords.
|
||||
|
||||
The original patch was extended by Roland Illig.
|
||||
|
||||
2005-02-12 Roland Illig <roland.illig@gmx.de>
|
||||
|
||||
* screen.c: Reverted my changes from 2005-02-08 (except the
|
||||
|
@ -437,10 +437,14 @@ strip_password (char *p, int has_prefix)
|
||||
const char *name;
|
||||
size_t len;
|
||||
} prefixes[] = { {"/#ftp:", 6},
|
||||
{"/#mc:", 5},
|
||||
{"ftp://", 6},
|
||||
{"/#mc:", 5},
|
||||
{"mc://", 5},
|
||||
{"/#smb:", 6},
|
||||
{"/#sh:", 5}
|
||||
{"smb://", 6},
|
||||
{"/#sh:", 5},
|
||||
{"sh://", 5},
|
||||
{"ssh://", 6}
|
||||
};
|
||||
char *at, *inner_colon, *dir;
|
||||
size_t i;
|
||||
|
@ -1,3 +1,13 @@
|
||||
2005-02-12 Jindrich Novy <jnovy@redhat.com>
|
||||
|
||||
* vfs.c (vfs_translate_url): Add support for smb://, sh://,
|
||||
ssh:// and mc:// filesystem requests. Introduced separate table
|
||||
for vfs aliases.
|
||||
* util.c (strip_password): Modifications to take the aliases into
|
||||
account while eliminating passwords.
|
||||
|
||||
The original patch was extended by Roland Illig.
|
||||
|
||||
2005-02-12 Andrew V. Samoilov <sav@bcs.zp.ua>
|
||||
|
||||
* samba/lib/netmask.c [HAVE_NETMASK_AIX && HAVE_UNISTD_H]: Include
|
||||
|
26
vfs/vfs.c
26
vfs/vfs.c
@ -981,15 +981,29 @@ vfs_fill_names (fill_names_f func)
|
||||
* Returns vfs path corresponding to given url. If passed string is
|
||||
* not recognized as url, g_strdup(url) is returned.
|
||||
*/
|
||||
|
||||
static const struct {
|
||||
const char *name;
|
||||
size_t name_len;
|
||||
const char *substitute;
|
||||
} url_table[] = { {"ftp://", 6, "/#ftp:"},
|
||||
{"mc://", 5, "/#mc:"},
|
||||
{"smb://", 6, "/#smb:"},
|
||||
{"sh://", 5, "/#sh:"},
|
||||
{"ssh://", 6, "/#sh:"},
|
||||
{"a:", 2, "/#a"}
|
||||
};
|
||||
|
||||
char *
|
||||
vfs_translate_url (const char *url)
|
||||
{
|
||||
if (strncmp (url, "ftp://", 6) == 0)
|
||||
return g_strconcat ("/#ftp:", url + 6, (char *) NULL);
|
||||
else if (strncmp (url, "a:", 2) == 0)
|
||||
return g_strdup ("/#a");
|
||||
else
|
||||
return g_strdup (url);
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < sizeof (url_table)/sizeof (url_table[0]); i++)
|
||||
if (strncmp (url, url_table[i].name, url_table[i].name_len) == 0)
|
||||
return g_strconcat (url_table[i].substitute, url + url_table[i].name_len, (char*) NULL);
|
||||
|
||||
return g_strdup (url);
|
||||
}
|
||||
|
||||
int vfs_file_is_local (const char *filename)
|
||||
|
Загрузка…
Ссылка в новой задаче
Block a user