Suppress shell errors when pkg-config isn't available

If pkg-config isn't found, set PKG_CONFIG to false when probing for
systemd properties so that it silently fails instead of producing
shell errors during configure.

Change-Id: I55f4fcabcc1a85479f5fa717db90179dbc1512fd
Reviewed-on: https://gerrit.stanford.edu/1411
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
Add missing END_DECLS to portable/krb5.h

This would have caused compilation errors with a C++ compiler.

Change-Id: Ie3cf92bb0bbdbf172c72ab6be1b3cf64f58639d5
Reviewed-on: https://gerrit.stanford.edu/1412
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
Backport to libevent 1.4

Now builds and works correctly with the version of libevent that
shipped with Debian squeeze.  Add lots and lots of portability
code for all the changed or missing APIs in libevent 1.4.  Stop
relying on event_base_got_break and set a flag in the process
instead, since that function isn't available in 1.4.  Avoid clearing
the event callback on the inout buffevent when switching to discard
processing since this causes a segfault in libevent 1.4.

Change-Id: If75d455667327ee4e509b7fefb989ec7bf1d2dcf
Reviewed-on: https://gerrit.stanford.edu/1413
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
Further fixes to the libevent 1.4 portability code

Correct a couple of mistakes and syntax errors that prevented the
ported code from building properly with libevent 2.x.

Change-Id: I4538129b28300b4e9c34d62cc7a557b7f4865370
Reviewed-on: https://gerrit.stanford.edu/1414
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
Update required dependency for libevent

libevent 1.4.4 and later are now supported.

Change-Id: I8ae3f9d42ed8f52ca8494066cdc3d53c8855dbb9
Reviewed-on: https://gerrit.stanford.edu/1415
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
Fix test suite build with Kerberos in a non-standard path

Now that we're building the test suite with native Kerberos support,
we need to pass KRB5_CPPFLAGS to the build process for libtap.a.

Change-Id: Ifc1653b748a378e57ca6545ea4753d7310b46d92
Reviewed-on: https://gerrit.stanford.edu/1416
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
Note that pkg-config is required when building from Git

Change-Id: I5e62679f0d4e4d3bb72955f21085bb8843978a2f
Reviewed-on: https://gerrit.stanford.edu/1417
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
Use m4_pattern_forbid in configure.ac for a sanity check

Protect against unexpanded pkg-config and rra-c-util Autoconf
macros in configure.ac by using m4_pattern_forbid.

Change-Id: I5e22e718fdfa1b4abb4ad4e48ee359dfb60f63c1
Reviewed-on: https://gerrit.stanford.edu/1418
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
Rework how to free memory allocated for message handlers

Rather than automatically freeing memory and resetting handlers
via atexit, which may cause problems for use of message calls in
exit handlers, provide a function to explicitly reset the handlers
to the defaults and free all allocated memory.  Use that function
in the remctl server.

Change-Id: I82e6907aea3e71043ac9772971a569577ba36c66
Reviewed-on: https://gerrit.stanford.edu/1419
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
Fix a GSS-API context leak on protocol version one error

Fix a GSS-API context leak in the remctl client when failing to send a
protocol version one token.

Change-Id: I38f48b86479d0567015b7910e0348da5ed451e5b
Reviewed-on: https://gerrit.stanford.edu/1420
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
Coding style improvements to client/api.c

Use INVALID_SOCKET properly in more places.  Rework remctl_close
to avoid unnecessary nesting and add some internal comments.

Change-Id: Ic4037ce0cab0b4be4095355cdc9e8d4bf2d1fe60
Reviewed-on: https://gerrit.stanford.edu/1421
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>
Suppress reachable memory when building with Heimdal

This doesn't get everything that shows up on i386, but it cuts it
down to a dull roar.

Change-Id: I837bd86edfd89e0c0a3c3a46fb24feb562377eaf
Reviewed-on: https://gerrit.stanford.edu/1422
Reviewed-by: Russ Allbery <rra@stanford.edu>
Tested-by: Russ Allbery <rra@stanford.edu>