diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2014-05-03 19:36:14 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2014-05-03 19:36:14 +0000 |
commit | 2d34f39850c4da5ae1f81f07127c1f7da061e1b2 (patch) | |
tree | a80e79f3609dc3999d1acbc5d58c3115ef6c3c18 | |
parent | efd15781f827c65212f37873a6a83c8f543e51c8 (diff) |
Update to xauth 1.0.9
23 files changed, 1166 insertions, 470 deletions
diff --git a/app/xauth/ChangeLog b/app/xauth/ChangeLog index a44582aee..f0b9b93ad 100644 --- a/app/xauth/ChangeLog +++ b/app/xauth/ChangeLog @@ -1,3 +1,84 @@ +commit 0b120e37be8ed44188b3497bf02db48e9cf638bc +Author: Dr. Tilmann Bubeck <tilmann@bubecks.de> +Date: Wed Apr 2 20:02:00 2014 +0200 + + Third version bump to 1.0.9. + + Minor change in README to include 1.0.9 in diff so that release.sh + is happy. + + Signed-off-by: Dr. Tilmann Bubeck <tilmann@bubecks.de> + +commit e204395a7ccf403999ffa2515379784b641745d1 +Author: Dr. Tilmann Bubeck <tilmann@bubecks.de> +Date: Wed Apr 2 19:52:43 2014 +0200 + + Second version bump to 1.0.9. + + Minor change in README to push the version bump. + + Signed-off-by: Dr. Tilmann Bubeck <tilmann@bubecks.de> + +commit c36e9838294a6042eb7ae61fc476cbc3280aef2d +Author: Dr. Tilmann Bubeck <tilmann@bubecks.de> +Date: Wed Apr 2 19:44:37 2014 +0200 + + Fixed missing EXTRA_DIST in tests. Extended README for releasing. + + The tests/Makefile.am missed the EXTRA_DIST definition which resulted in + missing files for the test done with "make check". This was fixed. + README was extended to describe howto release a new version of this + software and to clarify something from ReleaseHOWTO of x.org. + Prepare anything for releasing 1.0.9. + + Signed-off-by: Dr. Tilmann Bubeck <tilmann@bubecks.de> + +commit ce4bfd951160eabdb28f5534c34aa7549dba7fba +Author: Dr. Tilmann Bubeck <t.bubeck@reinform.de> +Date: Mon Mar 31 23:21:12 2014 +0200 + + version bump to 1.0.9 + + Prepare for a new version 1.0.9 of xauth. + + Signed-off-by: Dr. Tilmann Bubeck <t.bubeck@reinform.de> + +commit ccf30deb585297823ea03fc68805a1c825e335fe +Author: Alan Coopersmith <alan.coopersmith@oracle.com> +Date: Fri Dec 27 11:01:35 2013 -0800 + + Add AC_USE_SYSTEM_EXTENSIONS to expose non-standard extensions + + Required on Solaris to expose definitions in system headers that + are not defined in the XPG standards now that xtrans 1.3 defines + _XOPEN_SOURCE to 600 on Solaris. + + Fixes build failures: + gethost.c: In function ‘get_hostname’: + gethost.c:97:21: error: ‘INET6_ADDRSTRLEN’ undeclared (first use in this function) + gethost.c:97:21: note: each undeclared identifier is reported only once for each function it appears in + gethost.c:97:16: warning: unused variable ‘addr’ [-Wunused-variable] + gethost.c: In function ‘get_address_info’: + gethost.c:196:9: error: implicit declaration of function ‘strlcpy’ [-Werror=implicit-function-declaration] + gethost.c:196:9: warning: nested extern declaration of ‘strlcpy’ [-Wnested-externs] + + Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> + Reviewed-by: Daniel Stone <daniel@fooishbar.org> + +commit afeb2c22ba1f7193acf814954e66f40cfd699c17 +Author: Dr. Tilmann Bubeck <t.bubeck@reinform.de> +Date: Sun Oct 13 21:38:10 2013 +0200 + + Fix warning about warn_unused_result triggered by WRITES. + +commit 2eb4ef59d7c27ac7972954d406ad9c2fa8123672 +Author: Dr. Tilmann Bubeck <t.bubeck@reinform.de> +Date: Sun Oct 13 17:57:49 2013 +0200 + + * Do not install test_xauth during "make install" as it is + only used during "make check". + * perror out, if test_xauth does not find "cmdtest". + commit 4de4a231f3a718d2af0d2b00443c803f8bddfbc5 Author: Dr. Tilmann Bubeck <t.bubeck@reinform.de> Date: Wed Oct 9 23:45:15 2013 +0200 diff --git a/app/xauth/README b/app/xauth/README index 038d59089..2795b7952 100644 --- a/app/xauth/README +++ b/app/xauth/README @@ -38,3 +38,37 @@ For more information on the git code manager, see: http://wiki.x.org/wiki/GitPage + + IV. RELEASING + +This section describes how to release a new version of xauth to the +public. A detailed description of this process can be found at +http://www.x.org/wiki/Development/Documentation/ReleaseHOWTO with a +few clarification below. + +For releasing under Fedora make sure, that INSTALL in +/usr/share/util-macros/ exists. If not, then please create that +file. + +To release a new version of xauth, please follow this steps: + + * git clone git://anongit.freedesktop.org/git/xorg/app/xauth + * cd xauth ; ./autogen.sh ; make ; make check + * follow ReleaseHowto inside this directory. + +Ignore these errors shown during release.sh: + + /bin/sh: ../.changelog.tmp: Permission denied + git directory not found: installing possibly empty changelog. + + cp: cannot create regular file '../.INSTALL.tmp': Permission denied + util-macros "pkgdatadir" from xorg-macros.pc not found: installing possibly empty INSTALL. + + V. GARBAGE + +Please ignore this paragraph. It is only used to satisfying +release.sh, which wants to see the version number to the last version +in the diff, which is 1.0.9 in our case. This paragraph can be +deleted on the next release of xauth. + +[eof] diff --git a/app/xauth/aclocal.m4 b/app/xauth/aclocal.m4 index 0cfc668d5..fdbe2c7f3 100644 --- a/app/xauth/aclocal.m4 +++ b/app/xauth/aclocal.m4 @@ -1279,7 +1279,7 @@ dnl DEALINGS IN THE SOFTWARE. # See the "minimum version" comment for each macro you use to see what # version you require. m4_defun([XORG_MACROS_VERSION],[ -m4_define([vers_have], [1.17.1]) +m4_define([vers_have], [1.19.0]) m4_define([maj_have], m4_substr(vers_have, 0, m4_index(vers_have, [.]))) m4_define([maj_needed], m4_substr([$1], 0, m4_index([$1], [.]))) m4_if(m4_cmp(maj_have, maj_needed), 0,, @@ -1329,6 +1329,7 @@ if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then AC_MSG_RESULT([no]) else if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then + TRADITIONALCPPFLAGS="-traditional" RAWCPPFLAGS="${RAWCPPFLAGS} -traditional" AC_MSG_RESULT([yes]) else @@ -1337,6 +1338,7 @@ else fi rm -f conftest.$ac_ext AC_SUBST(RAWCPPFLAGS) +AC_SUBST(TRADITIONALCPPFLAGS) ]) # XORG_PROG_RAWCPP # XORG_MANPAGE_SECTIONS() @@ -1861,9 +1863,10 @@ AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes]) ]) # XORG_WITH_ASCIIDOC # XORG_WITH_DOXYGEN([MIN-VERSION], [DEFAULT]) -# -------------------------------- +# ------------------------------------------- # Minimum version: 1.5.0 # Minimum version for optional DEFAULT argument: 1.11.0 +# Minimum version for optional DOT checking: 1.18.0 # # Documentation tools are not always available on all platforms and sometimes # not at the appropriate level. This macro enables a module to test for the @@ -1883,6 +1886,7 @@ AM_CONDITIONAL([HAVE_ASCIIDOC], [test "$have_asciidoc" = yes]) # AC_DEFUN([XORG_WITH_DOXYGEN],[ AC_ARG_VAR([DOXYGEN], [Path to doxygen command]) +AC_ARG_VAR([DOT], [Path to the dot graphics utility]) m4_define([_defopt], m4_default([$2], [auto])) AC_ARG_WITH(doxygen, AS_HELP_STRING([--with-doxygen], @@ -1926,6 +1930,20 @@ m4_ifval([$1], AC_MSG_ERROR([doxygen version $doxygen_version found, but $1 needed]) fi]) fi]) + +dnl Check for DOT if we have doxygen. The caller decides if it is mandatory +dnl HAVE_DOT is a variable that can be used in your doxygen.in config file: +dnl HAVE_DOT = @HAVE_DOT@ +HAVE_DOT=no +if test "x$have_doxygen" = "xyes"; then + AC_PATH_PROG([DOT], [dot]) + if test "x$DOT" != "x"; then + HAVE_DOT=yes + fi +fi + +AC_SUBST([HAVE_DOT]) +AM_CONDITIONAL([HAVE_DOT], [test "$HAVE_DOT" = "yes"]) AM_CONDITIONAL([HAVE_DOXYGEN], [test "$have_doxygen" = yes]) ]) # XORG_WITH_DOXYGEN @@ -2108,6 +2126,29 @@ fi]) AM_CONDITIONAL([HAVE_FOP], [test "$have_fop" = yes]) ]) # XORG_WITH_FOP +# XORG_WITH_M4([MIN-VERSION]) +# --------------------------- +# Minimum version: 1.19.0 +# +# This macro attempts to locate an m4 macro processor which supports +# -I option and is only useful for modules relying on M4 in order to +# expand macros in source code files. +# +# Interface to module: +# M4: returns the path of the m4 program found +# returns the path set by the user in the environment +# +AC_DEFUN([XORG_WITH_M4], [ +AC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4], + [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4], + [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \ + ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]], + [AC_MSG_ERROR([could not find m4 that supports -I option])], + [$PATH:/usr/gnu/bin])]) + +AC_SUBST([M4], [$ac_cv_path_M4]) +]) # XORG_WITH_M4 + # XORG_WITH_PS2PDF([DEFAULT]) # ---------------- # Minimum version: 1.6.0 @@ -2562,7 +2603,8 @@ AC_ARG_ENABLE(malloc0returnsnull, AC_MSG_CHECKING([whether malloc(0) returns NULL]) if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then - AC_RUN_IFELSE([AC_LANG_PROGRAM([ +AC_CACHE_VAL([xorg_cv_malloc0_returns_null], + [AC_RUN_IFELSE([AC_LANG_PROGRAM([ #include <stdlib.h> ],[ char *m0, *r0, *c0, *p; @@ -2572,9 +2614,9 @@ if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then c0 = calloc(0,10); exit((m0 == 0 || r0 == 0 || c0 == 0) ? 0 : 1); ])], - [MALLOC_ZERO_RETURNS_NULL=yes], - [MALLOC_ZERO_RETURNS_NULL=no], - [MALLOC_ZERO_RETURNS_NULL=yes]) + [xorg_cv_malloc0_returns_null=yes], + [xorg_cv_malloc0_returns_null=no])]) +MALLOC_ZERO_RETURNS_NULL=$xorg_cv_malloc0_returns_null fi AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL]) @@ -2863,7 +2905,7 @@ AC_LANG_CASE( XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-prototypes]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wnested-externs]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wbad-function-cast]) - XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition]) + XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wold-style-definition], [-fd]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wdeclaration-after-statement]) ] ) @@ -2872,16 +2914,17 @@ AC_LANG_CASE( XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wunused]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wuninitialized]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wshadow]) -XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-noreturn]) XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wmissing-format-attribute]) +# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls]) +XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op]) # These are currently disabled because they are noisy. They will be enabled # in the future once the codebase is sufficiently modernized to silence # them. For now, I don't want them to drown out the other warnings. -# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op]) # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses]) # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align]) +# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual]) # Turn some warnings into errors, so we don't accidently get successful builds # when there are problems that should be fixed. @@ -3123,12 +3166,12 @@ AC_DEFUN([XTRANS_TCP_FLAGS],[ AC_SEARCH_LIBS(socket, [socket]) AC_SEARCH_LIBS(gethostbyname, [nsl]) if test "$ac_cv_search_socket$ac_cv_search_gethostbyname" = "nono"; then - AC_HAVE_LIBRARY([ws2_32]) + AC_CHECK_LIB([ws2_32],[main]) fi # Needs to come after above checks for libsocket & libnsl for SVR4 systems AC_ARG_ENABLE(ipv6, - AC_HELP_STRING([--enable-ipv6],[Enable IPv6 support]), + AS_HELP_STRING([--enable-ipv6],[Enable IPv6 support]), [IPV6CONN=$enableval], [AC_CHECK_FUNC(getaddrinfo,[IPV6CONN=yes],[IPV6CONN=no])]) AC_MSG_CHECKING([if IPv6 support should be built]) @@ -3151,6 +3194,41 @@ AC_DEFUN([XTRANS_TCP_FLAGS],[ AC_INCLUDES_DEFAULT #include <sys/socket.h>]) + # XPG4v2/UNIX95 added msg_control - check to see if we need to define + # _XOPEN_SOURCE to get it (such as on Solaris) + AC_CHECK_MEMBER([struct msghdr.msg_control], [], [], + [ +AC_INCLUDES_DEFAULT +#include <sys/socket.h> + ]) + # First try for Solaris in C99 compliant mode, which requires XPG6/UNIX03 + if test "x$ac_cv_member_struct_msghdr_msg_control" = xno; then + unset ac_cv_member_struct_msghdr_msg_control + AC_MSG_NOTICE([trying again with _XOPEN_SOURCE=600]) + AC_CHECK_MEMBER([struct msghdr.msg_control], + [AC_DEFINE([_XOPEN_SOURCE], [600], + [Defined if needed to expose struct msghdr.msg_control]) + ], [], [ +#define _XOPEN_SOURCE 600 +AC_INCLUDES_DEFAULT +#include <sys/socket.h> + ]) + fi + # If that didn't work, fall back to XPG5/UNIX98 with C89 + if test "x$ac_cv_member_struct_msghdr_msg_control" = xno; then + unset ac_cv_member_struct_msghdr_msg_control + AC_MSG_NOTICE([trying again with _XOPEN_SOURCE=500]) + AC_CHECK_MEMBER([struct msghdr.msg_control], + [AC_DEFINE([_XOPEN_SOURCE], [500], + [Defined if needed to expose struct msghdr.msg_control]) + ], [], [ +#define _XOPEN_SOURCE 500 +AC_INCLUDES_DEFAULT +#include <sys/socket.h> + ]) + fi + + ]) # XTRANS_TCP_FLAGS # XTRANS_CONNECTION_FLAGS() @@ -3159,13 +3237,12 @@ AC_INCLUDES_DEFAULT # that use Xtrans functions AC_DEFUN([XTRANS_CONNECTION_FLAGS],[ AC_REQUIRE([AC_CANONICAL_HOST]) - AC_REQUIRE([AC_TYPE_SIGNAL]) [case $host_os in mingw*) unixdef="no" ;; *) unixdef="yes" ;; esac] AC_ARG_ENABLE(unix-transport, - AC_HELP_STRING([--enable-unix-transport],[Enable UNIX domain socket transport]), + AS_HELP_STRING([--enable-unix-transport],[Enable UNIX domain socket transport]), [UNIXCONN=$enableval], [UNIXCONN=$unixdef]) AC_MSG_CHECKING([if Xtrans should support UNIX socket connections]) if test "$UNIXCONN" = "yes"; then @@ -3173,7 +3250,7 @@ AC_DEFUN([XTRANS_CONNECTION_FLAGS],[ fi AC_MSG_RESULT($UNIXCONN) AC_ARG_ENABLE(tcp-transport, - AC_HELP_STRING([--enable-tcp-transport],[Enable TCP socket transport]), + AS_HELP_STRING([--enable-tcp-transport],[Enable TCP socket transport]), [TCPCONN=$enableval], [TCPCONN=yes]) AC_MSG_CHECKING([if Xtrans should support TCP socket connections]) AC_MSG_RESULT($TCPCONN) @@ -3186,7 +3263,7 @@ AC_DEFUN([XTRANS_CONNECTION_FLAGS],[ *) localdef="no" ;; esac] AC_ARG_ENABLE(local-transport, - AC_HELP_STRING([--enable-local-transport],[Enable os-specific local transport]), + AS_HELP_STRING([--enable-local-transport],[Enable os-specific local transport]), [LOCALCONN=$enableval], [LOCALCONN=$localdef]) AC_MSG_CHECKING([if Xtrans should support os-specific local connections]) AC_MSG_RESULT($LOCALCONN) @@ -3204,7 +3281,7 @@ AC_DEFUN([XTRANS_CONNECTION_FLAGS],[ AC_DEFUN([XTRANS_SECURE_RPC_FLAGS], [AC_REQUIRE([XTRANS_TCP_FLAGS]) AC_ARG_ENABLE(secure-rpc, - AC_HELP_STRING([--enable-secure-rpc],[Enable Secure RPC]), + AS_HELP_STRING([--enable-secure-rpc],[Enable Secure RPC]), [SECURE_RPC=$enableval], [SECURE_RPC="try"]) if test "x$SECURE_RPC" = "xyes" -o "x$SECURE_RPC" = "xtry" ; then diff --git a/app/xauth/config.h.in b/app/xauth/config.h.in index 4591d294e..1428b0e77 100644 --- a/app/xauth/config.h.in +++ b/app/xauth/config.h.in @@ -78,9 +78,6 @@ /* Patch version of this package */ #undef PACKAGE_VERSION_PATCHLEVEL -/* Define as the return type of signal handlers (`int' or `void'). */ -#undef RETSIGTYPE - /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS @@ -90,5 +87,40 @@ /* Support UNIX socket connections */ #undef UNIXCONN +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif + + /* Version number of package */ #undef VERSION + +/* Define to 1 if on MINIX. */ +#undef _MINIX + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +#undef _POSIX_1_SOURCE + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +#undef _POSIX_SOURCE + +/* Defined if needed to expose struct msghdr.msg_control */ +#undef _XOPEN_SOURCE diff --git a/app/xauth/configure b/app/xauth/configure index 2e9b0db43..0b97309ed 100644 --- a/app/xauth/configure +++ b/app/xauth/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for xauth 1.0.8. +# Generated by GNU Autoconf 2.69 for xauth 1.0.9. # # Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg>. # @@ -581,8 +581,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='xauth' PACKAGE_TARNAME='xauth' -PACKAGE_VERSION='1.0.8' -PACKAGE_STRING='xauth 1.0.8' +PACKAGE_VERSION='1.0.9' +PACKAGE_STRING='xauth 1.0.9' PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg' PACKAGE_URL='' @@ -1321,7 +1321,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures xauth 1.0.8 to adapt to many kinds of systems. +\`configure' configures xauth 1.0.9 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1391,7 +1391,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of xauth 1.0.8:";; + short | recursive ) echo "Configuration of xauth 1.0.9:";; esac cat <<\_ACEOF @@ -1512,7 +1512,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -xauth configure 1.0.8 +xauth configure 1.0.9 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1564,52 +1564,6 @@ fi } # ac_fn_c_try_compile -# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES -# --------------------------------------------- -# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR -# accordingly. -ac_fn_c_check_decl () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - as_decl_name=`echo $2|sed 's/ *(.*//'` - as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 -$as_echo_n "checking whether $as_decl_name is declared... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -int -main () -{ -#ifndef $as_decl_name -#ifdef __cplusplus - (void) $as_decl_use; -#else - (void) $as_decl_name; -#endif -#endif - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_decl - # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. @@ -1647,6 +1601,97 @@ fi } # ac_fn_c_try_cpp +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} +( $as_echo "## ---------------------------------------------------------------------- ## +## Report this to https://bugs.freedesktop.org/enter_bug.cgi?product=xorg ## +## ---------------------------------------------------------------------- ##" + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes @@ -1720,6 +1765,52 @@ $as_echo "$ac_res" >&6; } } # ac_fn_c_check_header_compile +# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES +# --------------------------------------------- +# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR +# accordingly. +ac_fn_c_check_decl () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + as_decl_name=`echo $2|sed 's/ *(.*//'` + as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 +$as_echo_n "checking whether $as_decl_name is declared... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +int +main () +{ +#ifndef $as_decl_name +#ifdef __cplusplus + (void) $as_decl_use; +#else + (void) $as_decl_name; +#endif +#endif + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_decl + # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. @@ -1766,97 +1857,6 @@ fi } # ac_fn_c_try_link -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if eval \${$3+:} false; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.i conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} -( $as_echo "## ---------------------------------------------------------------------- ## -## Report this to https://bugs.freedesktop.org/enter_bug.cgi?product=xorg ## -## ---------------------------------------------------------------------- ##" - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if eval \${$3+:} false; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno - -} # ac_fn_c_check_header_mongrel - # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly @@ -2038,7 +2038,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by xauth $as_me 1.0.8, which was +It was created by xauth $as_me 1.0.9, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2862,7 +2862,7 @@ fi # Define the identity of the package. PACKAGE='xauth' - VERSION='1.0.8' + VERSION='1.0.9' cat >>confdefs.h <<_ACEOF @@ -2935,18 +2935,9 @@ fi ac_config_headers="$ac_config_headers config.h" -# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS - - - - - - - - - - - +# Set common system defines for POSIX extensions, such as _GNU_SOURCE +# Must be called before any macros that run the compiler (like +# AC_PROG_LIBTOOL) to avoid autoconf errors. DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" @@ -3927,183 +3918,6 @@ else fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 -$as_echo_n "checking for $CC option to accept ISO C99... " >&6; } -if ${ac_cv_prog_cc_c99+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_cv_prog_cc_c99=no -ac_save_CC=$CC -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <stdarg.h> -#include <stdbool.h> -#include <stdlib.h> -#include <wchar.h> -#include <stdio.h> - -// Check varargs macros. These examples are taken from C99 6.10.3.5. -#define debug(...) fprintf (stderr, __VA_ARGS__) -#define showlist(...) puts (#__VA_ARGS__) -#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) -static void -test_varargs_macros (void) -{ - int x = 1234; - int y = 5678; - debug ("Flag"); - debug ("X = %d\n", x); - showlist (The first, second, and third items.); - report (x>y, "x is %d but y is %d", x, y); -} - -// Check long long types. -#define BIG64 18446744073709551615ull -#define BIG32 4294967295ul -#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) -#if !BIG_OK - your preprocessor is broken; -#endif -#if BIG_OK -#else - your preprocessor is broken; -#endif -static long long int bignum = -9223372036854775807LL; -static unsigned long long int ubignum = BIG64; - -struct incomplete_array -{ - int datasize; - double data[]; -}; - -struct named_init { - int number; - const wchar_t *name; - double average; -}; - -typedef const char *ccp; - -static inline int -test_restrict (ccp restrict text) -{ - // See if C++-style comments work. - // Iterate through items via the restricted pointer. - // Also check for declarations in for loops. - for (unsigned int i = 0; *(text+i) != '\0'; ++i) - continue; - return 0; -} - -// Check varargs and va_copy. -static void -test_varargs (const char *format, ...) -{ - va_list args; - va_start (args, format); - va_list args_copy; - va_copy (args_copy, args); - - const char *str; - int number; - float fnumber; - - while (*format) - { - switch (*format++) - { - case 's': // string - str = va_arg (args_copy, const char *); - break; - case 'd': // int - number = va_arg (args_copy, int); - break; - case 'f': // float - fnumber = va_arg (args_copy, double); - break; - default: - break; - } - } - va_end (args_copy); - va_end (args); -} - -int -main () -{ - - // Check bool. - _Bool success = false; - - // Check restrict. - if (test_restrict ("String literal") == 0) - success = true; - char *restrict newvar = "Another string"; - - // Check varargs. - test_varargs ("s, d' f .", "string", 65, 34.234); - test_varargs_macros (); - - // Check flexible array members. - struct incomplete_array *ia = - malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); - ia->datasize = 10; - for (int i = 0; i < ia->datasize; ++i) - ia->data[i] = i * 1.234; - - // Check named initializers. - struct named_init ni = { - .number = 34, - .name = L"Test wide string", - .average = 543.34343, - }; - - ni.number = 58; - - int dynamic_array[ni.number]; - dynamic_array[ni.number - 1] = 543; - - // work around unused variable warnings - return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' - || dynamic_array[ni.number - 1] != 543); - - ; - return 0; -} -_ACEOF -for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99 -do - CC="$ac_save_CC $ac_arg" - if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_prog_cc_c99=$ac_arg -fi -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c99" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c99" in - x) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; - xno) - { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c99" - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 -$as_echo "$ac_cv_prog_cc_c99" >&6; } ;; -esac -if test "x$ac_cv_prog_cc_c99" != xno; then : - -fi - - ac_ext=c ac_cpp='$CPP $CPPFLAGS' @@ -4503,6 +4317,257 @@ done + ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default" +if test "x$ac_cv_header_minix_config_h" = xyes; then : + MINIX=yes +else + MINIX= +fi + + + if test "$MINIX" = yes; then + +$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h + + +$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h + + +$as_echo "#define _MINIX 1" >>confdefs.h + + fi + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5 +$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if ${ac_cv_safe_to_define___extensions__+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +# define __EXTENSIONS__ 1 + $ac_includes_default +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_safe_to_define___extensions__=yes +else + ac_cv_safe_to_define___extensions__=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5 +$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h + + $as_echo "#define _ALL_SOURCE 1" >>confdefs.h + + $as_echo "#define _GNU_SOURCE 1" >>confdefs.h + + $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h + + $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h + + + +# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS + + + + + + + + + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5 +$as_echo_n "checking for $CC option to accept ISO C99... " >&6; } +if ${ac_cv_prog_cc_c99+:} false; then : + $as_echo_n "(cached) " >&6 +else + ac_cv_prog_cc_c99=no +ac_save_CC=$CC +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <stdarg.h> +#include <stdbool.h> +#include <stdlib.h> +#include <wchar.h> +#include <stdio.h> + +// Check varargs macros. These examples are taken from C99 6.10.3.5. +#define debug(...) fprintf (stderr, __VA_ARGS__) +#define showlist(...) puts (#__VA_ARGS__) +#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) +static void +test_varargs_macros (void) +{ + int x = 1234; + int y = 5678; + debug ("Flag"); + debug ("X = %d\n", x); + showlist (The first, second, and third items.); + report (x>y, "x is %d but y is %d", x, y); +} + +// Check long long types. +#define BIG64 18446744073709551615ull +#define BIG32 4294967295ul +#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) +#if !BIG_OK + your preprocessor is broken; +#endif +#if BIG_OK +#else + your preprocessor is broken; +#endif +static long long int bignum = -9223372036854775807LL; +static unsigned long long int ubignum = BIG64; + +struct incomplete_array +{ + int datasize; + double data[]; +}; + +struct named_init { + int number; + const wchar_t *name; + double average; +}; + +typedef const char *ccp; + +static inline int +test_restrict (ccp restrict text) +{ + // See if C++-style comments work. + // Iterate through items via the restricted pointer. + // Also check for declarations in for loops. + for (unsigned int i = 0; *(text+i) != '\0'; ++i) + continue; + return 0; +} + +// Check varargs and va_copy. +static void +test_varargs (const char *format, ...) +{ + va_list args; + va_start (args, format); + va_list args_copy; + va_copy (args_copy, args); + + const char *str; + int number; + float fnumber; + + while (*format) + { + switch (*format++) + { + case 's': // string + str = va_arg (args_copy, const char *); + break; + case 'd': // int + number = va_arg (args_copy, int); + break; + case 'f': // float + fnumber = va_arg (args_copy, double); + break; + default: + break; + } + } + va_end (args_copy); + va_end (args); +} + +int +main () +{ + + // Check bool. + _Bool success = false; + + // Check restrict. + if (test_restrict ("String literal") == 0) + success = true; + char *restrict newvar = "Another string"; + + // Check varargs. + test_varargs ("s, d' f .", "string", 65, 34.234); + test_varargs_macros (); + + // Check flexible array members. + struct incomplete_array *ia = + malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); + ia->datasize = 10; + for (int i = 0; i < ia->datasize; ++i) + ia->data[i] = i * 1.234; + + // Check named initializers. + struct named_init ni = { + .number = 34, + .name = L"Test wide string", + .average = 543.34343, + }; + + ni.number = 58; + + int dynamic_array[ni.number]; + dynamic_array[ni.number - 1] = 543; + + // work around unused variable warnings + return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x' + || dynamic_array[ni.number - 1] != 543); + + ; + return 0; +} +_ACEOF +for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99 +do + CC="$ac_save_CC $ac_arg" + if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_prog_cc_c99=$ac_arg +fi +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c99" != "xno" && break +done +rm -f conftest.$ac_ext +CC=$ac_save_CC + +fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c99" in + x) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; + xno) + { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c99" + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 +$as_echo "$ac_cv_prog_cc_c99" >&6; } ;; +esac +if test "x$ac_cv_prog_cc_c99" != xno; then : + +fi + + + @@ -5924,6 +5989,55 @@ $as_echo "$supported" >&6; } fi fi + if test $found = "no" ; then + if test "x$xorg_testset_cc_unknown_warning_option" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unknown-warning-option" + fi + + if test "x$xorg_testset_cc_unused_command_line_argument" = "xyes" ; then + CFLAGS="$CFLAGS -Werror=unused-command-line-argument" + fi + + CFLAGS="$CFLAGS -fd" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -fd" >&5 +$as_echo_n "checking if $CC supports -fd... " >&6; } + cacheid=xorg_cv_cc_flag__fd + if eval \${$cacheid+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +int i; +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + eval $cacheid=yes +else + eval $cacheid=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi + + + CFLAGS="$xorg_testset_save_CFLAGS" + + eval supported=\$$cacheid + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 +$as_echo "$supported" >&6; } + if test "$supported" = "yes" ; then + BASE_CFLAGS="$BASE_CFLAGS -fd" + found="yes" + fi + fi + @@ -6478,11 +6592,11 @@ found="no" CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi - CFLAGS="$CFLAGS -Wcast-qual" + CFLAGS="$CFLAGS -Wmissing-noreturn" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wcast-qual" >&5 -$as_echo_n "checking if $CC supports -Wcast-qual... " >&6; } - cacheid=xorg_cv_cc_flag__Wcast_qual + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wmissing-noreturn" >&5 +$as_echo_n "checking if $CC supports -Wmissing-noreturn... " >&6; } + cacheid=xorg_cv_cc_flag__Wmissing_noreturn if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else @@ -6513,7 +6627,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then - BASE_CFLAGS="$BASE_CFLAGS -Wcast-qual" + BASE_CFLAGS="$BASE_CFLAGS -Wmissing-noreturn" found="yes" fi fi @@ -6596,11 +6710,11 @@ found="no" CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi - CFLAGS="$CFLAGS -Wmissing-noreturn" + CFLAGS="$CFLAGS -Wmissing-format-attribute" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wmissing-noreturn" >&5 -$as_echo_n "checking if $CC supports -Wmissing-noreturn... " >&6; } - cacheid=xorg_cv_cc_flag__Wmissing_noreturn + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wmissing-format-attribute" >&5 +$as_echo_n "checking if $CC supports -Wmissing-format-attribute... " >&6; } + cacheid=xorg_cv_cc_flag__Wmissing_format_attribute if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else @@ -6631,12 +6745,13 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then - BASE_CFLAGS="$BASE_CFLAGS -Wmissing-noreturn" + BASE_CFLAGS="$BASE_CFLAGS -Wmissing-format-attribute" found="yes" fi fi +# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wredundant-decls]) @@ -6714,11 +6829,11 @@ found="no" CFLAGS="$CFLAGS -Werror=unused-command-line-argument" fi - CFLAGS="$CFLAGS -Wmissing-format-attribute" + CFLAGS="$CFLAGS -Wlogical-op" - { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wmissing-format-attribute" >&5 -$as_echo_n "checking if $CC supports -Wmissing-format-attribute... " >&6; } - cacheid=xorg_cv_cc_flag__Wmissing_format_attribute + { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC supports -Wlogical-op" >&5 +$as_echo_n "checking if $CC supports -Wlogical-op... " >&6; } + cacheid=xorg_cv_cc_flag__Wlogical_op if eval \${$cacheid+:} false; then : $as_echo_n "(cached) " >&6 else @@ -6749,7 +6864,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $supported" >&5 $as_echo "$supported" >&6; } if test "$supported" = "yes" ; then - BASE_CFLAGS="$BASE_CFLAGS -Wmissing-format-attribute" + BASE_CFLAGS="$BASE_CFLAGS -Wlogical-op" found="yes" fi fi @@ -6759,9 +6874,9 @@ $as_echo "$supported" >&6; } # These are currently disabled because they are noisy. They will be enabled # in the future once the codebase is sufficiently modernized to silence # them. For now, I don't want them to drown out the other warnings. -# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wlogical-op]) # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wparentheses]) # XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-align]) +# XORG_TESTSET_CFLAG([[BASE_]PREFIX[FLAGS]], [-Wcast-qual]) # Turn some warnings into errors, so we don't accidently get successful builds # when there are problems that should be fixed. @@ -10725,40 +10840,6 @@ fi # Transport selection macro from xtrans.m4 # Needed to set *CONN defines for gethost.c & parsedpy.c -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 -$as_echo_n "checking return type of signal handlers... " >&6; } -if ${ac_cv_type_signal+:} false; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <sys/types.h> -#include <signal.h> - -int -main () -{ -return *(signal (0, 0)) (0) == 1; - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_type_signal=int -else - ac_cv_type_signal=void -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_type_signal" >&5 -$as_echo "$ac_cv_type_signal" >&6; } - -cat >>confdefs.h <<_ACEOF -#define RETSIGTYPE $ac_cv_type_signal -_ACEOF - - - case $host_os in @@ -10949,7 +11030,6 @@ _ACEOF LIBS="-lws2_32 $LIBS" fi -ac_cv_lib_ws2_32=ac_cv_lib_ws2_32_main fi @@ -11006,6 +11086,57 @@ _ACEOF fi + # XPG4v2/UNIX95 added msg_control - check to see if we need to define + # _XOPEN_SOURCE to get it (such as on Solaris) + ac_fn_c_check_member "$LINENO" "struct msghdr" "msg_control" "ac_cv_member_struct_msghdr_msg_control" " +$ac_includes_default +#include <sys/socket.h> + +" +if test "x$ac_cv_member_struct_msghdr_msg_control" = xyes; then : + +fi + + # First try for Solaris in C99 compliant mode, which requires XPG6/UNIX03 + if test "x$ac_cv_member_struct_msghdr_msg_control" = xno; then + unset ac_cv_member_struct_msghdr_msg_control + { $as_echo "$as_me:${as_lineno-$LINENO}: trying again with _XOPEN_SOURCE=600" >&5 +$as_echo "$as_me: trying again with _XOPEN_SOURCE=600" >&6;} + ac_fn_c_check_member "$LINENO" "struct msghdr" "msg_control" "ac_cv_member_struct_msghdr_msg_control" " +#define _XOPEN_SOURCE 600 +$ac_includes_default +#include <sys/socket.h> + +" +if test "x$ac_cv_member_struct_msghdr_msg_control" = xyes; then : + +$as_echo "#define _XOPEN_SOURCE 600" >>confdefs.h + + +fi + + fi + # If that didn't work, fall back to XPG5/UNIX98 with C89 + if test "x$ac_cv_member_struct_msghdr_msg_control" = xno; then + unset ac_cv_member_struct_msghdr_msg_control + { $as_echo "$as_me:${as_lineno-$LINENO}: trying again with _XOPEN_SOURCE=500" >&5 +$as_echo "$as_me: trying again with _XOPEN_SOURCE=500" >&6;} + ac_fn_c_check_member "$LINENO" "struct msghdr" "msg_control" "ac_cv_member_struct_msghdr_msg_control" " +#define _XOPEN_SOURCE 500 +$ac_includes_default +#include <sys/socket.h> + +" +if test "x$ac_cv_member_struct_msghdr_msg_control" = xyes; then : + +$as_echo "#define _XOPEN_SOURCE 500" >>confdefs.h + + +fi + + fi + + fi case $host_os in @@ -11673,7 +11804,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by xauth $as_me 1.0.8, which was +This file was extended by xauth $as_me 1.0.9, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -11739,7 +11870,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -xauth config.status 1.0.8 +xauth config.status 1.0.9 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/app/xauth/configure.ac b/app/xauth/configure.ac index 3b135a9ca..2d36ed521 100644 --- a/app/xauth/configure.ac +++ b/app/xauth/configure.ac @@ -22,7 +22,7 @@ dnl Process this file with autoconf to create configure. AC_PREREQ([2.60]) AC_INIT([xauth], - [1.0.8], + [1.0.9], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [xauth]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) @@ -30,6 +30,11 @@ AM_MAINTAINER_MODE AC_CONFIG_HEADERS([config.h]) +# Set common system defines for POSIX extensions, such as _GNU_SOURCE +# Must be called before any macros that run the compiler (like +# AC_PROG_LIBTOOL) to avoid autoconf errors. +AC_USE_SYSTEM_EXTENSIONS + # Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS m4_ifndef([XORG_MACROS_VERSION], [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])]) diff --git a/app/xauth/process.c b/app/xauth/process.c index 45ddacdc8..b44858a8b 100644 --- a/app/xauth/process.c +++ b/app/xauth/process.c @@ -636,8 +636,9 @@ static const char *xauth_filename = NULL; static volatile Bool dieing = False; -/* poor man's puts(), for under signal handlers */ -#define WRITES(fd, S) (void)write((fd), (S), strlen((S))) +/* poor man's puts(), for under signal handlers, + extended to ignore warn_unused_result */ +#define WRITES(fd, S) {if(write((fd), (S), strlen((S))));} /* ARGSUSED */ _X_NORETURN diff --git a/app/xauth/test-driver b/app/xauth/test-driver new file mode 100644 index 000000000..32bf39e83 --- /dev/null +++ b/app/xauth/test-driver @@ -0,0 +1,127 @@ +#! /bin/sh +# test-driver - basic testsuite driver script. + +scriptversion=2012-06-27.10; # UTC + +# Copyright (C) 2011-2013 Free Software Foundation, Inc. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see <http://www.gnu.org/licenses/>. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to <bug-automake@gnu.org> or send patches to +# <automake-patches@gnu.org>. + +# Make unconditional expansion of undefined variables an error. This +# helps a lot in preventing typo-related bugs. +set -u + +usage_error () +{ + echo "$0: $*" >&2 + print_usage >&2 + exit 2 +} + +print_usage () +{ + cat <<END +Usage: + test-driver --test-name=NAME --log-file=PATH --trs-file=PATH + [--expect-failure={yes|no}] [--color-tests={yes|no}] + [--enable-hard-errors={yes|no}] [--] TEST-SCRIPT +The '--test-name', '--log-file' and '--trs-file' options are mandatory. +END +} + +# TODO: better error handling in option parsing (in particular, ensure +# TODO: $log_file, $trs_file and $test_name are defined). +test_name= # Used for reporting. +log_file= # Where to save the output of the test script. +trs_file= # Where to save the metadata of the test run. +expect_failure=no +color_tests=no +enable_hard_errors=yes +while test $# -gt 0; do + case $1 in + --help) print_usage; exit $?;; + --version) echo "test-driver $scriptversion"; exit $?;; + --test-name) test_name=$2; shift;; + --log-file) log_file=$2; shift;; + --trs-file) trs_file=$2; shift;; + --color-tests) color_tests=$2; shift;; + --expect-failure) expect_failure=$2; shift;; + --enable-hard-errors) enable_hard_errors=$2; shift;; + --) shift; break;; + -*) usage_error "invalid option: '$1'";; + esac + shift +done + +if test $color_tests = yes; then + # Keep this in sync with 'lib/am/check.am:$(am__tty_colors)'. + red='[0;31m' # Red. + grn='[0;32m' # Green. + lgn='[1;32m' # Light green. + blu='[1;34m' # Blue. + mgn='[0;35m' # Magenta. + std='[m' # No color. +else + red= grn= lgn= blu= mgn= std= +fi + +do_exit='rm -f $log_file $trs_file; (exit $st); exit $st' +trap "st=129; $do_exit" 1 +trap "st=130; $do_exit" 2 +trap "st=141; $do_exit" 13 +trap "st=143; $do_exit" 15 + +# Test script is run here. +"$@" >$log_file 2>&1 +estatus=$? +if test $enable_hard_errors = no && test $estatus -eq 99; then + estatus=1 +fi + +case $estatus:$expect_failure in + 0:yes) col=$red res=XPASS recheck=yes gcopy=yes;; + 0:*) col=$grn res=PASS recheck=no gcopy=no;; + 77:*) col=$blu res=SKIP recheck=no gcopy=yes;; + 99:*) col=$mgn res=ERROR recheck=yes gcopy=yes;; + *:yes) col=$lgn res=XFAIL recheck=no gcopy=yes;; + *:*) col=$red res=FAIL recheck=yes gcopy=yes;; +esac + +# Report outcome to console. +echo "${col}${res}${std}: $test_name" + +# Register the test result, and other relevant metadata. +echo ":test-result: $res" > $trs_file +echo ":global-test-result: $res" >> $trs_file +echo ":recheck: $recheck" >> $trs_file +echo ":copy-in-global-log: $gcopy" >> $trs_file + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-time-zone: "UTC" +# time-stamp-end: "; # UTC" +# End: diff --git a/app/xauth/tests/010-xauth-add-inet.script b/app/xauth/tests/010-xauth-add-inet.script new file mode 100644 index 000000000..97fe2afb2 --- /dev/null +++ b/app/xauth/tests/010-xauth-add-inet.script @@ -0,0 +1,20 @@ +#!/bin/bash + +# setup the test ennvironment inside this shell +. setup-sourced + +xauth add examplehost1/unix:0 MIT-MAGIC-COOKIE-1 b90b0fd1cf6a0e7a2c74c00000000001 +xauth add examplehost2/unix:0 . b90b0fd1cf6a0e7a2c74c00000000002 +xauth add examplehost3/unix:0 . b90b0fd1cf6a0e7a2c74c00000000003 + +xauth list +xauth nlist +xauth list examplehost1/unix:0 +xauth nlist examplehost2/unix:0 + +xauth remove examplehost1/unix:0 +xauth list +xauth remove examplehost2/unix:0 +xauth remove examplehost3/unix:0 +xauth list + diff --git a/app/xauth/tests/010-xauth-add-inet.stdout b/app/xauth/tests/010-xauth-add-inet.stdout new file mode 100644 index 000000000..1d6dc9f70 --- /dev/null +++ b/app/xauth/tests/010-xauth-add-inet.stdout @@ -0,0 +1,34 @@ +> xauth add examplehost1/unix:0 MIT-MAGIC-COOKIE-1 b90b0fd1cf6a0e7a2c74c00000000001 + exits with 0 +> xauth add examplehost2/unix:0 . b90b0fd1cf6a0e7a2c74c00000000002 + exits with 0 +> xauth add examplehost3/unix:0 . b90b0fd1cf6a0e7a2c74c00000000003 + exits with 0 +> xauth list +examplehost1/unix:0 MIT-MAGIC-COOKIE-1 b90b0fd1cf6a0e7a2c74c00000000001 +examplehost2/unix:0 MIT-MAGIC-COOKIE-1 b90b0fd1cf6a0e7a2c74c00000000002 +examplehost3/unix:0 MIT-MAGIC-COOKIE-1 b90b0fd1cf6a0e7a2c74c00000000003 + exits with 0 +> xauth nlist +0100 000c 6578616d706c65686f737431 0001 30 0012 4d49542d4d414749432d434f4f4b49452d31 0010 b90b0fd1cf6a0e7a2c74c00000000001 +0100 000c 6578616d706c65686f737432 0001 30 0012 4d49542d4d414749432d434f4f4b49452d31 0010 b90b0fd1cf6a0e7a2c74c00000000002 +0100 000c 6578616d706c65686f737433 0001 30 0012 4d49542d4d414749432d434f4f4b49452d31 0010 b90b0fd1cf6a0e7a2c74c00000000003 + exits with 0 +> xauth list examplehost1/unix:0 +examplehost1/unix:0 MIT-MAGIC-COOKIE-1 b90b0fd1cf6a0e7a2c74c00000000001 + exits with 0 +> xauth nlist examplehost2/unix:0 +0100 000c 6578616d706c65686f737432 0001 30 0012 4d49542d4d414749432d434f4f4b49452d31 0010 b90b0fd1cf6a0e7a2c74c00000000002 + exits with 0 +> xauth remove examplehost1/unix:0 + exits with 0 +> xauth list +examplehost2/unix:0 MIT-MAGIC-COOKIE-1 b90b0fd1cf6a0e7a2c74c00000000002 +examplehost3/unix:0 MIT-MAGIC-COOKIE-1 b90b0fd1cf6a0e7a2c74c00000000003 + exits with 0 +> xauth remove examplehost2/unix:0 + exits with 0 +> xauth remove examplehost3/unix:0 + exits with 0 +> xauth list + exits with 0 diff --git a/app/xauth/tests/020-xauth-add-local.script b/app/xauth/tests/020-xauth-add-local.script new file mode 100644 index 000000000..06850e3e8 --- /dev/null +++ b/app/xauth/tests/020-xauth-add-local.script @@ -0,0 +1,22 @@ +#!/bin/bash + +# setup the test ennvironment inside this shell +. setup-sourced + +# Execute the test +xauth add unix:0 . b90b0fd1cf6a0e7a2c74c00000000004 +xauth add 127.0.0.1:1 . b90b0fd1cf6a0e7a2c74c00000000005 +xauth add :2 . b90b0fd1cf6a0e7a2c74c00000000006 +xauth add :3.5 . b90b0fd1cf6a0e7a2c74c00000000007 +xauth add :4 . b90b0fd1cf6a0e7a2c74c00000000004 + +# List the number of entries added +xauth list | wc -l + +# Try to match them and print cookie +xauth list unix:0 | awk '{print $3}' +xauth list 127.0.0.1:1 | awk '{print $3}' +xauth list 127.0.0.1:2 | awk '{print $3}' +xauth list 127.0.0.1:3.6 | awk '{print $3}' +xauth list :4 | awk '{print $3}' + diff --git a/app/xauth/tests/020-xauth-add-local.stdout b/app/xauth/tests/020-xauth-add-local.stdout new file mode 100644 index 000000000..703f73761 --- /dev/null +++ b/app/xauth/tests/020-xauth-add-local.stdout @@ -0,0 +1,26 @@ +> xauth add unix:0 . b90b0fd1cf6a0e7a2c74c00000000004 + exits with 0 +> xauth add 127.0.0.1:1 . b90b0fd1cf6a0e7a2c74c00000000005 + exits with 0 +> xauth add :2 . b90b0fd1cf6a0e7a2c74c00000000006 + exits with 0 +> xauth add :3.5 . b90b0fd1cf6a0e7a2c74c00000000007 + exits with 0 +> xauth add :4 . b90b0fd1cf6a0e7a2c74c00000000004 + exits with 0 +7 +list +b90b0fd1cf6a0e7a2c74c00000000004 +0 +list +b90b0fd1cf6a0e7a2c74c00000000005 +0 +list +b90b0fd1cf6a0e7a2c74c00000000006 +0 +list +b90b0fd1cf6a0e7a2c74c00000000007 +0 +list +b90b0fd1cf6a0e7a2c74c00000000004 +0 diff --git a/app/xauth/tests/030-xauth-extract.script b/app/xauth/tests/030-xauth-extract.script new file mode 100644 index 000000000..0fd0bf0ea --- /dev/null +++ b/app/xauth/tests/030-xauth-extract.script @@ -0,0 +1,26 @@ +#!/bin/bash + +# setup the test ennvironment inside this shell +. setup-sourced + +# Execute the test +xauth add examplehost1/unix:0 . b90b0fd1cf6a0e7a2c74c00000000001 +xauth add examplehost2/unix:0 . b90b0fd1cf6a0e7a2c74c00000000002 +xauth add examplehost3/unix:0 . b90b0fd1cf6a0e7a2c74c00000000003 + +# Use xauth_silent because otherwise the system dependant pathes are printed +XAUTHORITY2=$DATADIR/.Xauthority2 +xauth_silent extract $XAUTHORITY2 examplehost2/unix:0 +xauth_silent -f $XAUTHORITY2 list + +XAUTHORITY3=$DATADIR/.Xauthority3 +xauth_silent extract $XAUTHORITY3 examplehost3/unix:0 +xauth_silent -f $XAUTHORITY3 list + +rm $XAUTHORITY ; touch $XAUTHORITY +xauth_silent merge $XAUTHORITY2 $XAUTHORITY3 +xauth list + + + + diff --git a/app/xauth/tests/030-xauth-extract.stdout b/app/xauth/tests/030-xauth-extract.stdout new file mode 100644 index 000000000..c02b8f221 --- /dev/null +++ b/app/xauth/tests/030-xauth-extract.stdout @@ -0,0 +1,22 @@ +> xauth add examplehost1/unix:0 . b90b0fd1cf6a0e7a2c74c00000000001 + exits with 0 +> xauth add examplehost2/unix:0 . b90b0fd1cf6a0e7a2c74c00000000002 + exits with 0 +> xauth add examplehost3/unix:0 . b90b0fd1cf6a0e7a2c74c00000000003 + exits with 0 +> xauth some silent commands which should not be logged... + exits with 0 +> xauth some silent commands which should not be logged... +examplehost2/unix:0 MIT-MAGIC-COOKIE-1 b90b0fd1cf6a0e7a2c74c00000000002 + exits with 0 +> xauth some silent commands which should not be logged... + exits with 0 +> xauth some silent commands which should not be logged... +examplehost3/unix:0 MIT-MAGIC-COOKIE-1 b90b0fd1cf6a0e7a2c74c00000000003 + exits with 0 +> xauth some silent commands which should not be logged... + exits with 0 +> xauth list +examplehost2/unix:0 MIT-MAGIC-COOKIE-1 b90b0fd1cf6a0e7a2c74c00000000002 +examplehost3/unix:0 MIT-MAGIC-COOKIE-1 b90b0fd1cf6a0e7a2c74c00000000003 + exits with 0 diff --git a/app/xauth/tests/040-xauth-source.script b/app/xauth/tests/040-xauth-source.script new file mode 100644 index 000000000..990920488 --- /dev/null +++ b/app/xauth/tests/040-xauth-source.script @@ -0,0 +1,10 @@ +#!/bin/bash + +# setup the test ennvironment inside this shell +. setup-sourced + +# Execute the test +CMDFILE=$DATADIR/xauth-cmdfile +echo add examplehost1/unix:0 . b90b0fd1cf6a0e7a2c74c00000000001 > $CMDFILE +xauth_silent source $CMDFILE +xauth list diff --git a/app/xauth/tests/040-xauth-source.stdout b/app/xauth/tests/040-xauth-source.stdout new file mode 100644 index 000000000..89a799ed2 --- /dev/null +++ b/app/xauth/tests/040-xauth-source.stdout @@ -0,0 +1,5 @@ +> xauth some silent commands which should not be logged... + exits with 0 +> xauth list +examplehost1/unix:0 MIT-MAGIC-COOKIE-1 b90b0fd1cf6a0e7a2c74c00000000001 + exits with 0 diff --git a/app/xauth/tests/090-xauth-bad-usage.script b/app/xauth/tests/090-xauth-bad-usage.script new file mode 100644 index 000000000..9f688be3f --- /dev/null +++ b/app/xauth/tests/090-xauth-bad-usage.script @@ -0,0 +1,17 @@ +#!/bin/bash + +# setup the test ennvironment inside this shell +. setup-sourced + +# Execute the test + +# The following displays are bad: +xauth add bad4/unix:0 . b90b0fd1cf6a0e7a2c74c0000000002 +xauth add bad4/unix:0 . ThisIsNotHex0e7a2c74c00000000011 +xauth add bad4/unxi:0 . b90b0fd1cf6a0e7a2c74c00000000021 +xauth add bad5/unix: . b90b0fd1cf6a0e7a2c74c00000000022 +xauth add bad6/something/unix:0 . b90b0fd1cf6a0e7a2c74c00000000023 +xauth add bad7/unix . b90b0fd1cf6a0e7a2c74c00000000024 +xauth add bad8 . b90b0fd1cf6a0e7a2c74c00000000025 +xauth add 127.0.0.:0 . b90b0fd1cf6a0e7a2c74c00000000026 + diff --git a/app/xauth/tests/090-xauth-bad-usage.stderr b/app/xauth/tests/090-xauth-bad-usage.stderr new file mode 100644 index 000000000..37992267f --- /dev/null +++ b/app/xauth/tests/090-xauth-bad-usage.stderr @@ -0,0 +1,8 @@ +../xauth: (argv):1: key contains odd number of or non-hex characters +../xauth: (argv):1: key contains odd number of or non-hex characters +../xauth: (argv):1: bad display name "bad4/unxi:0" in "add" command +../xauth: (argv):1: bad display name "bad5/unix:" in "add" command +../xauth: (argv):1: bad display name "bad6/something/unix:0" in "add" command +../xauth: (argv):1: bad display name "bad7/unix" in "add" command +../xauth: (argv):1: bad display name "bad8" in "add" command +../xauth: (argv):1: bad display name "127.0.0.:0" in "add" command diff --git a/app/xauth/tests/090-xauth-bad-usage.stdout b/app/xauth/tests/090-xauth-bad-usage.stdout new file mode 100644 index 000000000..842ca2e36 --- /dev/null +++ b/app/xauth/tests/090-xauth-bad-usage.stdout @@ -0,0 +1,16 @@ +> xauth add bad4/unix:0 . b90b0fd1cf6a0e7a2c74c0000000002 + exits with 1 +> xauth add bad4/unix:0 . ThisIsNotHex0e7a2c74c00000000011 + exits with 1 +> xauth add bad4/unxi:0 . b90b0fd1cf6a0e7a2c74c00000000021 + exits with 1 +> xauth add bad5/unix: . b90b0fd1cf6a0e7a2c74c00000000022 + exits with 1 +> xauth add bad6/something/unix:0 . b90b0fd1cf6a0e7a2c74c00000000023 + exits with 1 +> xauth add bad7/unix . b90b0fd1cf6a0e7a2c74c00000000024 + exits with 1 +> xauth add bad8 . b90b0fd1cf6a0e7a2c74c00000000025 + exits with 1 +> xauth add 127.0.0.:0 . b90b0fd1cf6a0e7a2c74c00000000026 + exits with 1 diff --git a/app/xauth/tests/Makefile.am b/app/xauth/tests/Makefile.am index 7ce5dbfd4..98b4c4e15 100644 --- a/app/xauth/tests/Makefile.am +++ b/app/xauth/tests/Makefile.am @@ -1,7 +1,14 @@ ## Process this file with automake to produce Makefile.in +EXTRA_DIST = setup-sourced \ + 010-xauth-add-inet.script 010-xauth-add-inet.stdout \ + 020-xauth-add-local.script 020-xauth-add-local.stdout \ + 030-xauth-extract.script 030-xauth-extract.stdout \ + 040-xauth-source.script 040-xauth-source.stdout \ + 090-xauth-bad-usage.script 090-xauth-bad-usage.stderr 090-xauth-bad-usage.stdout + TESTS = test_xauth -bin_PROGRAMS = test_xauth +check_PROGRAMS = test_xauth test_xauth_SOURCES = test_xauth.c diff --git a/app/xauth/tests/Makefile.in b/app/xauth/tests/Makefile.in index e37bf2fff..8f3634a16 100644 --- a/app/xauth/tests/Makefile.in +++ b/app/xauth/tests/Makefile.in @@ -13,7 +13,6 @@ # PARTICULAR PURPOSE. @SET_MAKE@ - VPATH = @srcdir@ am__make_dryrun = \ { \ @@ -51,7 +50,7 @@ POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ TESTS = test_xauth$(EXEEXT) -bin_PROGRAMS = test_xauth$(EXEEXT) +check_PROGRAMS = test_xauth$(EXEEXT) subdir = tests DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(top_srcdir)/depcomp @@ -63,8 +62,6 @@ mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = -am__installdirs = "$(DESTDIR)$(bindir)" -PROGRAMS = $(bin_PROGRAMS) am_test_xauth_OBJECTS = test_xauth.$(OBJEXT) test_xauth_OBJECTS = $(am_test_xauth_OBJECTS) test_xauth_LDADD = $(LDADD) @@ -233,6 +230,13 @@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ +EXTRA_DIST = setup-sourced \ + 010-xauth-add-inet.script 010-xauth-add-inet.stdout \ + 020-xauth-add-local.script 020-xauth-add-local.stdout \ + 030-xauth-extract.script 030-xauth-extract.stdout \ + 040-xauth-source.script 040-xauth-source.stdout \ + 090-xauth-bad-usage.script 090-xauth-bad-usage.stderr 090-xauth-bad-usage.stdout + test_xauth_SOURCES = test_xauth.c all: all-am @@ -268,46 +272,9 @@ $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): -install-binPROGRAMS: $(bin_PROGRAMS) - @$(NORMAL_INSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - if test -n "$$list"; then \ - echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ - $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ - fi; \ - for p in $$list; do echo "$$p $$p"; done | \ - sed 's/$(EXEEXT)$$//' | \ - while read p p1; do if test -f $$p; \ - then echo "$$p"; echo "$$p"; else :; fi; \ - done | \ - sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ - -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ - sed 'N;N;N;s,\n, ,g' | \ - $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ - { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ - if ($$2 == $$4) files[d] = files[d] " " $$1; \ - else { print "f", $$3 "/" $$4, $$1; } } \ - END { for (d in files) print "f", d, files[d] }' | \ - while read type dir files; do \ - if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ - test -z "$$files" || { \ - echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ - $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ - } \ - ; done - -uninstall-binPROGRAMS: - @$(NORMAL_UNINSTALL) - @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ - files=`for p in $$list; do echo "$$p"; done | \ - sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ - -e 's/$$/$(EXEEXT)/' `; \ - test -n "$$list" || exit 0; \ - echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ - cd "$(DESTDIR)$(bindir)" && rm -f $$files - -clean-binPROGRAMS: - -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) + +clean-checkPROGRAMS: + -test -z "$(check_PROGRAMS)" || rm -f $(check_PROGRAMS) test_xauth$(EXEEXT): $(test_xauth_OBJECTS) $(test_xauth_DEPENDENCIES) $(EXTRA_test_xauth_DEPENDENCIES) @rm -f test_xauth$(EXEEXT) $(AM_V_CCLD)$(LINK) $(test_xauth_OBJECTS) $(test_xauth_LDADD) $(LIBS) @@ -524,13 +491,11 @@ distdir: $(DISTFILES) fi; \ done check-am: all-am + $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-TESTS check: check-am -all-am: Makefile $(PROGRAMS) +all-am: Makefile installdirs: - for dir in "$(DESTDIR)$(bindir)"; do \ - test -z "$$dir" || $(MKDIR_P) "$$dir"; \ - done install: install-am install-exec: install-exec-am install-data: install-data-am @@ -563,7 +528,7 @@ maintainer-clean-generic: @echo "it deletes files that may require special tools to rebuild." clean: clean-am -clean-am: clean-binPROGRAMS clean-generic mostlyclean-am +clean-am: clean-checkPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) @@ -589,7 +554,7 @@ install-dvi: install-dvi-am install-dvi-am: -install-exec-am: install-binPROGRAMS +install-exec-am: install-html: install-html-am @@ -628,22 +593,22 @@ ps: ps-am ps-am: -uninstall-am: uninstall-binPROGRAMS +uninstall-am: .MAKE: check-am install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \ - clean-binPROGRAMS clean-generic cscopelist ctags distclean \ + clean-checkPROGRAMS clean-generic cscopelist ctags distclean \ distclean-compile distclean-generic distclean-tags distdir dvi \ dvi-am html html-am info info-am install install-am \ - install-binPROGRAMS install-data install-data-am install-dvi \ - install-dvi-am install-exec install-exec-am install-html \ - install-html-am install-info install-info-am install-man \ - install-pdf install-pdf-am install-ps install-ps-am \ - install-strip installcheck installcheck-am installdirs \ - maintainer-clean maintainer-clean-generic mostlyclean \ - mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \ - tags uninstall uninstall-am uninstall-binPROGRAMS + install-data install-data-am install-dvi install-dvi-am \ + install-exec install-exec-am install-html install-html-am \ + install-info install-info-am install-man install-pdf \ + install-pdf-am install-ps install-ps-am install-strip \ + installcheck installcheck-am installdirs maintainer-clean \ + maintainer-clean-generic mostlyclean mostlyclean-compile \ + mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ + uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. diff --git a/app/xauth/tests/setup-sourced b/app/xauth/tests/setup-sourced new file mode 100644 index 000000000..2ed1a6b76 --- /dev/null +++ b/app/xauth/tests/setup-sourced @@ -0,0 +1,26 @@ +# +# This script gets sourced by every test to setup a common environment. +# + +# Force all output to be standard english +export LANG=C + +# Define the name of the authority file, which we use during test. +export XAUTHORITY=${DATADIR:-/tmp}/.Xauthority + +# Start a new authority file +rm -f $XAUTHORITY ; touch $XAUTHORITY + +function xauth() +{ + echo "> xauth" "$@" + ../xauth "$@" + echo " exits with $?" +} + +function xauth_silent() +{ + echo "> xauth" "some silent commands which should not be logged..." + ../xauth "$@" + echo " exits with $?" +} diff --git a/app/xauth/tests/test_xauth.c b/app/xauth/tests/test_xauth.c index f4265ce19..8e9c2a2f8 100644 --- a/app/xauth/tests/test_xauth.c +++ b/app/xauth/tests/test_xauth.c @@ -1,6 +1,10 @@ +#include <stdio.h> +#include <stdlib.h> #include <unistd.h> int main(int argc, char *argv[]) { execlp("cmdtest", "cmdtest", ".", NULL); + perror("Unable to execute 'cmdtest'. Make sure, that it is installed"); + exit(1); } |