Commit 531cdbab authored by Russ Allbery's avatar Russ Allbery

Update to rra-c-util 5.8 and C TAP Harness 3.3

Update to rra-c-util 5.8:

* Support the Solaris 10 embedded Kerberos implementation.
* Use calloc or reallocarray instead of malloc.
* Fix compilation with a C++ compiler.

Update to C TAP Harness 3.3:

* Display verbose test results with -v or C_TAP_VERBOSE.
* Reopen standard input to /dev/null when running a test list.
* Don't leak extraneous file descriptors to tests.
parent 0bb82d59
......@@ -20,6 +20,8 @@
/tests/plugin/queue-only-t
/tests/plugin/queuing-t
/tests/portable/asprintf-t
/tests/portable/mkstemp-t
/tests/portable/reallocarray-t
/tests/portable/snprintf-t
/tests/runtests
/tests/util/concat-t
......
# Automake makefile for krb5-sync.
#
# Written by Russ Allbery <eagle@eyrie.org>
# Copyright 2015 Russ Allbery <eagle@eyrie.org>
# Copyright 2006, 2007, 2010, 2012, 2013
# The Board of Trustees of the Leland Stanford Junior University
#
......@@ -80,16 +81,17 @@ MAINTAINERCLEANFILES = Makefile.in aclocal.m4 build-aux/ar-lib \
#
# -Wconversion http://bugs.debian.org/488884 (htons warnings)
#
# Last checked against gcc 4.7.2 (2013-04-22). -D_FORTIFY_SOURCE=2 enables
# Last checked against gcc 4.8.2 (2014-04-12). -D_FORTIFY_SOURCE=2 enables
# warn_unused_result attribute markings on glibc functions on Linux, which
# catches a few more issues.
WARNINGS = -g -O -D_FORTIFY_SOURCE=2 -Wall -Wextra -Wendif-labels \
-Wformat=2 -Winit-self -Wswitch-enum -Wuninitialized -Wfloat-equal \
-Wdeclaration-after-statement -Wshadow -Wpointer-arith \
-Wbad-function-cast -Wcast-align -Wwrite-strings \
-Wjump-misses-init -Wlogical-op -Wstrict-prototypes \
-Wold-style-definition -Wmissing-prototypes -Wnormalized=nfc \
-Wpacked -Wredundant-decls -Wnested-externs -Winline -Wvla -Werror
WARNINGS = -g -O -fstrict-overflow -fstrict-aliasing -D_FORTIFY_SOURCE=2 \
-Wall -Wextra -Wendif-labels -Wformat=2 -Winit-self -Wswitch-enum \
-Wstrict-overflow=5 -Wmissing-format-attribute -Wfloat-equal \
-Wdeclaration-after-statement -Wshadow -Wpointer-arith \
-Wbad-function-cast -Wcast-align -Wwrite-strings -Wjump-misses-init \
-Wlogical-op -Wstrict-prototypes -Wold-style-definition \
-Wmissing-prototypes -Wnormalized=nfc -Wpacked -Wredundant-decls \
-Wnested-externs -Winline -Wvla -Werror
warnings:
$(MAKE) V=0 CFLAGS='$(WARNINGS)'
......@@ -98,7 +100,8 @@ warnings:
# The bits below are for the test suite, not for the main package.
check_PROGRAMS = tests/runtests tests/plugin/heimdal-t tests/plugin/mit-t \
tests/plugin/queue-only-t tests/plugin/queuing-t \
tests/portable/asprintf-t tests/portable/snprintf-t \
tests/portable/asprintf-t tests/portable/mkstemp-t \
tests/portable/reallocarray-t tests/portable/snprintf-t \
tests/util/messages-krb5-t tests/util/messages-t tests/util/xmalloc
check_LIBRARIES = tests/tap/libtap.a
tests_runtests_CPPFLAGS = -DSOURCE='"$(abs_top_srcdir)/tests"' \
......@@ -134,6 +137,13 @@ tests_plugin_queuing_t_LDADD = tests/tap/libtap.a portable/libportable.la \
tests_portable_asprintf_t_SOURCES = tests/portable/asprintf-t.c \
tests/portable/asprintf.c
tests_portable_asprintf_t_LDADD = tests/tap/libtap.a portable/libportable.la
tests_portable_mkstemp_t_SOURCES = tests/portable/mkstemp-t.c \
tests/portable/mkstemp.c
tests_portable_mkstemp_t_LDADD = tests/tap/libtap.a portable/libportable.la
tests_portable_reallocarray_t_SOURCES = tests/portable/reallocarray-t.c \
tests/portable/reallocarray.c
tests_portable_reallocarray_t_LDADD = tests/tap/libtap.a \
portable/libportable.la
tests_portable_snprintf_t_SOURCES = tests/portable/snprintf-t.c \
tests/portable/snprintf.c
tests_portable_snprintf_t_LDADD = tests/tap/libtap.a portable/libportable.la
......
User-Visible krb5-sync Changes
krb5-sync 3.1 (unreleased)
Update to rra-c-util 5.8:
* Support the Solaris 10 embedded Kerberos implementation.
* Use calloc or reallocarray instead of malloc.
* Fix compilation with a C++ compiler.
Update to C TAP Harness 3.3:
* Display verbose test results with -v or C_TAP_VERBOSE.
* Reopen standard input to /dev/null when running a test list.
* Don't leak extraneous file descriptors to tests.
krb5-sync 3.0 (2013-12-09)
The default installed module name has been changed to sync.so from
......
dnl Autoconf configuration for krb5-sync.
dnl
dnl Written by Russ Allbery <eagle@eyrie.org>
dnl Copyright 2015 Russ Allbery <eagle@eyrie.org>
dnl Copyright 2006, 2007, 2010, 2012, 2013
dnl The Board of Trustees of the Leland Stanford Junior University
dnl
......@@ -15,6 +16,9 @@ AM_INIT_AUTOMAKE([1.11 check-news dist-xz foreign silent-rules subdir-objects
-Wall -Werror])
AM_MAINTAINER_MODE
dnl Detect unexpanded macros.
m4_pattern_forbid([^_?RRA_])
AC_PROG_CC
AC_USE_SYSTEM_EXTENSIONS
AC_SYS_LARGEFILE
......@@ -64,7 +68,7 @@ LIBS="$save_LIBS"
AC_SUBST([DL_LIBS])
AC_HEADER_STDBOOL
AC_CHECK_HEADERS([sys/bittypes.h syslog.h])
AC_CHECK_HEADERS([sys/bittypes.h sys/select.h sys/time.h syslog.h])
AC_CHECK_DECLS([snprintf, vsnprintf])
RRA_C_C99_VAMACROS
RRA_C_GNU_VAMACROS
......@@ -74,7 +78,7 @@ AC_CHECK_TYPES([ssize_t], [], [],
[#include <sys/types.h>])
RRA_FUNC_SNPRINTF
AC_CHECK_FUNCS([setrlimit])
AC_REPLACE_FUNCS([asprintf strndup])
AC_REPLACE_FUNCS([asprintf mkstemp reallocarray strndup])
AC_CONFIG_FILES([Makefile])
AC_CONFIG_HEADER([config.h])
......
......@@ -17,6 +17,12 @@ dnl
dnl If KRB5_CPPFLAGS, KRB5_LDFLAGS, or KRB5_LIBS are set before calling these
dnl macros, their values will be added to whatever the macros discover.
dnl
dnl KRB5_CPPFLAGS_GCC will be set to the same value as KRB5_CPPFLAGS but with
dnl any occurrences of -I changed to -isystem. This may be useful to suppress
dnl warnings from the Kerberos header files when building with GCC and
dnl aggressive warning flags. Be aware that this change will change the
dnl compiler header file search order as well.
dnl
dnl Provides the RRA_LIB_KRB5_OPTIONAL macro, which should be used if Kerberos
dnl support is optional. In this case, Kerberos libraries are mandatory if
dnl --with-krb5 is given, and will not be probed for if --without-krb5 is
......@@ -44,7 +50,7 @@ dnl The canonical version of this file is maintained in the rra-c-util
dnl package, available at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
dnl
dnl Written by Russ Allbery <eagle@eyrie.org>
dnl Copyright 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013
dnl Copyright 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2013, 2014
dnl The Board of Trustees of the Leland Stanford Junior University
dnl
dnl This file is free software; the authors give unlimited permission to copy
......@@ -58,6 +64,8 @@ dnl Headers to include when probing for Kerberos library properties.
AC_DEFUN([RRA_INCLUDES_KRB5], [[
#if HAVE_KRB5_H
# include <krb5.h>
#elif HAVE_KERBEROSV5_KRB5_H
# include <kerberosv5/krb5.h>
#else
# include <krb5/krb5.h>
#endif
......@@ -107,6 +115,23 @@ AC_DEFUN([_RRA_LIB_KRB5_CHECK_HEADER],
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])])])
dnl Check for the com_err header. Internal helper macro since we need
dnl to do the same checks in multiple places.
AC_DEFUN([_RRA_LIB_KRB5_CHECK_HEADER_COM_ERR],
[AS_IF([test x"$rra_krb5_incroot" = x],
[AC_CHECK_HEADERS([et/com_err.h kerberosv5/com_err.h])],
[_RRA_LIB_KRB5_CHECK_HEADER([et/com_err.h])
_RRA_LIB_KRB5_CHECK_HEADER([kerberosv5/com_err.h])])])
dnl Check for the main Kerberos header. Internal helper macro since we need
dnl to do the same checks in multiple places.
AC_DEFUN([_RRA_LIB_KRB5_CHECK_HEADER_KRB5],
[AS_IF([test x"$rra_krb5_incroot" = x],
[AC_CHECK_HEADERS([krb5.h kerberosv5/krb5.h krb5/krb5.h])],
[_RRA_LIB_KRB5_CHECK_HEADER([krb5.h])
_RRA_LIB_KRB5_CHECK_HEADER([kerberosv5/krb5.h])
_RRA_LIB_KRB5_CHECK_HEADER([krb5/krb5.h])])])
dnl Does the appropriate library checks for reduced-dependency Kerberos
dnl linkage. The single argument, if true, says to fail if Kerberos could not
dnl be found.
......@@ -116,10 +141,7 @@ AC_DEFUN([_RRA_LIB_KRB5_REDUCED],
[AS_IF([test x"$1" = xtrue],
[AC_MSG_ERROR([cannot find usable Kerberos library])])])
LIBS="$KRB5_LIBS $LIBS"
AS_IF([test x"$rra_krb5_incroot" = x],
[AC_CHECK_HEADERS([krb5.h krb5/krb5.h])],
[_RRA_LIB_KRB5_CHECK_HEADER([krb5.h])
_RRA_LIB_KRB5_CHECK_HEADER([krb5/krb5.h])])
_RRA_LIB_KRB5_CHECK_HEADER_KRB5
AC_CHECK_FUNCS([krb5_get_error_message],
[AC_CHECK_FUNCS([krb5_free_error_message])],
[AC_CHECK_FUNCS([krb5_get_error_string], [],
......@@ -134,7 +156,7 @@ AC_DEFUN([_RRA_LIB_KRB5_REDUCED],
[AS_IF([test x"$1" = xtrue],
[AC_MSG_ERROR([cannot find usable com_err library])],
[KRB5_LIBS=""])])
AC_CHECK_HEADERS([et/com_err.h])])])])])
_RRA_LIB_KRB5_CHECK_HEADER_COM_ERR])])])])
RRA_LIB_KRB5_RESTORE])
dnl Does the appropriate library checks for Kerberos linkage when we don't
......@@ -181,10 +203,7 @@ AC_DEFUN([_RRA_LIB_KRB5_MANUAL],
[$rra_krb5_extra])],
[-lasn1 -lcom_err -lcrypto $rra_krb5_extra])
LIBS="$KRB5_LIBS $LIBS"
AS_IF([test x"$rra_krb5_incroot" = x],
[AC_CHECK_HEADERS([krb5.h krb5/krb5.h])],
[_RRA_LIB_KRB5_CHECK_HEADER([krb5.h])
_RRA_LIB_KRB5_CHECK_HEADER([krb5/krb5.h])])
_RRA_LIB_KRB5_CHECK_HEADER_KRB5
AC_CHECK_FUNCS([krb5_get_error_message],
[AC_CHECK_FUNCS([krb5_free_error_message])],
[AC_CHECK_FUNCS([krb5_get_error_string], [],
......@@ -192,7 +211,7 @@ AC_DEFUN([_RRA_LIB_KRB5_MANUAL],
[AC_CHECK_FUNCS([krb5_svc_get_msg],
[AC_CHECK_HEADERS([ibm_svc/krb5_svc.h], [], [],
[RRA_INCLUDES_KRB5])],
[AC_CHECK_HEADERS([et/com_err.h])])])])])
[_RRA_LIB_KRB5_CHECK_HEADER_COM_ERR])])])])
RRA_LIB_KRB5_RESTORE])
dnl Sanity-check the results of krb5-config and be sure we can really link a
......@@ -216,10 +235,7 @@ AC_DEFUN([_RRA_LIB_KRB5_CONFIG],
[RRA_KRB5_CONFIG([${rra_krb5_root}], [krb5], [KRB5],
[_RRA_LIB_KRB5_CHECK([$1])
RRA_LIB_KRB5_SWITCH
AS_IF([test x"$rra_krb5_incroot" = x],
[AC_CHECK_HEADERS([krb5.h krb5/krb5.h])],
[_RRA_LIB_KRB5_CHECK_HEADER([krb5.h])
_RRA_LIB_KRB5_CHECK_HEADER([krb5/krb5.h])])
_RRA_LIB_KRB5_CHECK_HEADER_KRB5
AC_CHECK_FUNCS([krb5_get_error_message],
[AC_CHECK_FUNCS([krb5_free_error_message])],
[AC_CHECK_FUNCS([krb5_get_error_string], [],
......@@ -227,7 +243,7 @@ AC_DEFUN([_RRA_LIB_KRB5_CONFIG],
[AC_CHECK_FUNCS([krb5_svc_get_msg],
[AC_CHECK_HEADERS([ibm_svc/krb5_svc.h], [], [],
[RRA_INCLUDES_KRB5])],
[AC_CHECK_HEADERS([et/com_err.h])])])])])
[_RRA_LIB_KRB5_CHECK_HEADER_COM_ERR])])])])
RRA_LIB_KRB5_RESTORE],
[_RRA_LIB_KRB5_PATHS
_RRA_LIB_KRB5_MANUAL([$1])])])
......@@ -239,6 +255,10 @@ dnl checking.
AC_DEFUN([_RRA_LIB_KRB5_INTERNAL],
[AC_REQUIRE([RRA_ENABLE_REDUCED_DEPENDS])
rra_krb5_incroot=
AC_SUBST([KRB5_CPPFLAGS])
AC_SUBST([KRB5_CPPFLAGS_GCC])
AC_SUBST([KRB5_LDFLAGS])
AC_SUBST([KRB5_LIBS])
AS_IF([test x"$rra_krb5_includedir" != x],
[rra_krb5_incroot="$rra_krb5_includedir"],
[AS_IF([test x"$rra_krb5_root" != x],
......@@ -253,7 +273,8 @@ AC_DEFUN([_RRA_LIB_KRB5_INTERNAL],
rra_krb5_uses_com_err=false
AS_CASE([$KRB5_LIBS], [*-lcom_err*], [rra_krb5_uses_com_err=true])
AM_CONDITIONAL([KRB5_USES_COM_ERR],
[test x"$rra_krb5_uses_com_err" = xtrue])])
[test x"$rra_krb5_uses_com_err" = xtrue])
KRB5_CPPFLAGS_GCC=`echo "$KRB5_CPPFLAGS" | sed -e 's/-I/-isystem /g'`])
dnl The main macro for packages with mandatory Kerberos support.
AC_DEFUN([RRA_LIB_KRB5],
......@@ -261,9 +282,6 @@ AC_DEFUN([RRA_LIB_KRB5],
rra_krb5_libdir=
rra_krb5_includedir=
rra_use_KRB5=true
AC_SUBST([KRB5_CPPFLAGS])
AC_SUBST([KRB5_LDFLAGS])
AC_SUBST([KRB5_LIBS])
AC_ARG_WITH([krb5],
[AS_HELP_STRING([--with-krb5=DIR],
......@@ -289,9 +307,6 @@ AC_DEFUN([RRA_LIB_KRB5_OPTIONAL],
rra_krb5_libdir=
rra_krb5_includedir=
rra_use_KRB5=
AC_SUBST([KRB5_CPPFLAGS])
AC_SUBST([KRB5_LDFLAGS])
AC_SUBST([KRB5_LIBS])
AC_ARG_WITH([krb5],
[AS_HELP_STRING([--with-krb5@<:@=DIR@:>@],
......
......@@ -19,6 +19,7 @@
*/
#include <config.h>
#include <portable/macros.h>
#include <portable/system.h>
#include <errno.h>
......@@ -28,11 +29,14 @@
* with the system versions.
*/
#if TESTING
# undef asprintf
# undef vasprintf
# define asprintf test_asprintf
# define vasprintf test_vasprintf
int test_asprintf(char **, const char *, ...)
__attribute__((__format__(printf, 2, 3)));
int test_vasprintf(char **, const char *, va_list);
int test_vasprintf(char **, const char *, va_list)
__attribute__((__format__(printf, 2, 0)));
#endif
......
......@@ -22,6 +22,7 @@
#include <config.h>
#include <portable/krb5.h>
#include <portable/macros.h>
#include <portable/system.h>
#include <errno.h>
......@@ -33,6 +34,8 @@
# include <ibm_svc/krb5_svc.h>
# elif defined(HAVE_ET_COM_ERR_H)
# include <et/com_err.h>
# elif defined(HAVE_KERBEROSV5_COM_ERR_H)
# include <kerberosv5/com_err.h>
# else
# include <com_err.h>
# endif
......
......@@ -42,8 +42,10 @@
#endif
#include <portable/macros.h>
#ifdef HAVE_KRB5_H
#if defined(HAVE_KRB5_H)
# include <krb5.h>
#elif defined(HAVE_KERBEROSV5_KRB5_H)
# include <kerberosv5/krb5.h>
#else
# include <krb5/krb5.h>
#endif
......@@ -169,4 +171,6 @@ const char *krb5_principal_get_realm(krb5_context, krb5_const_principal);
/* Undo default visibility change. */
#pragma GCC visibility pop
END_DECLS
#endif /* !PORTABLE_KRB5_H */
......@@ -37,7 +37,8 @@
* variadic macro support.
*/
#if !defined(__attribute__) && !defined(__alloc_size__)
# if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3)
# if (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3)) \
&& !defined(__clang__)
# define __alloc_size__(spec, args...) /* empty */
# endif
#endif
......
/*
* Replacement for a missing mkstemp.
*
* Provides the same functionality as the library function mkstemp for those
* systems that don't have it.
*
* The canonical version of this file is maintained in the rra-c-util package,
* which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
*
* Written by Russ Allbery <eagle@eyrie.org>
*
* The authors hereby relinquish any claim to any copyright that they may have
* in this work, whether granted under contract or by operation of law or
* international treaty, and hereby commit to the public, at large, that they
* shall not, at any time in the future, seek to enforce any copyright in this
* work against any person or entity, or prevent any person or entity from
* copying, publishing, distributing or creating derivative works of this
* work.
*/
#include <config.h>
#include <portable/system.h>
#include <errno.h>
#include <fcntl.h>
#ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
#endif
#include <time.h>
/*
* If we're running the test suite, rename mkstemp to avoid conflicts with the
* system version. #undef it first because some systems may define it to
* another name.
*/
#if TESTING
# undef mkstemp
# define mkstemp test_mkstemp
int test_mkstemp(char *);
#endif
/* Pick the longest available integer type. */
#if HAVE_LONG_LONG_INT
typedef unsigned long long long_int_type;
#else
typedef unsigned long long_int_type;
#endif
int
mkstemp(char *template)
{
static const char letters[] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
size_t length;
char *XXXXXX;
struct timeval tv;
long_int_type randnum, working;
int i, tries, fd;
/*
* Make sure we have a valid template and initialize p to point at the
* beginning of the template portion of the string.
*/
length = strlen(template);
if (length < 6) {
errno = EINVAL;
return -1;
}
XXXXXX = template + length - 6;
if (strcmp(XXXXXX, "XXXXXX") != 0) {
errno = EINVAL;
return -1;
}
/* Get some more-or-less random information. */
gettimeofday(&tv, NULL);
randnum = ((long_int_type) tv.tv_usec << 16) ^ tv.tv_sec ^ getpid();
/*
* Now, try to find a working file name. We try no more than TMP_MAX file
* names.
*/
for (tries = 0; tries < TMP_MAX; tries++) {
for (working = randnum, i = 0; i < 6; i++) {
XXXXXX[i] = letters[working % 62];
working /= 62;
}
fd = open(template, O_RDWR | O_CREAT | O_EXCL, 0600);
if (fd >= 0 || (errno != EEXIST && errno != EISDIR))
return fd;
/*
* This is a relatively random increment. Cut off the tail end of
* tv_usec since it's often predictable.
*/
randnum += (tv.tv_usec >> 10) & 0xfff;
}
errno = EEXIST;
return -1;
}
/*
* Replacement for a missing reallocarray.
*
* Provides the same functionality as the OpenBSD library function
* reallocarray for those systems that don't have it. This function is the
* same as realloc, but takes the size arguments in the same form as calloc
* and checks for overflow so that the caller doesn't need to.
*
* The canonical version of this file is maintained in the rra-c-util package,
* which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
*
* Written by Russ Allbery <eagle@eyrie.org>
*
* The authors hereby relinquish any claim to any copyright that they may have
* in this work, whether granted under contract or by operation of law or
* international treaty, and hereby commit to the public, at large, that they
* shall not, at any time in the future, seek to enforce any copyright in this
* work against any person or entity, or prevent any person or entity from
* copying, publishing, distributing or creating derivative works of this
* work.
*/
#include <config.h>
#include <portable/system.h>
#include <errno.h>
/*
* If we're running the test suite, rename reallocarray to avoid conflicts
* with the system version. #undef it first because some systems may define
* it to another name.
*/
#if TESTING
# undef reallocarray
# define reallocarray test_reallocarray
void *test_reallocarray(void *, size_t, size_t);
#endif
/*
* nmemb * size cannot overflow if both are smaller than sqrt(SIZE_MAX). We
* can calculate that value statically by using 2^(sizeof(size_t) * 8) as the
* value of SIZE_MAX and then taking the square root, which gives
* 2^(sizeof(size_t) * 4). Compute the exponentiation with shift.
*/
#define CHECK_THRESHOLD (1UL << (sizeof(size_t) * 4))
void *
reallocarray(void *ptr, size_t nmemb, size_t size)
{
if (nmemb >= CHECK_THRESHOLD || size >= CHECK_THRESHOLD)
if (nmemb > 0 && SIZE_MAX / nmemb <= size) {
errno = ENOMEM;
return NULL;
}
return realloc(ptr, nmemb * size);
}
......@@ -19,6 +19,8 @@
* conflicts with the system version.
*/
#if TESTING
# undef snprintf
# undef vsnprintf
# define snprintf test_snprintf
# define vsnprintf test_vsnprintf
#endif
......
......@@ -5,7 +5,8 @@
* file is the equivalent of including all of the following headers,
* portably:
*
* #include <sys/types.h>
* #include <inttypes.h>
* #include <limits.h>
* #include <stdarg.h>
* #include <stdbool.h>
* #include <stddef.h>
......@@ -14,6 +15,7 @@
* #include <stdint.h>
* #include <string.h>
* #include <strings.h>
* #include <sys/types.h>
* #include <unistd.h>
*
* Missing functions are provided via #define or prototyped if available from
......@@ -46,6 +48,7 @@
#if HAVE_INTTYPES_H
# include <inttypes.h>
#endif
#include <limits.h>
#include <stdarg.h>
#include <stddef.h>
#if HAVE_STDINT_H
......@@ -124,6 +127,12 @@ extern int snprintf(char *, size_t, const char *, ...)
#if !HAVE_DECL_VSNPRINTF
extern int vsnprintf(char *, size_t, const char *, va_list);
#endif
#if !HAVE_MKSTEMP
extern int mkstemp(char *);
#endif
#if !HAVE_REALLOCARRAY
extern void *reallocarray(void *, size_t, size_t);
#endif
#if !HAVE_STRNDUP
extern char *strndup(const char *, size_t);
#endif
......
......@@ -8,6 +8,8 @@ plugin/mit
plugin/queue-only
plugin/queuing
portable/asprintf
portable/mkstemp
portable/reallocarray
portable/snprintf
tools/backend
util/messages
......
......@@ -11,7 +11,7 @@
# which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
#
# Written by Russ Allbery <eagle@eyrie.org>
# Copyright 2011, 2012, 2013
# Copyright 2011, 2012, 2013, 2014
# The Board of Trustees of the Leland Stanford Junior University
#
# Permission is hereby granted, free of charge, to any person obtaining a
......@@ -37,7 +37,33 @@
Memcheck:Leak
fun:calloc
fun:_dlerror_run
fun:dlopen*
}
{
heimdal-gss-config
Memcheck:Leak
fun:*alloc
...
fun:krb5_config_parse_debug
}
{
heimdal-gss-config-2
Memcheck:Leak
fun:*alloc
fun:_krb5_config_get_entry
}
{
heimdal-gss-krb5-init
Memcheck:Leak
fun:*alloc
...
fun:_gsskrb5_init
}
{
heimdal-gss-load-mech
Memcheck:Leak
fun:*alloc
...
fun:_gss_load_mech
}
{
heimdal-krb5-init-context-once
......@@ -77,6 +103,13 @@
fun:kg_set_ccache_name
fun:gss_krb5int_ccache_name
}
{
mit-gss-error
Memcheck:Leak
fun:*alloc
...
fun:krb5_gss_save_error_string
}
{
mit-krb5-pkinit-openssl-init
Memcheck:Leak
......
#!/usr/bin/perl
#
# Checks all POD files in the tree for spelling errors using Test::Spelling.
# This test is disabled unless RRA_MAINTAINER_TESTS is set, since spelling
# dictionaries vary too much between environments.
#
# The canonical version of this file is maintained in the rra-c-util package,
# which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
#
# Written by Russ Allbery <eagle@eyrie.org>
# Copyright 2012, 2013
# Copyright 2012, 2013, 2014
# The Board of Trustees of the Leland Stanford Junior University
#
# Permission is hereby granted, free of charge, to any person obtaining a
......@@ -36,11 +34,12 @@ use warnings;
use lib "$ENV{SOURCE}/tap/perl";
use Test::More;
use Test::RRA qw(skip_unless_maintainer use_prereq);
use Test::RRA qw(skip_unless_author use_prereq);
use Test::RRA::Automake qw(automake_setup perl_dirs);
# Only run this test for the maintainer.
skip_unless_maintainer('Spelling tests');
# Only run this test for the module author since the required stopwords are
# too sensitive to the exact spell-checking program and dictionary.
skip_unless_author('Spelling tests');
# Load prerequisite modules.
use_prereq('Test::Spelling');
......
#!/usr/bin/perl -w
#!/usr/bin/perl
#
# Check all POD documents in the tree, except for any embedded Perl module
# distribution, for POD formatting errors.
......@@ -7,7 +7,7 @@
# which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
#
# Written by Russ Allbery <eagle@eyrie.org>
# Copyright 2012, 2013
# Copyright 2012, 2013, 2014
# The Board of Trustees of the Leland Stanford Junior University
#
# Permission is hereby granted, free of charge, to any person obtaining a
......@@ -35,9 +35,13 @@ use warnings;
use lib "$ENV{SOURCE}/tap/perl";
use Test::More;
use Test::RRA qw(use_prereq);
use Test::RRA qw(skip_unless_automated use_prereq);
use Test::RRA::Automake qw(automake_setup perl_dirs);
# Skip this test for normal user installs, since we normally pre-generate all
# of the documentation and the end user doesn't care.
skip_unless_automated('POD syntax tests');
# Load prerequisite modules.
use_prereq('Test::Pod');
......
......@@ -2,15 +2,11 @@
#
# Check for perlcritic errors in included Perl scripts.
#
# Checks all Perl scripts in the tree for problems uncovered by perlcritic.
# This test is disabled unless RRA_MAINTAINER_TESTS is set, since coding style
# will not interfere with functionality.
#
# The canonical version of this file is maintained in the rra-c-util package,
# which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
#
# Written by Russ Allbery <eagle@eyrie.org>
# Copyright 2012, 2013
# Copyright 2012, 2013, 2014
# The Board of Trustees of the Leland Stanford Junior University
#
# Permission is hereby granted, free of charge, to any person obtaining a
......@@ -37,13 +33,15 @@ use warnings;
use lib "$ENV{SOURCE}/tap/perl";
use File::Spec;
use Test::More;
use Test::RRA qw(skip_unless_maintainer use_prereq);
use Test::RRA qw(skip_unless_author use_prereq);
use Test::RRA::Automake qw(automake_setup perl_dirs test_file_path);
use Test::RRA::Config qw(@CRITIC_IGNORE);
# Skip tests unless we're running the test suite in maintainer mode.
skip_unless_maintainer('Coding style tests');
# Skip tests unless we're running author tests since this test is too
# sensitive to the exact version of Perl::Critic to be generally useful.
skip_unless_author('Coding style tests');
# Set up Automake testing.
automake_setup();
......@@ -51,11 +49,22 @@ automake_setup();
# Load prerequisite modules.
use_prereq('Test::Perl::Critic');
# Due to an annoying bug in Perl::Tidy 20130922, we cannot run tests if the
# source directory is read-only. It unconditionally tries to create a log
# file in the current directory and fails to run any checks if it cannot.
if (!-w File::Spec->curdir()) {
plan skip_all => 'Perl::Tidy needs writable source directory';
}
# Force the embedded Perl::Tidy check to use the correct configuration.
local $ENV{PERLTIDY} = test_file_path('/data/perltidyrc');
local $ENV{PERLTIDY} = test_file_path('data/perltidyrc');
# Import the configuration file.
Test::Perl::Critic->import(-profile => test_file_path('data/perlcriticrc'));
# Finally, run the actual tests.
all_critic_ok(perl_dirs({ skip => [@CRITIC_IGNORE] }));
# On Debian with perltidy 20130922-1, a perltidy.LOG file gets left behind
# in the current directory. Remove it if it exists.
unlink('perltidy.LOG');
......@@ -10,7 +10,7 @@
# which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
#
# Written by Russ Allbery <eagle@eyrie.org>
# Copyright 2012, 2013
# Copyright 2012, 2013, 2014
# The Board of Trustees of the Leland Stanford Junior University
#
# Permission is hereby granted, free of charge, to any person obtaining a
......@@ -38,10 +38,13 @@ use warnings;
use lib "$ENV{SOURCE}/tap/perl";
use Test::More;
use Test::RRA qw(use_prereq);
use Test::RRA qw(skip_unless_automated use_prereq);
use Test::RRA::Automake qw(automake_setup perl_dirs);
use Test::RRA::Config qw($MINIMUM_VERSION %MINIMUM_VERSION);
# Skip for normal user installs since this doesn't affect functionality.
skip_unless_automated('Minimum version tests');
# Load prerequisite modules.
use_prereq('Test::MinimumVersion');
......
......@@ -5,14 +5,12 @@
# Checks all Perl scripts in the tree for problems uncovered by Test::Strict.
# This includes using strict and warnings for every script and ensuring they
# all pass a syntax check. Currently, test suite coverage is not checked.
# This test is disabled unless RRA_MAINTAINER_TESTS is set, since some scripts
# may require dependencies that aren't necessarily present.