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

4923 Коммитов

Автор SHA1 Сообщение Дата
Simon Tatham 687efc3a5d Change Cairo image surface type from RGB24 to ARGB32.
This seems to work around a GTK 3.22 display bug that Colin Watson and
I have both observed on Ubuntu (though I found that proxying the X
server, e.g. by SSH X forwarding or xtruss, inhibited the bug). The
effect of the bug was that the terminal window would appear completely
black and nothing would ever be displayed in it, though the terminal
session was still actually running and keystrokes would be sent to it.

But changing the call to cairo_set_source_surface() to some other
cairo_set_source_foo caused successful drawing of whatever other
source I selected; the problem seemed specific to the image surface.
Also, when I popped up the Ctrl-right-click menu over the terminal
window, the menu didn't disappear when dismissed, i.e. the drawing
area's redraw operation was not drawing in black, but failing to draw
_anything_.

That led me to hypothesise that the draw event handler for the
terminal drawing area might somehow be accidentally inventing 0 rather
than 255 for the implicit alpha channel when using our RGB-type image
surface as a source; so I tried setting the surface type to one with
an explicit alpha channel in the hope that there would no longer be a
need to make up any alpha value at all. And indeed, that seems to
solve the problem for me, so I might as well commit it.

However, I don't know the full details of what the previous problem
was, so this is only an empirical workaround. If it turns out I was
making some other mistake without which a RGB source surface would
have worked for me, then I should probably revert this and do whatever
other fix turns out to be a better plan.
2017-03-07 23:13:05 +00:00
Simon Tatham af08a7a3b1 Replace deprecated gtk_window_set_wmclass with raw Xlib.
Calling gtk_widget_realize to enforce the existence of an underlying
GdkWindow, followed by gdk_window_ensure_native to enforce an
underlying X window in turn, allows me to get hold of an X window id
on which I can call the Xlib function for setting WM_CLASS, still
before the window is mapped.

With this change, plus Colin's preceding patches, the whole code base
_actually_ compiles and links against GTK 3.22 without any deprecation
warnings. (My claim in commit 8ce237234 that it previously did appears
to have been completely wrong - my guess is that I'd forgotten to
'make clean' before testing against 3.22 and so some source files had
already been compiled against earlier GTK headers.)
2017-03-07 23:13:05 +00:00
Colin Watson 921afd3716 Handle deprecation of gdk_screen_{width,height}
GTK+ 3.22 deprecates gdk_screen_{width,height} on the grounds that the
"screen" here actually refers to a virtual screen that may span multiple
monitors, and applications should generally be considering the width and
height of individual monitors.  It's not entirely clear to me how this
fits with X geometry specifications, but I've gone with trying to get
hold of the geometry of the monitor that the window in question is on.
2017-03-07 23:13:05 +00:00
Colin Watson 8833634f47 Use CSS to set window backgrounds with GTK+ 3
gdk_window_set_background was already deprecated, but with GTK+ 3.22
even gdk_window_set_background_rgba is deprecated, so we need a better
approach.  The best seems to be to go with the flow and inject a custom
CSS style for the appropriate widgets.
2017-03-07 23:13:05 +00:00
Colin Watson 64221972c0 Handle deprecation of gtk_menu_popup
GTK+ 3.22 deprecates gtk_menu_popup in favour of various
gtk_menu_popup_at_* functions.  gtk_menu_popup_at_pointer seems most
appropriate, but that requires being able to pass it a GdkEvent rather
than just some elements of it.  In order to achieve that, I've
rearranged the scroll_event shim to construct a real GdkEventButton and
pass that down to button_internal.
2017-03-07 23:13:05 +00:00
Jacob Nevins 2d0b2e97d0 Restore ability to not send SSH terminal modes.
2ce0b680c inadvertently removed this ability in trying to ensure that
everyone got the new IUTF8 mode by default; you could remove a mode from
the list in the UI, but this would just revert PuTTY to its default.

The UI and storage have been revamped; the storage format now explicitly
says when a mode is not to be sent, and the configuration UI always
shows all modes known to PuTTY; if a mode is not to be sent it now shows
up as "(don't send)" in the list.

