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

4694 Коммитов

Автор SHA1 Сообщение Дата
Ben Harris ce050c5b72 Fix a luking mention of Win32 in README. 2017-05-08 21:33:03 +01:00
Simon Tatham 6ea9d36ae9 Switch chiark URLs to https. 2017-05-07 16:29:01 +01:00
Simon Tatham ad694a4941 mkfiles.pl: fix regex syntax error.
Thanks to Brian K. White for spotting this straight-up syntax error of
a missing ), in the regex handling the special case of &splitlines
when it findss a word in its input string too long to fit in the
specified output line width. Apparently in all my own uses of
&splitline I'd never exercised that special-case code path before.
2017-05-01 06:53:06 +01:00
Jacob Nevins b566c5f125 Add a cast to fix a warning.
This fixes compilation with Gtk 2 with -Werror. Problem introduced by
64221972c.
2017-04-30 12:06:17 +01:00
Zero King 230f7d5628 Fix thinko introduced in 8833634f4.
This prevented compilation with Gtk 2.
2017-04-30 11:01:13 +01:00
Jacob Nevins fb023da0fd Be less vague in the description of IUTF8. 2017-04-30 10:42:02 +01:00
Jacob Nevins ed600ab23f Fix double negative in TTY mode docs. 2017-04-29 14:24:17 +01:00
Jacob Nevins 5a576e0c89 Reinstate use of ToUnicodeEx().
This was accidentally disabled by 73039b783, causing a regression in
ability to type characters outside of the current Windows code page.
2017-04-29 12:07:37 +01:00
Simon Tatham d6d10932ac Release checklist update: no @releases array!
The rewritten bugs2html.py in the wishlist repository no longer needs
me to manually maintain a mapping between releases and version control
- and the one thing I forgot was to remove the reminder in the release
checklist telling me to keep that mapping up to date :-)
2017-04-29 10:23:31 +01:00
Simon Tatham b1829b81b5 Update version number for 0.69 release. 2017-04-24 14:45:52 +01:00
Simon Tatham f77ee39e8c Load comctl32.dll (for drag lists) at run time.
This too is not in the list of known DLLs on Windows 10. I don't know
of any actual viable hijacking attack based on it, which according to
my reading of MSDN (specifically, a rather vague hint in
https://msdn.microsoft.com/library/ff919712) _may_ be because we
mention the common controls assembly in our application manifest; but
better safe than sorry.

Now the entire list of remaining DLLs that PuTTY links against at load
time is a subset of the Win10 known DLLs list, so that _should_ mean
that everything we load before we've deployed our own defence
(SetDefaultDllDirectories) is defended against for us by Windows
itself.
2017-04-16 16:59:41 +01:00
Simon Tatham 793ac87275 Load the Windows printing subsystem at run time.
The printing functions are split between winspool.drv and spoolss.dll
in a really weird way (who would have guessed that OpenPrinter and
ClosePrinter don't live in the same dynamic library?!), but _neither_
of those counts as a system 'known DLL', so linking against either one
of these at load time is again a potential DLL hijacking vector.
2017-04-16 16:59:37 +01:00
Simon Tatham 73039b7831 Load winmm.dll (for PlaySound()) at run time.
It's not on the default list of important system 'known DLLs' stored
at HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\KnownDLLs (see
https://isc.sans.edu/forums/diary/DLL+hijacking+vulnerabilities/9445/ )
which apparently makes it exempt from Windows's standard DLL hijacking
defence, i.e. if an executable links against it in the normal way then
that executable will be vulnerable to DLL hijacking from a file called
winmm.dll in the same directory as it.

The solution is to load it dynamically _after_ we've locked down our
DLL search path, which fortunately PuTTY's code base is well used to
doing already for other DLLs.
2017-04-16 16:58:01 +01:00
Simon Tatham b189df947d Condition out some API type-checks in the MinGW build.
A couple of the functions for which I was already turning off the type
check for old Visual Studio turn out to also need it turning off for
MinGW.
2017-04-15 18:13:47 +01:00
klemens 89fff90de7 Spelling fixes (just in comments).
As found by a bot ( http://www.misfix.org,
https://github.com/ka7/misspell_fixer ).
2017-04-15 17:47:10 +01:00
Simon Tatham 49fb598b0e Add automatic type-checking to GET_WINDOWS_FUNCTION.
This gives me an extra safety-check against having mistyped one of the
function prototypes that we load at run time from DLLs: we verify that
the typedef we defined based on the prototype in our source code
matches the type of the real function as declared in the Windows
headers.

This was an idea I had while adding a pile of further functions using
this mechanism. It didn't catch any errors (either in the new
functions or in the existing collection), but that's no reason not to
keep it anyway now that I've thought of it!

In VS2015, this automated type-check works for most functions, but a
couple manage to break it. SetCurrentProcessExplicitAppUserModelID in
winjump.c can't be type-checked, because including <shobjidl.h> where
that function is declared would also bring in a load of other stuff
that conflicts with the painful manual COM declarations in winjump.c.
(That stuff could probably be removed now we're on an up-to-date
Visual Studio, on the other hand, but that's a separate chore.) And
gai_strerror, used in winnet.c, does _have_ an implementation in a
DLL, but the header files like to provide an inline version with a
different calling convention, which defeats this error-checking trick.
And in the older VS2003 that we still precautionarily build with,
several more type-checks have to be #ifdeffed out because the
functions they check against just aren't there at all.
2017-04-11 18:56:55 +01:00
Christopher Odenbach 3ff3be3882 Fix loading of SSPICLI.DLL by SECUR32.DLL.
If MIT Kerberos is installed, then using GetProcAddress to extract
GetUserNameExA() from secur32.dll causes Windows to implicitly load
sspicli.dll in turn - and it does it in a search-path-unclean way.

If we load it in our own way before that happens, then Windows doesn't
need to load it again and won't do so wrongly.

[SGT: tidied up commit message from original patch]
2017-04-11 18:43:15 +01:00
Christopher Odenbach 802b4edf4d Fixed GSSAPI authentication.
gssapi32.dll from MIT Kerberos as well as from Heimdal both load
further DLLs from their installation directories.

[SGT: I polished the original patch a bit, in particular replacing
manual memory allocation with dup_mb_to_wc. This required a Recipe
change to link miscucs.c and winucs.c into more of the tools.]
2017-04-08 21:27:28 +01:00
Simon Tatham d2653e79ab Fix bug in Poly1305 bigval_final_reduce().
Mark Wooding pointed out that my comment in make1305.py was completely
wrong, and that the stated strategy for reducing a value mod 2^130-5
would not in fact completely reduce all inputs in the range - for the
most obvious reason, namely that the numbers between 2^130-5 and 2^130
would never have anything subtracted at all.

Implemented a replacement strategy which my tests suggest will do the
right thing for all numbers in the expected range that are anywhere
near an integer multiple of the modulus.
2017-04-08 21:27:28 +01:00
Simon Tatham 61f668aa5c Reformat the composetbl[] array in winucs.c.
I scrolled past it just now and decided those open braces at the ends
of the lines are just too ugly to live. They originally got that way
when I put the whole source base through GNU indent, which as far as
I'm concerned is a horrible misfeature of indent!
2017-04-08 15:10:57 +01:00
Owen Dunn 142a458fee Add blank line at bottom of .reg files we generate
The specification at http://support.microsoft.com/kb/310516 says .reg
files should have a blank line at the end.
2017-03-17 10:11:20 +00:00
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