220 Commits

Author SHA1 Message Date
Anders Kaseorg b0e05776f1 Use protobuf's Gzip streams
This reverts commit 63459ed1c7.
2012-05-16 00:24:21 -04:00
Keegan McAllister dd941df19d Remove unused sigfd and skalibs
Closes #265.
2012-05-16 00:00:27 -04:00
Keegan McAllister bb651581a7 Remove unused poll(2) emulation
Closes #235.
2012-05-16 00:00:27 -04:00
Anders Kaseorg 1b86532a99 Only use AM_PROG_AR if it’s defined
Fixes
  aclocal:configure.ac:22: warning: macro `AM_PROG_AR' not found in library
and
  ./configure: line 4024: AM_PROG_AR: command not found
with old automake.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2012-05-09 14:08:30 -04:00
Keith Winstein e70254bad5 Add AM_PROG_AR for automake 1.12 (closes #250) 2012-04-30 14:58:53 -04:00
Keith Winstein 68575f8587 Bump version to 1.2 2012-04-26 01:40:27 -04:00
Keith Winstein ef939c75cf Bump version to 1.1.99b 2012-04-25 02:53:43 -04:00
Keith Winstein 1f1f818a29 Bump version to 1.1.99a (release candidate) 2012-04-25 02:31:15 -04:00
Keith Winstein 072863f0b9 Bump version to 1.1.99 (release candidate) 2012-04-24 23:56:05 -04:00
Ryan Steinmetz 56cc176d43 Fix libutil.h test under FreeBSD 7.x/8.x 2012-04-24 22:37:27 -04:00
Keith Winstein dece595063 Bump version to 1.1.98 (release candidate) 2012-04-24 19:00:40 -04:00
Keith Winstein 3ccfe64bfb Rewrite Cygwin test again 2012-04-24 18:04:01 -04:00
Keith Winstein 6cd21080ef Fix test for Cygwin terminfo location 2012-04-24 16:56:23 -04:00
Keith Winstein 8d3a3b303f Bump version to 1.1.97 2012-04-23 22:54:50 -04:00
Keith Winstein 63459ed1c7 Revert use of protobuf's Gzip streams.
Unfortunately some Red Hat-based distributions lack the required header.
See https://bugzilla.redhat.com/show_bug.cgi?id=815587

This reverts commit 261a389a76.
This reverts commit b6736eb0a5.
2012-04-23 22:50:49 -04:00
Keith Winstein 905176c2b9 Bump version to 1.1.96 (release candidate) 2012-04-23 20:22:13 -04:00
Keith Winstein caba4d067e Bump version to 1.1.95 (release candidate) 2012-04-22 23:29:02 -04:00
Keith Winstein 9b3845e4b2 Bump version to 1.1.94e 2012-04-22 16:59:40 -04:00
Anders Kaseorg b6736eb0a5 Use protobuf’s Gzip{Input,Output}Stream wrapper around zlib
This removes our direct zlib dependency (although of course protobuf
still uses it internally), removes a fixed 4 MiB buffer and its
corresponding limit on the terminal size, reduces some string copying,
and deletes some code.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>

(Closes #230.)
2012-04-22 16:14:28 -04:00
Anders Kaseorg 7fe9f29448 Set poll_LIBS = libpoll.a in Makefile.am so dependency tracking works
Signed-off-by: Anders Kaseorg <andersk@mit.edu>
2012-04-21 02:19:36 -04:00
Keith Winstein 2dc748b7f6 Make sure we always use -lutil, and make test work for FreeBSD too. 2012-04-20 11:11:00 -04:00
Quentin Smith 46ec3b4145 Link against libutil when checking poll 2012-04-20 11:01:14 -04:00
Quentin Smith dd49b986ed Pull in third-party poll emulator and automatically link it in if we detect the system's poll is broken 2012-04-20 05:02:33 -04:00
Keith Winstein 6a3ea5c751 Bump version to 1.1.94d 2012-04-19 02:45:24 -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 ac2875141b Bump version for 1.2 release pre-candidate 2012-04-16 21:13:37 -04:00
Keith Winstein 1b21e004e7 Search for -lncurses must have different name or some autoconf will skip it. 2012-04-16 19:05:18 -04:00
Keith Winstein b4263b354e Check for paths.h and make sure we have _PATH_BSHELL 2012-04-16 17:51:52 -04:00
Brandon Black 6c04291419 Fix ncurses detection at configure time
There appears to be a typo/thinko in the ncurses detection
stuff in configure.ac.  The fallout was that on a Linux host
without ncurses-devel installed, "./configure" failed to find
curses.h but claimed overall success, then the build failed
later during make.  This patch removes an extraneous comma, which
seems to make it both fail and succeed correctly when it should.
2012-04-16 17:13:59 -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
Joshua Pollack 59e8364178 Add support for Cygwin, which has curses headers in /usr/include/ncurses
[keithw -- applied style change from kmcallister]

Closes #181.
2012-04-16 00:54:27 -04:00
Keith Winstein 25b0e0e8ab Make new pipe2() test work properly when pipe2() undefined (e.g. on OS X). 2012-04-16 00:47:55 -04:00
Keegan McAllister c2a5941f88 Fall back to naive built-in byte-swap routines
EL5 lacks htobe64 and friends.  Using its byteswap.h requires an endianness
check in our headers, which is fragile and compiler-dependent.  It's a fair
amount of code [1], and is only useful on EL5.

So instead, let's include a fallback implementation of these functions, and use
it whenever we can't find the (now-)standard Linux or OS X routines.  The
fallback is endianness-independent and should work on any platform.

[1] https://github.com/rurban/mosh/commit/da1a5abd1e09f0c1e9295357bb480a643d9dc8e3
2012-04-15 23:42:15 -04:00
Keegan McAllister 85d197346a configure.ac: Check that we can use O_CLOEXEC with pipe2().
Needed for EL5.

Based on:
https://github.com/rurban/mosh/commit/c70c3707e65b42ac9b9da937e9c255211330805e
2012-04-15 23:42:15 -04:00
Keegan McAllister 8bcc001b52 Remove Boost entirely 2012-04-15 13:49:15 -04:00
Keegan McAllister 0eec0b60f0 Linux: Use our own signalfd wrapper, rather than libstddjb
selfpipe already does a fine job of interfacing to signalfd.  But Debian and
Ubuntu want us to depend on the skalibs-dev package rather than build libstddjb
ourselves.  That would be fine except that skalibs-dev has static libraries
only, and they aren't built with -fPIC.  This interferes with building
mosh-{client,server} as position-independent executables, which is a desirable
security measure.

So we have our own wrapper, which invokes either signalfd or selfpipe.  And we
build it ourselves with our own flags, because it's part of the Mosh project
proper.

(closes #108)
2012-04-13 12:33:21 -04:00
Keegan McAllister 93325d3ef0 Include -fPIE when we check for $LD -pie
configure's linker flag check also compiles a C++ program.  g++ -pie informs
both the compiler and linker, but clang++ -Wl,-pie is only a linker flag, and
the linker will complain that the code hasn't been compiled as
position-independent.
2012-04-13 12:27:27 -04:00
Keegan McAllister 8c16ca8123 Try $LD -Wl,-pie if $LD -pie fails
clang on OS X wants the former.

c.f. http://bugs.ruby-lang.org/issues/5697
2012-04-13 12:27:27 -04:00
Keegan McAllister d2434d1a79 Check compiler support for -fno-default-inline and -pipe
clang was spewing warnings about the unrecognized -fno-default-inline.  (Oddly,
it warns only with -c, not when compiling directly to an executable.)  For
completeness we also check -pipe, even though clang is OK with that one.

It should be fine to omit either flag.  gcc -fno-default-inline drops the
implicit 'inline' annotation on functions defined inside a class scope, but
'inline' is only a hint anyway.  -fno-default-inline does not change linkage.
-pipe is merely a compile speed optimization.
2012-04-13 12:27:27 -04:00
Keegan McAllister 62b6137ff5 Grep for clang warnings when testing compiler flag support
There is no way to make clang's "argument unused" warning fatal.

Ideally the search string would also include 'clang: ' but this output might
depend on clang's argv[0].
2012-04-13 12:27:27 -04:00
Keegan McAllister ffd7332f8d Detect binary hardening flags supported by the compiler and linker 2012-04-13 12:25:09 -04:00
Keith Winstein 719e085f3e Bump version number 2012-04-11 03:37:09 -04:00
Anders Kaseorg 9cec566cd1 Find ncurses from pkg-config if possible, and prefer separate libtinfo
Recent ncurses can be configured --with-termlib, which splits out the
terminfo-level functions from libncurses into a separate libtinfo.
This allows us to avoid an unnecessary dependency on libncurses.  (We
already avoided this on distributions that link with -Wl,--as-needed.)

Signed-off-by: Anders Kaseorg <andersk@mit.edu>

Closes #128 github pull request.
2012-04-11 02:47:55 -04:00
Keegan McAllister c6751cfb92 configure.ac: Fix protoc check
AC_MSG_ERROR inside the variable assignment doesn't work properly.  We get
output like

    checking for protoc... ./configure: line 4524: is: command not found
    no

and then the build continues (and fails) with PROTOC="".

Closes #132 github pull request.
2012-04-11 02:45:15 -04:00
Keith Winstein 4d9483bc83 Fix build when libutil.h exists but is deprecated 2012-04-07 20:23:59 -04:00
Keegan McAllister c354a69ee6 Test the Mosh crypto layer 2012-04-06 23:43:42 -04:00
Keegan McAllister fe34cb3809 Create src/tests 2012-04-06 23:43:42 -04:00
Keegan McAllister 3b61581bcd Make aligned allocation without posix_memalign more robust
Instead of guessing the right function to use, we malloc() 15 bytes more than
we need, and compute the aligned offset within.  The AlignedBuffer class takes
care of passing the original pointer to free().
2012-04-06 23:43:41 -04:00
Benjamin Kaduk 29539516e5 FreeBSD needs libutil.h for forkpty()
The header is not available everywhere, so only include it if it
is present.  (The extra include should be harmless on Linux by
inspection.)
2012-04-05 18:19:37 -04:00
Benjamin Kaduk 424e2b53e1 Allow <sys/endian.h> as well as <endian.h>
On FreeBSD, the header which defines htobe64() is the sys/ variant,
unlike Linux.
2012-04-05 18:19:37 -04:00