Old saved settings are migrated so as to preserve previous removals of
longstanding modes, while automatically adding IUTF8.

(In passing, this removes a bug where pressing the 'Remove' button of
the previous UI would populate the value edit box with garbage.)
2017-03-06 10:36:26 +00:00
Colin Watson 2ef799da4d Install Pageant from unix/Makefile.gtk
I use the Automake system myself, but the older Makefile.gtk system
might as well be kept up to date if it's still available.
2017-03-05 21:01:29 +00:00
Simon Tatham 8ce2372348 Handle GTK 3.22's deprecation of gdk_cairo_create().
Now the whole code base compiles and links successfully against 3.22.
2017-02-27 19:58:39 +00:00
Leonid Lisovskiy 7a0a404eb8 GTK2: Return 2.20 compatibility back
Minimal version of gtk+ 2.24 required to compile PuTTY
after GTK3 prep commits. Provide more compatibility macroses
to allow build against gtk+ 2.20.

Signed-off-by: Leonid Lisovskiy <lly.dev@gmail.com>
2017-02-23 20:03:01 +00:00
Simon Tatham 4c67f0b060 Set our explicit AppUserModelID on our Start Menu shortcut.
This is apparently the other half of what we should have done when we
called SetCurrentProcessExplicitAppUserModelID at run time: it
associates to PuTTY's Start Menu shortcut the same identifier that we
give to the running PuTTY process, so that jump lists saved under the
latter will be visible to users mousing over the former.

I've also done the same thing to the desktop shortcut, just in case
that does anything useful.
2017-02-23 18:28:14 +00:00
Simon Tatham 3f29d939ee Unix buildinfo: stop saying 'GTK' in pure CLI utilities.
Unix PSCP, PSFTP, Plink and PuTTYgen now just report their build
platform as '64-bit Unix' or '32-bit Unix', without mentioning
irrelevant details of what flavour of GTK the other tools in the suite
might have been built against.

(In particular, they now won't imply anything outright untrue if there
was no GTK present at build time at all!)
2017-02-22 22:10:05 +00:00
Simon Tatham 51732faeb9 Windows handle sockets: fix error handling in sentdata().
In the sentdata callback function given to handle_output_new, the
'new_backlog' parameter can be negative, and if so, it represents a
Windows error code and not a backlog size at all. handle_sentdata was
not checking for this before passing it on to plug_sent.
2017-02-22 21:57:04 +00:00
Simon Tatham 86b604dd65 uxproxy: fix write error handling on outgoing pipe.
Jacob pointed out the other day that the call to logevent with NULL
frontend handle can't possibly work, and the comment next to it saying
that it can is an outright lie (probably thoughtlessly copied from
some part of the Windows front end, where it actually would be true).
Furthermore, even if that logevent call didn't dereference NULL and
segfault, the followup call to fatalbox() would be inappropriate,
since proxied connections need not be the primary network connection
of the whole process.

Rewritten as a call to plug_closing, which is the proper channel
through which to report errors on an individual socket or equivalent.
2017-02-22 21:51:03 +00:00
Simon Tatham 9ce982622f Pageant and PuTTYgen About boxes: add the website button.
While I'm looking at these two dialog boxes, I notice there's another
prominent difference between PuTTY's one and these: I also never got
round to adding the button to go to PuTTY's main website. Now added.
2017-02-22 07:06:00 +00:00
Simon Tatham aa68c2872c Pageant and PuTTYgen About boxes: enlarge to modern size.
The current About boxes are too small to fit in all the buildinfo
data, in particular the source-control commit id. Apparently I forgot
to enlarge them when I enlarged the one in PuTTY proper.

(All the same information is nonetheless *present* in the box, but
there seems to be no way to scroll a static text control, so you can
only find that out by 'Select All' and copying to the clipboard.)

