Граф коммитов

2845 Коммитов

Автор SHA1 Сообщение Дата
Simon Tatham 2aedc83f8d Apparently it helps for an OVERLAPPED structure to contain a valid
event handle. This seems to have fixed _some_, but not all, of the
curious data loss issues in the Windows serial backend.

[originally from svn r6826]
2006-08-28 18:16:49 +00:00
Jacob Nevins 74278dcd64 Minor tweaks to -nc:
- log host:port in event log
 - add -nc to Plink usage message

[originally from svn r6825]
2006-08-28 17:47:43 +00:00
Simon Tatham 38ebd5f5ba Missed a couple of instances of cfg_launchable().
[originally from svn r6824]
2006-08-28 17:41:02 +00:00
Simon Tatham 631b494807 New command-line option in Plink (and PuTTY, though it's less useful
there): `plink host -nc host2:port' causes the SSH connection's main
channel to be replaced with a direct-tcpip connection to the
specified destination. This feature is mainly designed for use as a
local proxy: setting your local proxy command to `plink %proxyhost
-nc %host:%port' lets you tunnel SSH over SSH with a minimum of
fuss. Works on all platforms.

[originally from svn r6823]
2006-08-28 15:12:37 +00:00
Simon Tatham 8c26b44ce6 Serial back end for Unix. Due to hardware limitations (no Linux box
I own has both an X display and a working serial port) I have been
unable to give this the full testing it deserves; I've managed to
demonstrate the basic functionality of Unix Plink talking to a
serial port, but I haven't been able to test the GTK front end. I
have no reason to think it will fail, but I'll be more comfortable
once somebody has actually tested it.

[originally from svn r6822]
2006-08-28 14:29:02 +00:00
Simon Tatham efd7cad3d2 ... and here's the rest of r6820. Ahem.
[originally from svn r6821]
[r6820 == ae83801b28]
2006-08-28 13:08:50 +00:00
Simon Tatham ae83801b28 Because not all OSes will support the same set of serial port
options, here's a slight change to the API of ser_setup_config_box()
to make it filter its parity and flow control options using
platform-supplied bit masks.

