Michael Jarvis
21d5dca682
Use HAVE_UTEMPTER instead of HAVE_UPTEMPTER
...
Fix typo for issue #942 :
- mosh-server incorrectly reports detached session in utmp/wtmp
2017-11-21 06:05:33 -06:00
John Hood
ce7ba37ad4
Overlays were getting set to the wrong colors. Fix.
2017-11-06 09:30:57 -05:00
Tom Judge
ab31b0f271
Add syslog logging of connections
...
Log connection change events to syslog in the auth log, logging the PID,
username and remote host.
Also log session begin and end.
Co-Authored-By: John Hood <cgull@glup.org >
2017-11-05 11:54:43 -05:00
John Hood
cf493da7b4
Make Terminal::Renditions smaller, and its members private.
2017-11-04 14:37:11 -04:00
John Hood
b11d524bb7
Restore asserts and error handling
...
A couple of them got improved out of existence.
2017-08-23 15:09:43 -04:00
John Hood
a40b67691a
Remove various assert(constant) calls
...
These cause warnings from static checkers, and seem to lead to spurious
GCC7 -Wmaybe-uninitialized.
2017-08-06 23:12:05 -04:00
John Hood
4835dcf5ee
Various switch statement fixes.
2017-08-06 22:22:25 -04:00
John Hood
3346419724
Remove excessive parentheses
...
There are many more.
2017-08-06 22:22:20 -04:00
John Hood
1ae23b4dcc
Prefer early exit/break to large conditional blocks.
...
Some of these are large and contain smaller unrelated refactors.
2017-08-06 22:22:09 -04:00
John Hood
b1a6f7c144
Eliminate unnecessary, trailing else conditional blocks.
2017-08-06 22:22:05 -04:00
John Hood
43785eb820
Collapse nested conditionals.
2017-08-06 22:21:56 -04:00
John Hood
8ca8a54e11
Split a long printf format string.
2017-08-06 22:21:38 -04:00
John Hood
2b724d5868
Simplify some conditionals in terminaloverlay.cc.
2017-08-02 22:56:19 -04:00
John Hood
42d2b5d029
Use shared_ptr and references for Actions.
...
This slows terminal emulation slightly.
2017-08-02 22:07:02 -04:00
John Hood
c6c7f09954
Deref a shared pointer in a per-byte loop
2017-08-02 22:07:02 -04:00
John Hood
8f68400c13
Convert new/delete to shared_ptr.
2017-08-02 22:07:02 -04:00
John Hood
eef77fd5a5
Convert strdup/free to string
2017-08-02 22:07:02 -04:00
John Hood
4902970486
Fix utempter #ifdefs.
2017-08-02 22:07:02 -04:00
John Hood
c49c67cecf
--predict-overwrite was still inserting one column sometimes. Fix.
2017-08-02 21:56:32 -04:00
John Hood
8aac3cc927
Allow non-inserting prediction.
...
This may be useful for users who find prediction's activity right of
the cursor distracting.
Prediction underscoring is still a little weird sometimes, it replays
a history of known/unknown changes as acks come in from the server.
2017-08-02 00:31:37 -04:00
John Hood
91de8901f5
Don't do prediction on large pastes into mosh-client.
...
Fixes #482 , memory use blowup on large pastes. mosh is still pretty slow
about copying pastes through, though.
2017-08-02 00:31:37 -04:00
John Hood
48e9dd169f
Reformat printed strings in source
...
Consolidate multiple printfs.
Break up multiline strings with string concatentation, for better
clarity and shorter lines.
Use fputs where appropriate.
This also has the benefit of producing a single constant string with
copyright and versions in the binaries.
2017-08-02 00:02:52 -04:00
Adrien Destugues
aa74af9a34
Fix build on Haiku.
...
- Look for socket in libnetwork
- Look for forkpty in libbsd
2017-04-24 22:40:31 -04:00
John Hood
32b1e6ee4b
Print {,/var}/run/motd.dynamic on Ubuntu.
2017-04-24 22:40:30 -04:00
John Hood
3f0ac51071
Don't print /etc/motd on IllumOS.
2017-04-24 22:40:30 -04:00
Jérémie Courrèges-Anglas
c0bf8053b2
Remove deprecated pledge("ioctl")
...
Unbreaks mosh on recent (> 2017/03/18) OpenBSD systems.
2017-03-20 09:54:33 -04:00
John Hood
a993c83632
Handle GCC 7's new -Wimplicit-fallthrough.
2017-01-31 22:12:27 -05:00
John Hood
bb54325dc9
s/geteuid/getuid/ for correct user lookups
...
Addresses an issue mentioned in #193 .
2016-11-23 17:03:45 -05:00
John Hood
24eb5a7544
Remove a Network::Exception that isn't one.
...
Code smell pointed out by Coverity.
2016-11-19 21:11:04 -05:00
Anders Kaseorg
94027efc45
Make all commands properly support --help and --version
...
These should output to stdout and exit with status 0. Passing
std-options to AM_INIT_AUTOMAKE causes ‘make installcheck’ (hence also
‘make distcheck’) to verify this.
Signed-off-by: Anders Kaseorg <andersk@mit.edu >
2016-11-19 17:15:48 -05:00
John Hood
302c7deb41
Describe Cell width as a narrow/wide boolean.
...
A character cell can only be either narrow or wide. It's more
convenient to represent that as an int containing 1 or 2, but slightly
more correct to represent it as a "boolean" single-bit integer.
2016-11-17 00:56:31 -05:00
John Hood
9ffbeddbc8
Put spin debug under -vv flag, and add to mosh-client
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
795549aafb
OpenIndiana pid_t is long int
2016-11-06 06:09:49 -05:00
John Hood
1077db41b6
Support OpenBSD 6.0 pledge() syscall for sandboxing.
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
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
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
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
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
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
1de6575e59
mosh-server.cc: Do not start user shell until network session starts
2016-03-30 23:52:19 -04:00
John Hood
ca21788c96
Remove usage of exceptional fdsets with select().
2016-01-11 04:35:21 -05:00
John Hood
2ac3bbeb9b
Fix prediction unicode bug. Make all Cell members private.
...
Fixes #702 .
2015-12-24 22:27:17 -05:00
John Hood
90a529b18a
Fix broken compile on Ubuntu 12.04
2015-12-07 00:25:47 -05:00
john hood
8609f88207
mosh-server: Fix hang with ^S on OS X and FreeBSD.
...
Fixes #692 .
2015-12-06 19:09:42 -05:00
John Hood
551b77f27e
Remove display-posterizing code. It's been dead 3 years.
...
Signed-off-by: John Hood <cgull@glup.org >
2015-12-06 19:03:36 -05:00