Keith Winstein
093bbc9111
Detached warning: Omit spurious utmp entries (generated by screen)
2013-03-10 16:31:37 -04:00
Anders Kaseorg
ba8d013609
main: Don’t leak desired_ip memory
...
Signed-off-by: Anders Kaseorg <andersk@mit.edu >
Closes #385 .
2013-03-10 15:45:52 -04:00
Anders Kaseorg
b9763b6997
serve: Remove dead store of bytes_read
...
Signed-off-by: Anders Kaseorg <andersk@mit.edu >
2013-03-10 15:45:47 -04:00
Anders Kaseorg
d6ff754a9a
get_SSH_IP: Don’t leak SSH_writable memory
...
Signed-off-by: Anders Kaseorg <andersk@mit.edu >
2013-03-10 15:45:47 -04:00
Anders Kaseorg
2686b7c634
main: Don’t leak shell_name memory
...
Signed-off-by: Anders Kaseorg <andersk@mit.edu >
2013-03-10 15:45:47 -04:00
Alexander von Gernler
ebe7ae96f6
fix a perror() message in mosh-server
...
A perror() message flanking an open() call was reading "dup2" where it
should read "open".
[closes #377 ]
2013-01-18 11:51:28 -05:00
Keith Winstein
1fe6799092
Don't leak extra /dev/null fd (thanks to Julien Cristau)
2012-12-12 19:05:24 -05:00
Anton Lundin
55eb2759c0
use unistd.h instead of getopt.h
...
getopt.h doesn't exist on AIX and getopt is in unistd.h
2012-12-01 14:49:29 +01:00
Keith Winstein
1c2b48abc6
mosh-server warning on unattached servers checks that device exists
2012-11-26 03:06:11 -05:00
Keith Winstein
2f8a67acc7
Adjust timeouts so server dies quicker, updates utmp slower
2012-11-26 02:21:06 -05:00
Keith Winstein
486325e76b
mosh-server: Fix bug where spins forever if process dies while disconnected
2012-11-26 02:14:48 -05:00
Luke Mewburn
141ec239da
Support port range as -p/--port PORT[:HIGHPORT].
...
Extend mosh and mosh-server to support parsing a high port from
the desired_port argument. The first (low) port must not be
greater than the second (high) port.
If only one value is provided, behaviour is as before; bind
to one port. Also tweak the formatting in mosh-server(1) synopsis
to be consistent.
This resolves mosh issue # 296.
Signed-off-by: Luke Mewburn <luke@mewburn.net >
2012-10-29 14:59:28 -04:00
Keith Winstein
da18a8c7ea
Detect edge case when argc == 0
2012-10-20 14:17:19 -04:00
Keith Winstein
c0092a6e7e
Hop new ports, but keep the old [for a minute, and up to 10 at a time]
...
(One is silver and the other gold...)
2012-10-05 02:51:25 -04:00
Keith Winstein
d17fb7824b
Reset fd sets every time we poll (because network.fd() can now change)
2012-10-05 00:06:37 -04:00
Keith Winstein
f621f9f001
Grammar fix on ssh -t message
2012-09-28 20:17:58 -04:00
Keith Winstein
0311365810
Read utmpx directly instead of using "who", and prettify detached warning
2012-09-28 20:06:04 -04:00
Xi Wang
f0d9cb3db3
Avoid null pointer dereference in chdir_homedir()
...
Return if pw is NULL, to avoid dereferencing it at pw->pw_dir.
2012-09-26 22:27:24 -04:00
Keith Winstein
89da6105aa
When not connected, (1) client hops port numbers (2) server stops sending.
2012-08-13 11:19:25 +03:00
Timo Sirainen
9296ffbed7
Don't reopen stdio. It's not needed, and it doesn't compile with Solaris.
...
Signed-off-by: Timo Sirainen <tss@iki.fi >
2012-08-11 17:14:45 -04:00
Timo Sirainen
9cade23616
It's safer to close stdin/out/err by replacing their fd with /dev/null.
...
Otherwise the next opened fds are 0/1/2, and any code writing to
stdout/stderr might break things by writing to an unintentional fd.
Signed-off-by: Timo Sirainen <tss@iki.fi >
2012-08-11 17:14:45 -04:00
Timo Sirainen
b245ed00ca
Don't call setsid(), forkpty() does it anyway. This fixes a failing ioctl(TIOCSCTTY) in Solaris.
...
Signed-off-by: Timo Sirainen <tss@iki.fi >
2012-08-11 17:14:45 -04:00
Timo Sirainen
0c5307f345
Added forkpty() and cfmakeraw() fallback implementations if they don't exist.
...
Signed-off-by: Timo Sirainen <tss@iki.fi >
2012-08-11 17:14:44 -04:00
Keith Winstein
894a190f06
Revert creation of utmp entry to avoid uninitialized "master"
2012-08-11 17:13:43 -04:00
Keith Winstein
c073ad364a
get_SSH_IP gracefully handles missing, IPv6-formatted environment var
...
Closes #292 github issue.
2012-07-26 22:54:45 -04:00
Keith Winstein
a744004bf6
Get system timestamp less often (only after sleeping/selecting)
2012-07-26 21:13:26 -04:00
Keith Winstein
2cb2f3aeb5
Tidy up unattached warning, only print when showing motd
2012-07-23 01:25:55 -04:00
Keith Winstein
549cf0a9bd
Warn of unattached Mosh sessions on login
2012-07-23 01:16:57 -04:00
Keith Winstein
92ecb99b71
Add OpenSSL licensing exception
2012-07-20 16:46:00 -04:00
Keegan McAllister
dd941df19d
Remove unused sigfd and skalibs
...
Closes #265 .
2012-05-16 00:00:27 -04:00
Keegan McAllister
4f23326a92
Use Select signal handling in mosh-{client,server}
2012-05-16 00:00:27 -04:00
Keegan McAllister
6edc04ed1c
mosh-server: Ignore signals rather than blocking them
...
For pselect() we want to mess with the signal mask, and this is closer to our
intent anyway.
2012-05-16 00:00:27 -04:00
Keegan McAllister
768d4ce797
Make Select a singleton
...
It's going to manipulate process-global signal state, so multiple
instances do not make sense.
2012-05-16 00:00:27 -04:00
Keegan McAllister
2112a3865c
Use Select in mosh-{client,server}
2012-05-16 00:00:27 -04:00
Keegan McAllister
5bf681629d
mosh-server: Treat errors on pty read like EOF
...
Fixes #264 .
2012-05-16 00:00:27 -04:00
Keegan McAllister
5cff456400
Define PROG, for newer versions of skalibs
...
Needed to build from our source tarball on some Gentoo systems.
Closes #239 .
Closes #254 .
2012-05-05 02:11:02 -04:00
Massimo Gengarelli
49fc21c8a3
Catch by const reference (remove Eclipse warnings)
...
(closes #245 )
2012-04-29 02:24:31 -04:00
Keith Winstein
62330a0b09
Put the setsid() where it belongs
2012-04-20 20:38:27 -04:00
Keith Winstein
b9a8b8c009
More helpful messages when locale not found or wrong ( closes #209 )
2012-04-19 02:35:14 -04:00
Keith Winstein
1508d40b4c
Chdir to homedir ( closes #193 ) and honor .hushlogin ( closes #216 ).
2012-04-19 01:03:25 -04:00
Keith Winstein
9cf87d224e
Verbose server now turns on verbose transport layer (much more output)
...
Relevant to #217 .
2012-04-18 10:47:18 -04:00
Keegan McAllister
a289a2319e
Preserve RLIMIT_CORE hard limit, and restore soft limit before exec
...
Closes #196 .
2012-04-16 20:03:04 -04:00
Keith Winstein
3ed9c0fb77
Only print motd for login shells, not when command is specified.
2012-04-16 18:34:53 -04:00
Keith Winstein
68825dccde
Print /etc/motd before login shell. Closes #190 .
2012-04-16 18:19:45 -04:00
Keith Winstein
b4263b354e
Check for paths.h and make sure we have _PATH_BSHELL
2012-04-16 17:51:52 -04:00
Jay Freeman (saurik)
2462434390
Use _PATH_BSHELL for "/bin/sh" and fix argv[0].
...
The previous code had the following issues:
1) hardcoded the path of /bin/sh (should use paths.h)
2) threw away the variable with the fallback shell
3) prepended - to the path rather than the shell name
4) added a - before explicit chosen non-shell commands
Closes #199 .
2012-04-16 17:40:30 -04:00
Keith Winstein
bcb96d9337
Change some asserts flagging runtime errors to fatal_asserts (Anders Kaseorg)
2012-04-16 06:27:14 -04:00
Ed Schouten
033953dcd2
Don't leak utmpx entries on shutdown.
...
As far as I know, for all implementations of libutempter, the
utempter_remove_added_record() function depends on the file descriptor
passed to utempter_add_record() to still be valid. The reason for this,
is that this file descriptor is propagated to the setuid utility that is
responsible for modifying utmpx.
Modify the code to remove the utmpx entry before closing the
pseudo-terminal master device. While there, simply use
utempter_remove_record(), which takes the file descriptor explicitly.
The advantage is that this prevents potential foot-shooting in the
future. Visual inspection of the source code will make it more obvious
that utempter depends on the file descriptor.
Closes #179 .
2012-04-16 01:37:48 -04:00
Keith Winstein
7103c5f48b
Using fclose() instead of close() means future fprintf() doesn't kill us on Mac.
2012-04-15 23:25:21 -04:00
Keith Winstein
cc8b1f293a
Forcibly detach earlier in blind effort to fix #114 (needs testing)
2012-04-15 12:38:48 -04:00