[originally from svn r6820]
2006-08-28 13:08:15 +00:00
Simon Tatham 0ceeaf2b96 Fix small event log bug.
[originally from svn r6819]
2006-08-28 11:33:51 +00:00
Simon Tatham 8fe46f4b05 Forgot to initialise serial->bufsize to zero.
[originally from svn r6818]
2006-08-28 11:32:12 +00:00
Simon Tatham 3c04bd6b42 Fix line endings (svn:eol-style properties and actual CRs).
[originally from svn r6817]
2006-08-28 11:13:56 +00:00
Simon Tatham 34f747421d Support for Windows PuTTY connecting straight to a local serial port
in place of making a network connection. This has involved a couple
of minor infrastructure changes:
 - New dlg_label_change() function in the dialog.h interface, which
   alters the label on a control. Only used, at present, to switch
   the Host Name and Port boxes into Serial Line and Speed, which
   means that any platform not implementing serial connections (i.e.
   currently all but Windows) does not need to actually do anything
   in this function. Yet.
 - New small piece of infrastructure: cfg_launchable() determines
   whether a Config structure describes a session ready to be
   launched. This was previously determined by seeing if it had a
   non-empty host name, but it has to check the serial line as well
   so there's a centralised function for it. I haven't gone through
   all front ends and arranged for this function to be used
   everywhere it needs to be; so far I've only checked Windows.
 - Similarly, cfg_dest() returns the destination of a connection
   (host name or serial line) in a text format suitable for putting
   into messages such as `Unable to connect to %s'.

[originally from svn r6815]
2006-08-28 10:35:12 +00:00
Jacob Nevins 38f003dbe9 Now that Local proxy type exists on both Unix and Windows, document it and
associated stuff.

[originally from svn r6814]
2006-08-27 11:55:30 +00:00
Simon Tatham 17bc654532 Grow some nasty warts on the side of winhandl.c, in preparation for
a serial port backend:
 - In order to do simultaneous reading and writing on the same
   HANDLE, you must enable overlapped access and pass an OVERLAPPED
   structure to each ReadFile and WriteFile call. This would make
   sense if it were an optional thing I could do if I wanted to do
   the reading and writing in the same thread, but making it
   mandatory even if I'm doing them in _different_ threads is just
   annoying and arbitrary.
 - Serial ports occasionally return length 0 from ReadFile, for no
   particularly good reason. Fortunately serial ports also don't
   have a real EOF condition to speak of, so ignoring EOFs is
   actually a viable response in spite of sounding utterly gross.
Hence, handle_{input,output}_new() now accept a flags parameter,
which includes a flag to enable the OVERLAPPED bureaucracy and a
flag to cause EOFs to be ignored on input handles. The current
clients of winhandl.c do not use either of these.

[originally from svn r6813]
2006-08-27 10:00:36 +00:00
Simon Tatham 3dc4063f69 Remove spurious #include.
[originally from svn r6812]
2006-08-27 09:53:34 +00:00
Simon Tatham 1347235754 Call console_provide_logctx _before_ initialising the back end, so
that logevent() will go to stderr in -v mode even during the back
end init function.

[originally from svn r6811]
2006-08-27 08:34:04 +00:00
Simon Tatham c353c3cc97 The `socket' function in the backends is only ever checked to see if
it's NULL. Since we already have one back end (uxpty) which doesn't
in fact talk to a network socket, and may well have more soon, I'm
replacing this TCP/IP-centric function with a nice neutral
`connected' function returning a boolean. Nothing else about its
semantics has currently changed.

[originally from svn r6810]
2006-08-27 08:03:19 +00:00
Simon Tatham cda522186a It's critically important that the local proxy process should not
inherit _our_ ends of its I/O pipes! Otherwise, closing our copy of
those handles does not cause it to see EOF on its stdin, because
it's holding the pipe open itself.

[originally from svn r6808]
2006-08-26 10:59:09 +00:00
Simon Tatham 421a5ece2c We _can_ have handle_throttle() called on defunct handles after all,
so it should just do nothing rather than failing an assertion.

[originally from svn r6807]
2006-08-26 10:58:13 +00:00
Simon Tatham 8a3c123bd7 ProxyCommand support for Windows, using the new winhandl.c API.
Seems a bit clunky when I actually try to use it - not sure why -
but I think all the actual functionality is there.

[originally from svn r6806]
2006-08-26 10:20:16 +00:00
Simon Tatham d5f4ce4611 Another bug fix: always set the busy flag when telling a subthread
to do something, otherwise handle_get_events will forget to tell the
front end to check for that subthread finishing. This applies even
when we're only setting `busy' to tell the subthread to terminate!

[originally from svn r6805]
2006-08-26 10:19:23 +00:00
Simon Tatham b2fec9f576 Cleanups to reduce dependency on Windows SFTP tools always having a
real network socket.

[originally from svn r6804]
2006-08-26 10:18:31 +00:00
Simon Tatham 5765f8ceb9 On cleanup, PSCP and PSFTP should explicitly check that the back end
is still running rather than relying on ssh_sftp_loop_iteration() to
return a bogus value.

[originally from svn r6803]
2006-08-26 10:17:39 +00:00
Simon Tatham 0dcdb6c3c1 Start using notify_remote_exit() in the Windows front end, in place
of the previous ad-hockery which depended on the return value from
select_result() and hence which will not adapt sensibly to a world
in which the primary session is something local rather than a
network connection.

[originally from svn r6802]
2006-08-26 10:04:46 +00:00
Simon Tatham 2d633388a1 Return a non-zero exit code in the event of a fatal-error SSH
session termination. `Close window only on clean exit' was not
working properly on Unix in the absence of this:
notify_remote_exit() was being called and ssh_return_exitcode was
returning zero, causing gtk_main_quit() to be called, _before_
connection_fatal() happened.

[originally from svn r6801]
2006-08-26 09:21:52 +00:00
Simon Tatham 44a246aaa7 Always initialise the `addresses' field of a SockAddr to NULL,
because it gets unconditionally sfree()d in sk_addr_free(). This
just bit me when running under the MSVC debugger; not sure how it
hasn't bitten anyone until now!

