[Bug 483249] New: Feature Request: Midnight Commander - add ability to choose custom port on "Shell Link" (fish-protocol, Patch attached))
https://bugzilla.novell.com/show_bug.cgi?id=483249 Summary: Feature Request: Midnight Commander - add ability to choose custom port on "Shell Link" (fish-protocol, Patch attached)) Classification: openSUSE Product: openSUSE 11.2 Version: Factory Platform: All OS/Version: SuSE Other Status: NEW Severity: Enhancement Priority: P5 - None Component: Other AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: AxelKoellhofer@web.de QAContact: qa@suse.de Found By: --- Created an attachment (id=277889) --> (https://bugzilla.novell.com/attachment.cgi?id=277889) Patch allwoing to choose custom SSH-port User-Agent: Mozilla/5.0 (compatible; Konqueror/3.5; Linux) KHTML/3.5.10 (like Gecko) SUSE Midnight Commander offers the possibility to connect to a remote machine via SSH (using the fish-protocol) the feature is called "Shell Link". However, the package provided by openSUSE does not allow you to choose another port than 22 and one had to work around this by editing ~/.ssh/config (which of course is not a problem for more experienced users, at least if you know, where you have to search for the right options). The following patch changes this behaviour (see also attachment) --- vfs/fish.c~ 2006-10-27 14:23:29.000000000 +0300 +++ vfs/fish.c 2006-10-27 14:56:12.000000000 +0300 @@ -214,7 +214,8 @@ static int 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"); int i = 0; @@ -224,6 +225,11 @@ fish_open_archive_int (struct vfs_class #endif if (SUP.flags == FISH_FLAG_COMPRESSED) 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++] = SUP.user; argv[i++] = SUP.host; @@ -323,7 +329,7 @@ fish_open_archive (struct vfs_class *me, SUP.user = user; SUP.flags = flags; if (!strncmp (op, "rsh:", 4)) - SUP.flags |= FISH_FLAG_RSH; + SUP.flags = FISH_FLAG_RSH; SUP.cwdir = NULL; if (password) SUP.password = password; @@ -913,22 +919,23 @@ static void fish_fill_names (struct vfs_class *me, fill_names_f func) { struct vfs_s_super *super = MEDATA->supers; - const char *flags; char *name; - + char gbuf[10]; + while (super){ - switch (SUP.flags & (FISH_FLAG_RSH | FISH_FLAG_COMPRESSED)) { + const char *flags = ""; + switch (SUP.flags) { case FISH_FLAG_RSH: flags = ":r"; break; case FISH_FLAG_COMPRESSED: flags = ":C"; break; - case FISH_FLAG_RSH | FISH_FLAG_COMPRESSED: - flags = ""; - break; default: - flags = ""; + if (SUP.flags > FISH_FLAG_RSH) { + g_snprintf (gbuf, sizeof (gbuf), ":%d", SUP.flags); + flags = gbuf; + } break; } The patch can be found here (originally, I found it somewhere in the MC-mailinglist) http://aur.archlinux.org/packages.php?ID=14325 and allows you now to connect to a remote machine with SSH on a "non-standard" port via Left (or right) => Shell Link => address:port The patch could be applied successfully to mc-4.6.2 (and also 4.6.2-pre1 in openSUSE 11.1). Perhaps you could consider to add this convenient, little feature to the next openSUSE release. Reproducible: Always -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=483249
Cyril Hrubis
https://bugzilla.novell.com/show_bug.cgi?id=483249
User nadvornik@novell.com added comment
https://bugzilla.novell.com/show_bug.cgi?id=483249#c1
Vladimir Nadvornik
https://bugzilla.novell.com/show_bug.cgi?id=483249
User AxelKoellhofer@web.de added comment
https://bugzilla.novell.com/show_bug.cgi?id=483249#c2
Axel Köllhofer
https://bugzilla.novell.com/show_bug.cgi?id=483249
User AxelKoellhofer@web.de added comment
https://bugzilla.novell.com/show_bug.cgi?id=483249#c3
Axel Köllhofer
Can you please make sure the patch is sent upstream? The active development has started again, so there is a high chance that the patch will be integrated.
Well, sometimes strange things happen. As I said before, I found this patch quite some time ago on the MC-mailinig list, thread was started in 2006 and ended without result. Fortunately, I just found this thread again and it seems to be revived. http://www.midnight-commander.org/ticket/118 Looks like a slightly modified patch has already gone upstream and is at least scheduled for 4.7. http://www.midnight-commander.org/attachment/ticket/118/0001-Port-number-in-... I just rebuilt mc with this modified on openSUSE 11.1 x86_64 version, seems to work fine. -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=483249
Axel Köllhofer
participants (1)
-
bugzilla_noreply@novell.com