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

45 Коммитов

Автор SHA1 Сообщение Дата
Simon Tatham 72ff571148 Major destabilisation, phase 2. This time it's the backends' turn:
each backend now stores all its internal variables in a big struct,
and each backend function gets a pointer to this struct passed to
it. This still isn't the end of the work - lots of subsidiary things
still use globals, notably all the cipher and compressor modules and
the X11 forwarding authentication stuff. But ssh.c itself has now
been transformed, and that was the really painful bit, so from here
on it all ought to be a sequence of much smaller and simpler pieces
of work.

[originally from svn r2127]
2002-10-25 11:30:33 +00:00
Simon Tatham 0a80c983e2 Major destabilisation, phase 1. In this phase I've moved (I think)
all the global and function-static variables out of terminal.c into
a dynamically allocated data structure. Note that this does not yet
confer the ability to run more than one of them in the same process,
because other things (the line discipline, the back end) are still
global, and also in particular the address of the dynamically
allocated terminal-data structure is held in a global variable
`term'. But what I've got here represents a reasonable stopping
point at which to check things in. In _theory_ this should all still
work happily, on both Unix and Windows. In practice, who knows?

[originally from svn r2115]
2002-10-22 16:11:33 +00:00
Simon Tatham a24d9d3029 Fix for `hostname-whitespace'; thanks to Justin Bradford.
[originally from svn r2080]
2002-10-16 11:35:13 +00:00
Simon Tatham 6d0e9b205d First phase of porting. pterm now compiles and runs under Linux+gtk.
The current pty.c backend is temporarily a loopback device for
terminal emulator testing, the display handling is only just enough
to show that terminal.c is functioning, the keyboard handling is
laughable, and most features are absent. Next step: bring output and
input up to a plausibly working state, and put a real pty on the
back to create a vaguely usable prototype. Oh, and a scrollbar would
be nice too.
In _theory_ the Windows builds should still work fine after this...

[originally from svn r2010]
2002-10-09 18:09:42 +00:00
Jacob Nevins 01e1450870 Fix pscp-cmdline-port-bug for PSFTP too. (Also removes what appears to be a
gratuitous re-implementation of the "-l user" option.)

[originally from svn r1997]
2002-10-07 17:31:52 +00:00
Jacob Nevins c7fa2f6183 Updated usage messages for command-line utilities to reflect new options.
Updated manual to reflect reality (e.g. usage messages, '-p port' not actually
  implemented, sprinkle references to '-i keyfile').
(I've put "Release 0.53" in the messages; let's hope this doesn't cause a
  flood of "where is 0.53?" email.)
I don't guarantee that the result is entirely sane and sensible in all
  respects, but it is at least consistent.

[originally from svn r1951]
2002-09-11 17:30:36 +00:00
Simon Tatham 118fc8c81e Revamp of command-line handling. Most command line options should
now be processed in cmdline.c, which is called from all utilities
(well, not Pageant or PuTTYgen). This should mean we get to
standardise almost all options across almost all tools. Also one
major change: `-load' is now the preferred option for loading a
saved session in PuTTY proper. `@session' still works but is
deprecated.

[originally from svn r1799]
2002-08-04 21:18:56 +00:00
Simon Tatham ae2599845c Fix major memory leak in sftp_cmd_ls (thanks to Hans-Juergen Petrich
for pointing it out).

[originally from svn r1612]
2002-03-31 16:26:13 +00:00
Simon Tatham dac0d45699 Ensure our network layer is properly cleaned up before PuTTY exits.
Specifically, we explicitly closesocket() all open sockets, which
appears to be necessary since otherwise Windows sends RST rather
than FIN. I'm _sure_ that's a Windows bug, but there we go.

[originally from svn r1574]
2002-03-06 20:13:22 +00:00
Simon Tatham fdbd697801 from_backend() should always be called with len > 0. Only rlogin
mode ever failed to do this, and only Plink actually had a problem
with it, so this didn't become obvious for a while. rlogin mode is
fixed, and all implementations of from_backend() now contain an
assertion so that we should spot errors of this type more quickly in
future.

[originally from svn r1571]
2002-03-01 13:17:45 +00:00
Simon Tatham 6e1ac92194 Oops - get the forward declaration right in that hack
[originally from svn r1566]
2002-02-27 22:30:57 +00:00
Simon Tatham 98dd3cb9f2 Fix silly segfault due to PSFTP thinking connection is fine even if
fxp_init() fails to get initial packet.