[originally from svn r6800]
2006-08-26 08:37:42 +00:00
Simon Tatham 911f43b872 Bug fix: since the input thread does not wait for the event object
until _after_ its first read, we should not start by signalling that
object in order to trigger the first read. Ahem.

[originally from svn r6799]
2006-08-26 08:15:53 +00:00
Simon Tatham 52cdcc6a7c Small tweak to the new handle API: provide a `privdata' field in
each handle structure, set on initialisation and readable by an API
call.

[originally from svn r6798]
2006-08-26 07:41:15 +00:00
Simon Tatham 291533d3f9 New piece of Windows infrastructure: winhandl.c takes Plink's
thread-based approach to stdin and stdout, wraps it in a halfway
sensible API, and makes it a globally available service across all
network tools.

There is no direct functionality enhancement from this checkin:
winplink.c now talks to the new API instead of doing it all
internally, but does nothing different as a result.

However, this should lay the groundwork for several diverse pieces
of work in future: pipe-based ProxyCommand on Windows, a serial port
back end, and (hopefully) a pipe-based means of communicating with
Pageant, which should have sensible blocking behaviour and hence
permit asynchronous agent requests and decrypt-on-demand.

[originally from svn r6797]
2006-08-25 22:10:16 +00:00
Simon Tatham 6104963b9b Er, ahem. Other half of r6788. :-/
[originally from svn r6791]
[r6788 == 09f86ce7ec]
2006-08-15 22:48:01 +00:00
Simon Tatham 92e75acbb5 Shifts left and right by 32 were tripping a gcc warning (fatal with
-Werror, of course) about shifting by more than the range of a data
type. They only appeared in `if' statements testing sizeof(off_t),
but gcc warns even when the code is unreachable. I've removed the
conditional code (the general case should still work even on 32-bit
machines), and hacked each shift by 32 into a pair of shifts by 16.

Note that the gcc warning is not just a helpful indication that you
may be using the wrong data type; it's actually pointing out ANSI-
undefined behaviour in shifting a signed integer beyond the size of
its type.

