Port number in shell link can be specified now
vfs/ChangeLog: * fish.c: Iterpret SUP.flags as port number if SUP.flags is not in * 0, FISH_FLAG_COMPRESSED and FISH_FLAG_RSH. Weakness: port number Originally by Andrew V. Samoilov <sav> Signed-off-by: Mikhail S. Pobolovets <styx.mp@gmail.com>
Этот коммит содержится в:
родитель
2a6edc23c5
Коммит
dac78460c2
41
vfs/fish.c
41
vfs/fish.c
@ -216,13 +216,22 @@ static int
|
|||||||
fish_open_archive_int (struct vfs_class *me, struct vfs_s_super *super)
|
fish_open_archive_int (struct vfs_class *me, struct vfs_s_super *super)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
const char *argv[10];
|
char gbuf[10];
|
||||||
|
const char *argv[10]; /* All of 10 is used now */
|
||||||
const char *xsh = (SUP.flags == FISH_FLAG_RSH ? "rsh" : "ssh");
|
const char *xsh = (SUP.flags == FISH_FLAG_RSH ? "rsh" : "ssh");
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
argv[i++] = xsh;
|
argv[i++] = xsh;
|
||||||
if (SUP.flags == FISH_FLAG_COMPRESSED)
|
if (SUP.flags == FISH_FLAG_COMPRESSED)
|
||||||
argv[i++] = "-C";
|
argv[i++] = "-C";
|
||||||
|
|
||||||
|
if (SUP.flags > FISH_FLAG_RSH)
|
||||||
|
{
|
||||||
|
argv[i++] = "-p";
|
||||||
|
g_snprintf (gbuf, sizeof (gbuf), "%d", SUP.flags);
|
||||||
|
argv[i++] = gbuf;
|
||||||
|
}
|
||||||
|
|
||||||
argv[i++] = "-l";
|
argv[i++] = "-l";
|
||||||
argv[i++] = SUP.user;
|
argv[i++] = SUP.user;
|
||||||
argv[i++] = SUP.host;
|
argv[i++] = SUP.host;
|
||||||
@ -320,7 +329,7 @@ fish_open_archive (struct vfs_class *me, struct vfs_s_super *super,
|
|||||||
SUP.user = user;
|
SUP.user = user;
|
||||||
SUP.flags = flags;
|
SUP.flags = flags;
|
||||||
if (!strncmp (op, "rsh:", 4))
|
if (!strncmp (op, "rsh:", 4))
|
||||||
SUP.flags |= FISH_FLAG_RSH;
|
SUP.flags = FISH_FLAG_RSH;
|
||||||
SUP.cwdir = NULL;
|
SUP.cwdir = NULL;
|
||||||
if (password)
|
if (password)
|
||||||
SUP.password = password;
|
SUP.password = password;
|
||||||
@ -1056,22 +1065,28 @@ static void
|
|||||||
fish_fill_names (struct vfs_class *me, fill_names_f func)
|
fish_fill_names (struct vfs_class *me, fill_names_f func)
|
||||||
{
|
{
|
||||||
struct vfs_s_super *super = MEDATA->supers;
|
struct vfs_s_super *super = MEDATA->supers;
|
||||||
const char *flags;
|
|
||||||
char *name;
|
char *name;
|
||||||
|
|
||||||
while (super){
|
char gbuf[10];
|
||||||
switch (SUP.flags & (FISH_FLAG_RSH | FISH_FLAG_COMPRESSED)) {
|
|
||||||
case FISH_FLAG_RSH:
|
while (super)
|
||||||
|
{
|
||||||
|
const char *flags = "";
|
||||||
|
switch (SUP.flags)
|
||||||
|
{
|
||||||
|
case FISH_FLAG_RSH:
|
||||||
flags = ":r";
|
flags = ":r";
|
||||||
break;
|
break;
|
||||||
case FISH_FLAG_COMPRESSED:
|
case FISH_FLAG_COMPRESSED:
|
||||||
flags = ":C";
|
flags = ":C";
|
||||||
break;
|
break;
|
||||||
case FISH_FLAG_RSH | FISH_FLAG_COMPRESSED:
|
default:
|
||||||
flags = "";
|
if (SUP.flags > FISH_FLAG_RSH)
|
||||||
break;
|
{
|
||||||
default:
|
break;
|
||||||
flags = "";
|
g_snprintf (gbuf, sizeof (gbuf), ":%d", SUP.flags);
|
||||||
|
flags = gbuf;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user