[originally from svn r1565]
2002-02-27 22:20:30 +00:00
Simon Tatham 466b1c82d5 Create the long-awaited console.c, and move the common routines out
of scp.c, psftp.c and plink.c into it. Additionally, add `batch
mode', in which all the interactive prompts (bad host key, log file
exists, insecure cipher, password prompt) are disabled and safe
responses are assumed. (The idea being that if you run PSCP, for
example, in a cron job then you'd probably rather it failed and
exited instead of leaving the cron job wedged while it waits for
user input that will never arrive.)

[originally from svn r1525]
2001-12-31 16:15:19 +00:00
Simon Tatham 811b9b7d18 Oops - fputs takes the file pointer second, not first!
[originally from svn r1513]
2001-12-20 14:19:10 +00:00
Simon Tatham e822f2b204 The alphabetical ordering in the psftp command list was broken. D'oh!
[originally from svn r1508]
2001-12-19 18:49:32 +00:00
Simon Tatham 0d7dc070d5 Add the `local' command set to PSFTP: lcd, lpwd, and ! to spawn a
Windows command.

[originally from svn r1501]
2001-12-16 13:33:04 +00:00
Simon Tatham 3ed0d44f16 Retired the #ifdef DUMP_PACKETS stuff in ssh.c because I'm utterly
sick of recompiling to enable packet dumps. SSH packet dumping is
now provided as a logging option, and dumps to putty.log like all
the other logging options. While I'm at it I cleaned up the format
so that packet types are translated into strings for easy browsing.
POSSIBLE SIDE EFFECT: in the course of this work I had to re-enable
the SSH1 packet length checks which it turns out hadn't actually
been active for some time, so it's possible things might break as a
result. If need be I can always disable those checks for the 0.52
release and think about it more carefully later.

[originally from svn r1493]
2001-12-14 14:57:50 +00:00
Simon Tatham 2f67503ad7 Fix trivial problems with PSFTP batch mode
[originally from svn r1483]
2001-12-14 10:06:09 +00:00
Simon Tatham 8ecf3e147d Tidied up PSFTP batch mode. The gross hack using fxp_error_message
to report command failures is now gone; instead each sftp_cmd_*
routine returns 0 or 1 depending on success, like they should have
done right from the start. This fixes problems with `ls' prematurely
terminating PSFTP batch files.

[originally from svn r1481]
2001-12-13 19:26:51 +00:00
Simon Tatham 9cfcab6cb6 Allow PSFTP to be run with no arguments, in which case it enters the
command-line state but all commands are disallowed except `open
host.name'. The idea is to provide marginal extra niceness for
people who double-click the icon without realising it's a cmdline app.

[originally from svn r1480]
2001-12-13 18:42:34 +00:00
Simon Tatham 3270c74f9e Configurable TCP_NODELAY option on network connections
[originally from svn r1428]
2001-11-29 21:47:11 +00:00
Simon Tatham 6608016fc2 INCOMPATIBLE CHANGE to the SSH2 private key file format. There is
now a passphrase-keyed MAC covering _all_ important data in the
file, including the public blob and the key comment. Should
conclusively scupper any attacks based on nobbling the key file in
an attempt to sucker the machine that decrypts it. MACing the
comment field also protects against a key-substitution attack (if
someone's worked out a way past our DSA protections and can extract
the private key from a signature, swapping key files and
substituting comments might just enable them to get the signature
they need to do this. Paranoid, but might as well).

[originally from svn r1413]
2001-11-25 14:31:46 +00:00
Simon Tatham a7f196263e The other utilities should do the same processing of the hostname
(parsing `user@' prefixes etc) that PuTTY proper does.

[originally from svn r1346]
2001-10-30 21:45:27 +00:00
Simon Tatham 39c3f9b8bc Fix pasting of newlines in local line editing mode. Possibly not a
very _good_ fix; something might want doing after the release.

[originally from svn r1277]
2001-09-19 20:07:15 +00:00
Simon Tatham 98af2ddc72 PSFTP: when choosing a default destination filename for `get' and
`put', it makes more sense to pick the _basename_ of the source
rather than use the whole path - particularly when the latter might
cause us to try to use a DOS pathname like `f:\stuff' in a Unix (or
worse, such as VMS!) file system.

[originally from svn r1265]
2001-09-12 20:16:45 +00:00
Simon Tatham 7692bf350a psftp and pscp should disable all forwarding (ports, X, agent).
Partly because that's a good idea _anyway_, and partly because it
seems to be causing trouble. (Specifically, their pathetic attempt
to emulate plink's proper select handling seems to get confused when
the back end tries to open a local listening socket.)