[originally from svn r6789]
2006-08-15 20:29:02 +00:00
Simon Tatham 09f86ce7ec Aha! At long last I've managed to reproduce the intermittent problem
I've been having with the cursor sometimes restoring to the wrong
place when screen(1) terminates. The offending sequence of escape
sequences goes ESC 7 (save cursor), ESC [?47h (switch to alternate
screen), ESC 7 (save cursor _again_), do some stuff, ESC 8 (restore
cursor), run screen session for a bit, ESC [?47l (return to main
screen), ESC 8 (restore cursor). The final ESC 8 is expected to
restore the cursor to where it was saved by the initial ESC 7.

Translation: the ESC 7 saved cursor state is part of the state we
must swap out when switching to the alternate screen. In other
words, we need to track _four_ cursor positions: active and saved,
on each of main and alternate screen. Previously we were tracking
only three.

[originally from svn r6788]
2006-08-15 12:45:21 +00:00
Owen Dunn 33b7caa590 Large file support for psftp and pscp on both Windows and Unix. On Unix
we set _FILE_OFFSET_BITS to 64 on the compiler command line (via mkfiles.pl),
and on Windows we use SetFilePointer and GetFileSize to cope with 64-bit sizes
where possible.  Not tested on Win9x.

[originally from svn r6783]
2006-08-12 15:20:19 +00:00
Owen Dunn 3d522cfd08 Some extra int64 functions.
[originally from svn r6778]
2006-08-05 13:48:53 +00:00
Jacob Nevins 9ca35dd9e5 Spell out more explicitly what needs to be done with vanilla VC6, since it
seems to be becoming a FAQ.

[originally from svn r6752]
2006-07-07 20:56:22 +00:00
Jacob Nevins 588e4168c8 Random Unix puttygen improvements highlighted by a post to comp.security.ssh:
- fix diagnostic if keyfile and '-t' both specified
 - add diagnostic for generating a key but discarding the private part
 - document '-q' option

[originally from svn r6750]
2006-07-07 14:18:47 +00:00
Jacob Nevins f8f21619c2 In the config dialog, clip RGB values to [0..255] rather than reducing them
mod 256.
Document that the RGB values can be edited, and their range.

[originally from svn r6734]
2006-06-20 21:10:33 +00:00
Jacob Nevins b1997cc32c When Unix PuTTYgen gives brief usage information, it should mention "--help"!
[originally from svn r6732]
2006-06-17 13:01:04 +00:00
Jacob Nevins d75ab2b509 Robert Evans spotted that bignum_decimal() failed to cope with being given
a zero input.
This shouldn't matter for PuTTY, as these routines are only used in PuTTYgen,
to output SSH-1 format public key exponents/moduli, which should be nonzero.

[originally from svn r6731]
2006-06-17 12:02:03 +00:00
Jacob Nevins a3b6eac834 Update status of our PocketPC port.
[originally from svn r6730]
2006-06-16 13:09:47 +00:00
Jacob Nevins a2c060d638 Do not send raw mouse events in the middle of a selection operation, even if
we otherwise would (for instance, if Shift is released before the mouse button
being used for selection).

[originally from svn r6727]
[this svn revision also touched putty-wishlist]
2006-06-11 12:56:52 +00:00
Simon Tatham bbec032476 Lionel Fourquaux offers this very simple patch to speed up SFTP,
simply by upping the packet sizes and maximum in-flight packet
count. Got to be worth a try, I think!

[originally from svn r6722]
2006-06-02 08:46:34 +00:00
Simon Tatham 5489c56a08 Make it clearer that `psftp -b' doesn't return to the interactive
prompt if the script doesn't end with an explicit `quit'.

[originally from svn r6717]
2006-05-26 12:45:21 +00:00
Jacob Nevins 5a81457608 Port r6710 from puzzles:
Patch from Ben Hutchings to prevent an ugly special case in
&splitline in which a line is `split' into a line ending in a
backslash followed by a completely blank line.

[originally from svn r6714]
[r6710 == fd90d1a7c8224e673361d8b23aadfa01829de77c in puzzles repository]
2006-05-21 12:20:42 +00:00
Jacob Nevins 024c84e063 Link to new `key-formats-natively' wishlist item from appropriate FAQ.
[originally from svn r6693]
2006-05-17 12:06:08 +00:00
Owen Dunn 8eef03a0b0 pty_init should put _something_ into realhost
[originally from svn r6679]
2006-05-12 11:02:28 +00:00
Jacob Nevins 1e48a52b17 sbcsgen.pl was giving different results on different machines in the case
where two SBCS code points mapped to a single Unicode point.
Changed so that by default it favours the lower SBCS code point.
On ixion, this highlighted ambiguities in CS_MAC_THAI, CS_MAC_SYMBOL, and
CS_VISCII. Guessed at a preference for the first two and added "sortpriority"
directives. (No idea about VISCII.)

[originally from svn r6641]
[this svn revision also touched charset,filter,halibut,timber]
2006-04-26 23:01:06 +00:00
Jacob Nevins 7958a63147 Sprinkle some header comments in various files in an attempt to explain what
they're for.

[originally from svn r6639]
2006-04-23 18:26:03 +00:00
Jacob Nevins a58cd426b8 PocketPuTTY website moved.
[originally from svn r6638]
2006-04-16 11:15:20 +00:00
Jacob Nevins f3be6ab7ab Everywhere we print an fxp_error(), try to make it clear what we were trying
to do at the time.
(A lot of these say just "canonify:". This isn't a nice thing to show to a
user, but I don't believe canonify() will ever return failure due to a server
error, so users shouldn't actually see it, and it means we have a chance of
tracing it if reported.)

[originally from svn r6636]
2006-04-13 21:18:09 +00:00
Jacob Nevins 1d6f8ae824 Remove login name prompt from PSFTP.
ssh.c will prompt for a login name as required, and doing so in psftp.c
before we've even made a connection is incorrect wrt `bypass-ssh2-userauth'.

[originally from svn r6634]
2006-04-07 21:42:30 +00:00