simon-git: doit (master): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Thu Nov 23 09:17:04 GMT 2017
TL;DR:
75b4d54 Fix some 64-bit-cleanliness issues reported by mingw.
15e8d73 Include more detail in server-side error messages.
a2261b9 Include the input pathname in ShellExecute failure messages.
b69bae5 Preliminary check of the SetDirectory argument.
f2f9165 Revamp reporting of network protocol errors.
bb4ebee Detect and diagnose shared-secret mismatch at connection start.
d974256 Fix stray 1997 in About box copyright notice.
3e5014e Update copyright dates.
7689089 Compile on Windows with /D_CRT_SECURE_NO_WARNINGS.
5edea5c Usefully diagnose absence of a shared secret.
ead801c doit.exe: command-line option to show the About box.
4450822 Report the protocol version in both programs.
71407c2 Improve uniqueness of protocol nonces.
Repository: https://git.tartarus.org/simon/doit.git
On the web: https://git.tartarus.org/?p=simon/doit.git
Branch updated: master
Committer: Simon Tatham <anakin at pobox.com>
Date: 2017-11-23 09:17:04
commit 75b4d5449e78ba2f0eae77d51631bc1e94f3280d
web diff https://git.tartarus.org/?p=simon/doit.git;a=commitdiff;h=75b4d5449e78ba2f0eae77d51631bc1e94f3280d;hp=bace7aa0b0cebc54ab15b1bd47fef32ec25d2194
Author: Simon Tatham <anakin at pobox.com>
Date: Wed Nov 22 20:46:43 2017 +0000
Fix some 64-bit-cleanliness issues reported by mingw.
A bit embarrassing that DoIt was already being built as 64-bit and I
hadn't found and fixed these yet! Oh well, better late than never.
doit.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
commit 15e8d73562200bd3166939761a114ecb2f26a070
web diff https://git.tartarus.org/?p=simon/doit.git;a=commitdiff;h=15e8d73562200bd3166939761a114ecb2f26a070;hp=75b4d5449e78ba2f0eae77d51631bc1e94f3280d
Author: Simon Tatham <anakin at pobox.com>
Date: Wed Nov 22 20:48:52 2017 +0000
Include more detail in server-side error messages.
Previously, most of the failure reports sent back from the DoIt server
to the client were constructed as straightforward string literals, and
didn't give nearly as much information as you'd have liked about what
had actually gone wrong. Now I'm building most messages up in a new
'struct msgbuf', i.e. an expandable string buffer, and that gives me
the freedom to include more detail about what the server was trying to
do and what Windows error code caused it to fail to do it.
doit.c | 176 ++++++++++++++++++++++++++++++++++++++++++++++++-----------------
1 file changed, 131 insertions(+), 45 deletions(-)
commit a2261b9c28ad128c44bafe8b6424edfeb4c6c7ab
web diff https://git.tartarus.org/?p=simon/doit.git;a=commitdiff;h=a2261b9c28ad128c44bafe8b6424edfeb4c6c7ab;hp=15e8d73562200bd3166939761a114ecb2f26a070
Author: Simon Tatham <anakin at pobox.com>
Date: Wed Nov 22 20:50:56 2017 +0000
Include the input pathname in ShellExecute failure messages.
That should make it easier to diagnose the problem, if the real reason
why ShellExecute failed was because of pathname mistranslation (or
straight-up _non_-translation).
doit.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++++-----------------
1 file changed, 51 insertions(+), 17 deletions(-)
commit b69bae52e456d118f7b27c9b0748e4ae2ae8552f
web diff https://git.tartarus.org/?p=simon/doit.git;a=commitdiff;h=b69bae52e456d118f7b27c9b0748e4ae2ae8552f;hp=a2261b9c28ad128c44bafe8b6424edfeb4c6c7ab
Author: Simon Tatham <anakin at pobox.com>
Date: Wed Nov 22 20:52:11 2017 +0000
Preliminary check of the SetDirectory argument.
Another very common cause of incomprehensible DoIt server errors is
that a CreateProcess call fails because the pathname given as its cwd
is invalid (again, often due to non-translation on the client side).
Now when we receive a SetDirectory prefix call, we check whether its
argument _is_ a directory, and if not, we construct a sensible error
message that will actually say that instead of just reporting what
went wrong in the subsequent CreateProcess.
Because some of the process-creation commands expect the command's
output to be sent before the error message, we can't just return that
error message as soon as the bogus SetDirectory is received; instead,
we stash it as a 'setup error', and return that in place of the
follow-up error _after_ whatever else the protocol requires us to
send.
doit.c | 32 +++++++++++++++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)
commit f2f9165d2549bc242dee05f363e409c1f5198bcb
web diff https://git.tartarus.org/?p=simon/doit.git;a=commitdiff;h=f2f9165d2549bc242dee05f363e409c1f5198bcb;hp=b69bae52e456d118f7b27c9b0748e4ae2ae8552f
Author: Simon Tatham <anakin at pobox.com>
Date: Wed Nov 22 21:57:15 2017 +0000
Revamp reporting of network protocol errors.
doitlib.c's main handler function for incoming data now returns a
textual error message in place of a simple -1, so that the client can
actually print some useful indication of _what_ went wrong in the
protocol. The other job of that return value - giving the current
amount of buffered plaintext - now belongs to a separate function
doit_buffered(), which is more sensible anyway because now it's
impossible to get the two kinds of return value confused (which I
think happened in at least one place in the old code).
doit.c | 41 +++++++++++++++++++------------
doit.h | 15 ++++++++----
doitclient.c | 80 +++++++++++++++++++++++++-----------------------------------
doitlib.c | 46 +++++++++++++++++++++-------------
4 files changed, 98 insertions(+), 84 deletions(-)
commit bb4ebee7758979cd9fbecef71ada1162fea15208
web diff https://git.tartarus.org/?p=simon/doit.git;a=commitdiff;h=bb4ebee7758979cd9fbecef71ada1162fea15208;hp=f2f9165d2549bc242dee05f363e409c1f5198bcb
Author: Simon Tatham <anakin at pobox.com>
Date: Wed Nov 22 21:57:25 2017 +0000
Detect and diagnose shared-secret mismatch at connection start.
This is a protocol change, the first in a very long time (so users
will need to upgrade both client and server in sync, per the warning
I've had on the web page all along). I've started by introducing a
protocol version field at the very start of the connection, so that
future version mismatches can be reliably diagnosed. Then each side
sends the same nonce as before, but accompanies it with a (two-layer)
hash of the nonce and the shared secret, so that if the shared secrets
simply aren't the same, we can diagnose that right at the start of the
connection and give an error message that provides some kind of hint
about what might have gone wrong.
doit.h | 8 +--
doitlib.c | 223 ++++++++++++++++++++++++++++++++++++++---------------------
doitprot.txt | 21 ++++++
3 files changed, 169 insertions(+), 83 deletions(-)
commit d974256e26acb94e62ce335fbd7b273da3c5920a
web diff https://git.tartarus.org/?p=simon/doit.git;a=commitdiff;h=d974256e26acb94e62ce335fbd7b273da3c5920a;hp=bb4ebee7758979cd9fbecef71ada1162fea15208
Author: Simon Tatham <anakin at pobox.com>
Date: Thu Nov 23 06:21:46 2017 +0000
Fix stray 1997 in About box copyright notice.
Every _other_ copy of the copyright notice in this source base, along
with the git history, says I actually started this project in 2000,
not 1997. I think the 1997 must have been an accidental copy-paste
from a previous project that used a similar piece of Windows .rc file
for its About box, and I pasted in the revised actual licence but
forgot to adjust the extra copy of the copyright date.
doit.rc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
commit 3e5014e05e44f037146f4ec76f9b25243f1619e6
web diff https://git.tartarus.org/?p=simon/doit.git;a=commitdiff;h=3e5014e05e44f037146f4ec76f9b25243f1619e6;hp=d974256e26acb94e62ce335fbd7b273da3c5920a
Author: Simon Tatham <anakin at pobox.com>
Date: Thu Nov 23 06:24:02 2017 +0000
Update copyright dates.
On all the individual source files I've just touched, and on the
program as a whole as shown in LICENCE and the About dialog.
(That leaves only listener.c un-updated, which I think is right.)
LICENCE | 2 +-
doit.c | 2 +-
doit.rc | 4 ++--
doitclient.c | 2 +-
doitlib.c | 2 +-
5 files changed, 6 insertions(+), 6 deletions(-)
commit 76890895349378df2859888079282dfbdc742486
web diff https://git.tartarus.org/?p=simon/doit.git;a=commitdiff;h=76890895349378df2859888079282dfbdc742486;hp=3e5014e05e44f037146f4ec76f9b25243f1619e6
Author: Simon Tatham <anakin at pobox.com>
Date: Thu Nov 23 06:47:22 2017 +0000
Compile on Windows with /D_CRT_SECURE_NO_WARNINGS.
The Windows warnings are annoying anyway ('fopen is deprecated'?!) and
this gets them out of the way in my build logs so that I can see the
real errors more easily.
Makefile.vc | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
commit 5edea5c1dc2e0f3df0e097d53520dc6e9353ebba
web diff https://git.tartarus.org/?p=simon/doit.git;a=commitdiff;h=5edea5c1dc2e0f3df0e097d53520dc6e9353ebba;hp=76890895349378df2859888079282dfbdc742486
Author: Simon Tatham <anakin at pobox.com>
Date: Thu Nov 23 07:01:44 2017 +0000
Usefully diagnose absence of a shared secret.
If the DoIt server can't load its secret file, it will now put up a
message box, and then try again on the next connection attempt (even
if not in -r mode).
Also, I've added a protocol feature to report a 'service unavailable'
message to the client, so that there's at least some user-friendliness
if you find your server is in this state.
doit.c | 46 ++++++++++++++++++++++++++++++++++++++--------
doitlib.c | 59 +++++++++++++++++++++++++++++++++++++++++++----------------
doitprot.txt | 12 +++++++++++-
3 files changed, 92 insertions(+), 25 deletions(-)
commit ead801ca46e47f70d4c27c639c7549654ec92845
web diff https://git.tartarus.org/?p=simon/doit.git;a=commitdiff;h=ead801ca46e47f70d4c27c639c7549654ec92845;hp=5edea5c1dc2e0f3df0e097d53520dc6e9353ebba
Author: Simon Tatham <anakin at pobox.com>
Date: Thu Nov 23 07:07:19 2017 +0000
doit.exe: command-line option to show the About box.
Closest thing a Windows GUI program can get to --version.
doit.c | 6 ++++++
1 file changed, 6 insertions(+)
commit 44508229a64180ef9e2a06837794686cc9ffb535
web diff https://git.tartarus.org/?p=simon/doit.git;a=commitdiff;h=44508229a64180ef9e2a06837794686cc9ffb535;hp=ead801ca46e47f70d4c27c639c7549654ec92845
Author: Simon Tatham <anakin at pobox.com>
Date: Thu Nov 23 07:11:14 2017 +0000
Report the protocol version in both programs.
doitclient --version and doit.exe's About box now both give the hex
version number of the network protocol, so that after you get a
'protocol version mismatch' error you can more easily go looking for a
version of one end or the other that reports itself as the _right_
version.
doit.c | 14 ++++++++++++--
doit.h | 5 +++++
doit.rc | 9 +++++----
doitclient.c | 2 ++
doitlib.c | 5 +++++
5 files changed, 29 insertions(+), 6 deletions(-)
commit 71407c20c515a48082e0e03a026fe03112618b33
web diff https://git.tartarus.org/?p=simon/doit.git;a=commitdiff;h=71407c20c515a48082e0e03a026fe03112618b33;hp=44508229a64180ef9e2a06837794686cc9ffb535
Author: Simon Tatham <anakin at pobox.com>
Date: Thu Nov 23 08:03:00 2017 +0000
Improve uniqueness of protocol nonces.
I was a bit unhappy about time(NULL) being the form of timestamp used
for uniqueness. Now we use a high-resolution timer on both Windows and
Linux, and also bake in a few other local things like process ids at
both ends rather than just on Windows.
To make this easier, I revamped the API for retrieving nonce preimage
data so that it's now called from doitlib.c. An effect of this is that
it would be more hassle to make the nonce preimage depend on the
client's network connection source address, which was a thing I _was_
previously doing on the server side. But I don't think that's
particularly important, and I've replaced it with an incrementing
counter which should be enough all by itself to ensure that two nearby
connections made to the same server process won't manage to give the
same nonce.
doit.c | 21 +++++++++++++++++----
doit.h | 8 ++++++--
doitclient.c | 19 ++++++++++++++-----
doitlib.c | 24 +++++++++++++-----------
4 files changed, 50 insertions(+), 22 deletions(-)
More information about the tartarus-commits
mailing list