[originally from svn r1264]
2001-09-12 20:11:48 +00:00
Simon Tatham 89e59fc5a3 Add the `pwd' command in PSFTP.
[originally from svn r1262]
2001-09-09 16:31:26 +00:00
Simon Tatham 31eb324fd1 Add online help in PSFTP.
[originally from svn r1261]
2001-09-09 16:29:51 +00:00
Simon Tatham 716d2b1e04 psftp is an interactive program and the ssh.c flags should reflect
this (so we get login banners and a little more verbosity during
authentication).

[originally from svn r1257]
2001-09-09 10:41:42 +00:00
Simon Tatham 6dacf35120 Better yet, look for sftp-server on the user's PATH as well, which
allows individual users with shell access to install it without
reference to the admin.

[originally from svn r1229]
2001-09-05 19:58:25 +00:00
Simon Tatham cb1aa5d0f3 PSFTP will now attempt to find /usr/[local]/lib/sftp-server if it
can't start the sftp subsystem. This should enable convenient sftp
access to SSH1-only systems: all the admin needs is to install
sftp-server in the right place.

[originally from svn r1228]
2001-09-05 19:48:52 +00:00
Simon Tatham 306a13c025 Further tightening up in PSCP. Fixed a couple more holes whereby a
malicious SCP server could have written to areas other than the ones
the user requested; cleared up buffer overruns everywhere. Hopefully
we now do not use arbitrary buffer limits _anywhere_.

[originally from svn r1205]
2001-08-26 15:31:29 +00:00
Simon Tatham 9c5951ed35 More upgrades to psftp: it now supports mv, chmod, reget and reput.
[originally from svn r1203]
2001-08-26 11:35:11 +00:00
Simon Tatham 44c4ee79e6 Jacob's patch for a drag-list to select SSH ciphers. Heavily hacked
by me to make the drag list behaviour slightly more intuitive.
WARNING: DO NOT LOOK AT pl_itemfrompt() IF YOU ARE SQUEAMISH.

[originally from svn r1199]
2001-08-25 19:33:33 +00:00
Simon Tatham c87fa98d09 Extensive changes that _should_ fix the socket buffering problems,
by ceasing to listen on input channels if the corresponding output
channel isn't accepting data. Has had basic check-I-didn't-actually-
break-anything-too-badly testing, but hasn't been genuinely tested
in stress conditions (because concocting stress conditions is non-
trivial).

[originally from svn r1198]
2001-08-25 17:09:23 +00:00
Simon Tatham 4a0fb28883 Patch to PSFTP: implement mkdir, rmdir, rm and scripting. Still to
do: wildcards, chmod, mv, probably other things.

[originally from svn r1168]
2001-08-04 14:19:51 +00:00
Simon Tatham 52a688abd1 The host-key-unknown prompt now offers the same three options as the
host-key-changed prompt: update-cache-and-connect, connect-without-
updating-cache, and abandon-connection. (Previously the middle one
was missing.)

[originally from svn r1122]
2001-05-13 14:11:49 +00:00
Simon Tatham 3730ada5ce Run entire source base through GNU indent to tidy up the varying
coding styles of the various contributors! Woohoo!

[originally from svn r1098]
2001-05-06 14:35:20 +00:00
Simon Tatham 55659a959f ssh_get_password has become ssh_get_line, so it can handle usernames
as well. This should fix the multiple-reads-on-stdin bug in plink.

[originally from svn r994]
2001-03-12 15:31:53 +00:00
Simon Tatham d226659a12 Fix a potential segfault
[originally from svn r958]
2001-03-01 11:49:23 +00:00
Simon Tatham 2b8ab6082f Patches to prevent a couple of silly crashes
[originally from svn r954]
2001-02-27 09:11:42 +00:00
Simon Tatham b10bc57b03 Moderately evil workaround to compensate for a variation in
behaviour of FXP_REALPATH. (Specifically, BSD and GNU realpath(3)
disagree over whether to return success when computing the realpath
for a putative new file to be created in a valid directory. There's
no way we can tell from (say) the OpenSSH version string because
OpenSSH might have been compiled to use the local realpath _or_ its
own nonbroken one.)

[originally from svn r953]
2001-02-26 16:39:15 +00:00
Simon Tatham 39cf689fd6 psftp now works as part of the PuTTY suite
[originally from svn r940]
2001-02-24 16:08:56 +00:00
Simon Tatham 094dd30d95 SFTP client now successfully handles cd, ls, get and put.
[originally from svn r939]
2001-02-24 12:02:35 +00:00
Simon Tatham 48b988b439 First stab at an SFTP client. Currently a Unixland testing app, not
integrated into PuTTY.

[originally from svn r938]
2001-02-23 18:21:44 +00:00