Anyway. Now resized to the same dimensions as the main PuTTY About
box. (Really I should centralise more definitions into a common
resource file, but there we go.)
2017-02-22 07:04:34 +00:00
Simon Tatham 19376bd33f Makefile.am: add pageant.1 to the man pages collection.
It wasn't built or installed by the normal make process. Oops.
2017-02-21 22:27:23 +00:00
Simon Tatham 805ef41152 Makefile.am: subset the man pages in --without-gtk mode.
If you configure without GTK so that only the non-GUI tools get built
and installed, it makes sense to also only build and install the same
subset of the man pages.
2017-02-21 22:17:48 +00:00
Simon Tatham 48a8853bde One more CHECKLST update: mirrors have no .htaccess.
Our recommended package for website mirrors doesn't need one any more,
because its latest.html links already point directly to the numbered
release subdirectory. Hence, remove the release-checklist instruction
to check the mirror package's .htaccess, and replace it with an
instruction to check the links in latest.html instead.
2017-02-21 19:00:49 +00:00
Simon Tatham 0415af2ee7 Release-procedure stuff: remove outdated hostname 'atreus'.
The main tartarus.org host has changed since the last release, so we
now have to upload things to somewhere different. Updated the release
automation in release.pl, and all the mentions of atreus in the manual
checklist too.
2017-02-21 18:42:42 +00:00
Simon Tatham 359b5c8eb4 Merge the 0.68 release branchlet to master.
Conflicts in the FAQ are fixed by incorporating Jacob's rewritten
post-0.68 version. (But owing to considerable git confusion I haven't
managed to get his name on to this commit anywhere.)
2017-02-20 20:52:41 +00:00
Simon Tatham 7705fc4470 Fix buffer management in strbuf_catfv.
Thanks to Tim Kosse for pointing out that I had _completely_ cocked up
all the code that was supposed to enlarge the buffer in the strbuf
structure, by failing to pass in 'oldsize' to the innermost
dupvprintf_inner function by reference, so that the size was never
updated.

Fortunately, this whole mechanism was something I dashed off for the
purposes of buildinfo(), which means it's only ever used to glue
together a fixed number of compile-time string constants, for which
there turns out to be plenty to spare in the standard 512 bytes
allocated to a new strbuf. So it's at least not dangerous, though it
clearly needs to be fixed before I make the mistake of using
strbuf_catf[v] for anything else!
2017-02-20 20:46:04 +00:00
Jacob Nevins bd65d47792 New FAQ entry for 32-bit vs 64-bit. 2017-02-19 16:46:23 +00:00
Owen Dunn 4455604dbc Make Windows sockets non-inheritable
When we create a socket with socket() (in try_connect, sk_newlistener, and
ipv4_is_local_addr) also call SetHandleInformation to disable handle
inheritance for this socket.  This fixes dup-sessions-dont-close.
2017-02-19 14:04:58 +00:00
Jacob Nevins efb4996d31 Unix settings can live elsewhere than ~/.putty. 2017-02-18 23:39:14 +00:00
Jacob Nevins 23841fd85e pocketputty.net seems linksquatted.
Get rid of the non-nofollow link in the FAQ. (I doubt anyone's that
interested any more, anyway.)
2017-02-18 23:39:14 +00:00
Owen Dunn 988e26068e Regard dir/ls on non-existent directory as an error.
sftp_cmd_ls - return an error if attempting to open the directory
fails.
2017-02-18 22:51:03 +00:00
Simon Tatham 23fbc4f56b Update version number for 0.68 release.
This commit also updates the dumps of Plink's and PSCP's help output,
adding the -proxycmd option to both and the -shareexists option to
Plink.

(Or rather, _re_-adding the latter, since it was introduced in error
by commit 07af4ed10 due to a branch management error and hastily
removed again in 29e8c24f9. This time it really does match reality.)
2017-02-18 17:09:38 +00:00
Simon Tatham 1c1419bfce Release checklist updates.
These reflect the fact that I'm increasingly preferring to make a
release-candidate build a few days in advance of the actual release,
and give the team time to do a bit of testing on it before putting it
up on the live website. Hence, I can't _quite_ fill in everything in
the website announcement ahead of time - the release date has to wait
until we know what it is, which means I need to have 'now fill in the
release date' as part of the go-live checklist.

