John Hood
f89f1da0b5
Log/limit pselect() with timeout of 0
...
This is not a fix for bad timeouts, but rather a band-aid
to keep Mosh from consuming large amounts of CPU time.
2016-11-06 06:15:41 -05:00
John Hood
444eae1fc4
Add tests to run Mosh repeatedly.
2016-11-06 06:15:41 -05:00
John Hood
22f5d58144
Exit gracefully on pty write or ioctl failure.
...
Fixes #821 , OS X abnormal exit on client input at mosh-server
shutdown. On OpenIndiana, TIOCG[GS]WINSZ also fail in this situation.
2016-11-06 06:14:02 -05:00
John Hood
4bc9e5c6ab
Handle printing to closed pipes better in tests.
...
Some systems do not deliver SIGPIPE to shell pipeline writers when the
downstream reader has exited. So, also check for errors from
/bin/printf. I fixed this for OpenBSD 6.0 but I think it will also
fix posh on Linux.
2016-11-06 06:09:49 -05:00
John Hood
795549aafb
OpenIndiana pid_t is long int
2016-11-06 06:09:49 -05:00
John Hood
dd9ee1c4b7
Remove unused include
2016-11-06 02:47:20 -05:00
Anders Kaseorg
b76d1bd526
e2e-test: Add newline to “unknown test type argument” error
...
Signed-off-by: Anders Kaseorg <andersk@mit.edu >
2016-11-04 03:15:03 -04:00
Anders Kaseorg
8a8f2b29ca
Fix most shell hygiene issues found by shellcheck
...
Signed-off-by: Anders Kaseorg <andersk@mit.edu >
2016-11-04 03:15:03 -04:00
John Hood
9005ea6cf3
Use a table lookup for base64 decode
2016-10-29 20:50:33 -04:00
Jakub Wilk
42d686882f
Fix typos
2016-10-09 16:04:42 +02:00
John Hood
f429fd38b0
Use old AppleCommonCrypto name for AES
2016-09-25 22:24:03 -04:00
John Hood
477729b315
tests: improve robustness
...
Replace some blind timeouts with actual synchronization.
Improve performance on some slow tests.
Tweak some of the remaining timeouts.
This still isn't good enough to get 'make -j9 check'
working reliably on Cygwin for me; I think some Cygwin/
Windows scheduling issues remain.
2016-09-20 06:25:43 -04:00
John Hood
e734d5e41a
tests: Work around tmux display corruption bug on OpenBSD.
...
See https://github.com/tmux/tmux/issues/539
2016-09-19 13:23:16 -04:00
John Hood
1077db41b6
Support OpenBSD 6.0 pledge() syscall for sandboxing.
2016-09-19 13:23:16 -04:00
John Hood
5619dd47bb
tests: fix incorrect usage of "trap ... SIGHUP"
...
Discovered with OpenBSD 6.0 /bin/sh
2016-09-19 13:23:16 -04:00
John Hood
39ea3d9512
Fix excess newlines on mosh startup/shutdown.
...
Fixes #788 .
This also works around issues with remote pty typeahead echo corrupting output
from mosh-server.
2016-09-19 13:23:16 -04:00
John Hood
70d48fbcc0
Add --no-ssh-pty option.
...
This eliminates issues with typeahead being echoed by the remote pty
and corrupting remote output from mosh-server to the mosh script, but
cannot be made default because older mosh-servers require a pty.
2016-09-19 13:23:15 -04:00
John Hood
8945efeb82
Allow server to bind an OS-selected UDP port with -p 0.
...
It looks like Mosh used to be able to do this but the capability was
lost when port ranges were added in 141ec23 .
2016-09-19 13:23:15 -04:00
John Hood
c599987ff8
Fix object sizing for PMTUD setsockopt() and recvmsg().
...
Also cleans up other setsockopt() calls, and buffer sizing/handling
for recvmsg().
These are minor errors and no actual misbehavior was observed.
Discovered while working Windows Subsystem for Linux compatibility
issues.
2016-09-19 13:23:15 -04:00
John Hood
4ad131a55d
Fix lost MOSH CONNECT on FreeBSD 11
...
This moves all routine stdout/stderr output into the parent
server, and adds tcdrain(), even though this may be a
FreeBSD pty bug.
2016-09-18 01:53:36 -04:00
Keith Winstein
da7c87a822
Add test for nonce incrementing
2016-08-10 04:49:52 -07:00
John Hood
8211b88420
Don't use user's .tmux.conf
...
It may contain configuration that breaks our testing.
2016-07-21 01:19:23 -04:00
John Hood
ece4280401
Reduce IPv4 MTU to 1280.
...
Seems to fix #773 .
2016-07-12 01:06:01 -04:00
John Hood
e89c4fcb65
update .gitignores
2016-05-24 18:43:51 -04:00
john hood
5bc1c6c032
include-once -impl files
2016-05-14 02:58:07 -04:00
John Hood
882539884e
Remove unnecessary usage of #include <iostream>. Rename templated impls from .cc to -impl.h.
2016-05-14 00:10:59 -04:00
John Hood
dfdfa5d9b0
FreeBSD TOS issues
2016-05-14 00:05:41 -04:00
John Hood
dcd04850f0
Fix memory leak in window resize
2016-05-13 01:22:47 -04:00
john hood
70c62c5a94
#include <memory> for std::shared
2016-05-11 00:51:00 -04:00
John Hood
c1ca7e46a5
Coverity fixes: do { ...; continue; ... } while (false)
...
This is more stylistic than substantial, but it's bad enough
style to be worth fixing.
2016-05-11 00:03:37 -04:00
John Hood
9a6e0d576d
Coverity fixes: deref of NULL pointers
...
We were potentially passing (char *)NULL to string constructors.
2016-05-10 23:58:56 -04:00
John Hood
da30bb74a2
Coverity fixes: deref of stale pointer
...
I think this one was actually impossible to trigger.
2016-05-10 23:57:29 -04:00
John Hood
c027112a88
Coverity fixes: uncaught exceptions
2016-05-10 23:55:56 -04:00
John Hood
25a65fc071
Coverity fixes: tainted/unbounded array index
2016-05-10 23:54:41 -04:00
John Hood
ec6980da96
GCC 6 fixes.
...
Should resolve https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=811579
Resolves #719 .
2016-05-10 00:14:22 -04:00
Jaeho Shin
d636845c8d
Display original command line argv via no-op flag.
...
Improves 679b819216 to make it simpler to
ignore mosh-client from OS X Terminal.app's "Ask before closing" process
list. (See: http://superuser.com/a/254647 )
Moreover, the command displayed from ps is a completely functional one,
which was not the case in the previous approach, that mangles `argv[0]`.
Fixes #742 .
2016-05-08 23:05:36 -04:00
John Hood
880c639361
Include POSIX header strings.h for strncasecmp()
...
Motivated by Cygwin.
2016-05-08 20:46:58 -04:00
john hood
9073983df3
crypto.cc: prefer bswap64() and ffs() if available.
...
Fixes #745 .
2016-05-08 20:45:01 -04:00
John Hood
f30738e325
Update test documentation.
2016-04-07 20:26:08 -04:00
John Hood
bd2e8fc746
Improve test script performance, note issues with slow machines
2016-04-07 20:26:08 -04:00
John Hood
2ba5d2bbb2
Handle zero-length allocations in AlignedBuffer.
2016-03-31 10:41:00 -04:00
John Hood
7af87d85cc
Remove redundant stringification for decrypt().
2016-03-30 23:52:19 -04:00
John Hood
c964d40dd8
Do not throw from destructors, fatal_assert() instead.
2016-03-30 23:52:19 -04:00
John Hood
49a4106ae4
src/tests: clean up duplicate code
2016-03-30 23:52:19 -04:00
John Hood
ed92637f25
Use snprintf(), not sprintf()
...
Found by OpenBSD build.
2016-03-30 23:52:19 -04:00
John Hood
d4832ca63a
Fix bugs in resize handling.
...
* A resize action could be applied to the framebuffer but discarded
before being applied to termios, causing them to be out of sync.
* Only every second action was skipped, instead of skipping
consecutive resize actions, as intended.
Found by inspection, not seen in actual usage or by the window-resize
test.
2016-03-30 23:52:19 -04:00
John Hood
255dc39c9f
Factor encrypt/decrypt out of Network::Message.
2016-03-30 23:52:19 -04:00
John Hood
6abd4739de
Const correctness and const-ref in Crypto and elsewhere.
2016-03-30 23:52:19 -04:00
John Hood
13928e9c10
Use a secure counter for OCB's nonce. Protect nonce in Network::Packet.
2016-03-30 23:52:19 -04:00
John Hood
1de6575e59
mosh-server.cc: Do not start user shell until network session starts
2016-03-30 23:52:19 -04:00