Your message dated Fri, 19 Dec 2008 18:38:41 +0000
with message-id <[email protected]>
has caused the report #509194,
regarding putty: Does not accept u...@host format in CLI args
to be marked as having been forwarded to the upstream software
author(s) [email protected]
(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)
--
509194: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=509194
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
On Sat, Dec 20, 2008 at 01:06:04AM +1100, ADFH wrote:
> Package: putty
> Version: 0.60-4
> Severity: normal
>
> I use the windows version of PuTTY very very frequently. One of the
> features I use often is to run it from the Windows "Run" dialog..
>
> Ie. Win+R putty u...@host port
> Win+R putty [email protected] 22000
>
> I've noticed that this linux version supports the specification of
> host and port in the same fashion, but seems to include the username@
> portion as part of the hostname, failing with something similar to
> "Unable to open connection to u...@host: Name or service not known".
>
> I see there's an "-l" switch, but I'm curious why this alternate
> behaviour described above varies from the windows version.
I could have sworn this had been reported already, but I can't find it,
and it's reproducible with current upstream trunk.
The short answer is that it's because command-line parsing is
implemented in OS-specific code. Simon et al, how about the following
patch, pretty much cloned-and-hacked from windows/window.c?
Index: unix/uxputty.c
===================================================================
--- unix/uxputty.c (revision 8373)
+++ unix/uxputty.c (working copy)
@@ -100,6 +100,19 @@
strncpy(cfg->host, q, sizeof(cfg->host) - 1);
cfg->host[sizeof(cfg->host) - 1] = '\0';
got_host = 1;
+
+ /* See if host is of the form u...@host */
+ if (cfg->host[0] != '\0') {
+ char *atsign = strrchr(cfg->host, '@');
+ /* Make sure we're not overflowing the user field */
+ if (atsign) {
+ if (atsign - cfg->host < sizeof cfg->username) {
+ strncpy(cfg->username, cfg->host, atsign - cfg->host);
+ cfg->username[atsign - cfg->host] = '\0';
+ }
+ memmove(cfg->host, atsign + 1, 1 + strlen(atsign + 1));
+ }
+ }
}
if (got_host)
*allow_launch = TRUE;
--
Colin Watson [[email protected]]
--- End Message ---