Also, I've provided a better bob command for doing a release build
(putting it somewhere safe to begin with, rather than leaving it
precariously in my normal build directory). And while I'm here, I've
standardised all my placeholder version numbers to X.YZ; previously
half of them said 0.XX :-)
2017-02-18 17:09:38 +00:00
Simon Tatham 826c52144a Fix the '--without-gtk' mode in configure.
I had accidentally included the experimental "XT" app class (the
GtkApplication-based packaging of Unix PuTTY/pterm for OS X) among the
things that should still be built even when GTK is absent. That's
definitely wrong.
2017-02-18 17:09:38 +00:00
Jacob Nevins 946b26742a Clear out more XXX-REVIEW-BEFORE-RELEASE. 2017-02-18 17:09:37 +00:00
Simon Tatham 00bcf6ecbc Update documentation for 0.68.
Several places in the docs were labelled for review because they need
to change when 0.68's feature set comes in - no SSH-2 to SSH-1
fallback any more, but on the other hand, Unix Pageant now exists.
2017-02-18 17:09:37 +00:00
Jacob Nevins 4b372b0877 Fix a broken gitweb link. 2017-02-18 09:19:24 +00:00
Simon Tatham 92d855d0fe Implement deferred closing of Windows handle-sockets.
When a handle socket is in THAWING state and handle_socket_unfreeze is
gradually passing the backlogged data on to the plug, the plug might
suddenly turn round and close the socket in the course of handling
plug_receive(), which means that handle_socket_unfreeze had better be
careful not to have had everything vanish out from under it when that
call returns. To solve this, I've added a 'deferred close' flag which
handle_socket_unfreeze can set around its call to plug_receive, and
handle_socket_close will detect that and not actually free the socket,
instead leaving that for handle_socket_unfreeze to do under its own
control.
2017-02-17 08:40:57 +00:00
Jacob Nevins 8d48caa849 Note the interaction of jump lists and -cleanup.
Also note that recent installers don't prompt to -cleanup (this started
with 0.67's MSI installer).
2017-02-17 00:03:11 +00:00
Jacob Nevins 2e5212fb41 Document VS2015 impact on very old Windows.
(In a XXX-REVIEW-BEFORE-RELEASE form.)

Also, note the effect of compilation with different Visual Studio
versions on Windows version compatibility in the source README, for the
sake of having it written down somewhere.
2017-02-16 23:47:03 +00:00
Jacob Nevins 808aa643e6 MSI installer: add version info to product name.
This appears to be conventional, and the full version info for builds
like development snapshots is not visible elsewhere in Control Panel.
2017-02-16 10:08:14 +00:00
Jacob Nevins 2718165f01 Remove references to "Win32" and "32-bit Windows".
They were there mainly to distinguish from 16-bit Windows, which hasn't
been a thing since before a noticeable fraction of the userbase were
born, probably. These days the obvious comparison is with 64-bit
Windows.

Also tweak some wording to reflect that official PuTTY executables are
not necessarily 32-bit any more, and add some XXX-REVIEW-BEFORE-RELEASE
in the same vein.
2017-02-15 23:58:25 +00:00
Simon Tatham 7fd8915ce9 sink(): finish waiting for remote EOF after a local error.
We responded to a local error writing out the destination file by
going into a mode where we just looped round receiving and throwing
away data until our count of the file size reached the file size we
expected - but once we were in that mode, we never actually
incremented the count!
2017-02-15 21:41:28 +00:00
Simon Tatham 5d852585a1 scp_recv_filedata: handle EOF more sensibly.
xfer_download_data could return actuallen as either 0 or -1 to
indicate EOF. Now it's always 0, and scp_recv_filedata actually checks
for that case and reports an error.
2017-02-15 21:39:23 +00:00
Owen Dunn 717129b0f2 Return an error if there's an error doing pscp -ls 2017-02-15 20:54:10 +00:00
Owen Dunn 52a4ccad27 Return zero when reporting our version.
When called with -V to ask for our version, return 0 rather than 1.
This is the usual behaviour observed by ssh(1) and other Unix commands.
Also use exit() rather than cleanup_exit() in pscp.c and psftp.c ; at
this point we have nothing to cleanup!
2017-02-15 20:54:10 +00:00
Simon Tatham fb839a27fb Include the compile-time GTK version in the build info.
It's obvious to the trained eye whether GTK PuTTY was compiled against
GTK2 or GTK3, but the untrained eye would probably appreciate a little
help, and even the trained eye probably can't tell GTK 3.18 from 3.19
at a glance :-)
2017-02-15 19:32:42 +00:00
Simon Tatham 2fb3e26584 Fix multiple bugs in freeze/thaw of Windows handle-sockets.
Firstly, I had asserted that data would never arrive on a handle
socket in state FREEZING, which is just an error, because FREEZING is
precisely the state of not being quite frozen _yet_ because one last
read is still expected to arrive from the winhandl.c reading subthread
which it's too late to cancel. I meant to assert that it wasn't
FROZEN.

Secondly, when the handle socket was in state FREEZING, I failed to
actually _set_ it to FROZEN.

And thirdly, when the handle socket starts thawing again (i.e. there's
now outgoing buffer space so we can start sending our backlogged
data), I forgot to ever call bufchain_consume, so that the same block
of data would get sent repeatedly.

I can only assume that nothing I've ever done has actually exercised
this code!
2017-02-15 19:19:38 +00:00
Simon Tatham 24c9cfc800 Windows Plink: treat EOF at host key prompt as 'abort connection'.
Thanks to Didrik Nordström for pointing out that we currently treated
it as 'whatever happened to be in line[0] before ReadFile didn't get
any data'.
2017-02-15 06:03:50 +00:00
Simon Tatham 1266ac0e30 uxpgnt: correct control flow in find_key().
If we try to interpret a string argument as the name of a key file,
sometimes we it's in circumstances where we _know_ it's a key file, so
we must print an error message and return failure if the file can't be
loaded. Other times it's not, and we just fall back to interpreting
the argument in some other way (e.g. as a pattern match against the
comment or fingerprint of a key already in the agent).

My code dealing with failure returns from the public-key loading
functions were mishandling the latter case, if they identified a file
as existing and looking more or less like some kind of key file but
then it turned out to have a format error; they would try to copy and
return a public key that they didn't actually have. Even if
pageant_pubkey_copy avoided crashing as a result, this would still
inhibit the fallback to treating the input string as some other kind
of pattern match.
2017-02-15 05:47:16 +00:00
Simon Tatham 54720b2c5a Remove a redundant ?: in the nethack_keypad code.
I think all of the cases in this switch must have originally said
(shift_state ? 'this' : 'that'), and in all but the VK_NUMPAD5 case
the two options were different, and I left VK_NUMPAD5 containing a
redundant ?: just to make it line up in a nice table with the others.
But now the others all have more options than that because I had to
support Ctrl as well as Shift modifiers, so there's no reason to have
that silly ?: lingering around (and it annoys Coverity).
2017-02-15 05:47:16 +00:00
Simon Tatham efdbe568e2 A few more missing frees.
Naturally I didn't quite manage to catch _everything_ Coverity
reported to me in my first pass through the results.
2017-02-15 05:47:16 +00:00
Simon Tatham 991d30412d Fixes for winelib building (used by our Coverity build).
Avoided referring to some functions and header files that aren't there
in the winelib world (_vsnprintf, _stricmp, SecureZeroMemory,
multimon.h), and worked around a really amazingly annoying issue in
which Winelib objects to you using the type 'fd_set' unless you
included winsock2.h before stdlib.h.
2017-02-14 23:25:26 +00:00
Simon Tatham bec33b2311 Properly check the lengths of Unix-socket pathnames.
If something is too long to fit in a sun_addr, we should spot that
well in advance and not try.
2017-02-14 23:25:26 +00:00
Simon Tatham a146ab2e7a Tighten up bounds-checking of agent responses.
I think an agent sending a string length exceeding the buffer bounds
by less than 4 could have made PuTTY read beyond its own buffer end.
Not that I really think a hostile SSH agent is likely to be attacking
PuTTY, but it's as well to fix these things anyway!
2017-02-14 23:25:26 +00:00