Menu

#41 <sys/types.h> should be included explicitly

Version 5.*
closed-accepted
nobody
5
2008-10-14
2007-12-27
Anonymous
No

I have problem compiling mod_auth_kerb 5.3 with FreeBSD-7.0 RC1.
It seems same as
http://lists.freebsd.org/pipermail/freebsd-apache/2006-January/000432.html .

The problem is [`u_char' undeclared] and it is declared in <sys/types.h>.
It would be included implicitly with oher #include expression in most system,
but In FreeBSD-7.0 it isn't.

I apply a patch shown below and it works fine, but I think it should be
written in each source file using `u_char'.
--- config.h.in.bak 2007-12-24 19:25:15.000000000 +0900
+++ config.h.in 2007-12-24 19:26:20.000000000 +0900
@@ -17,3 +17,5 @@

/* Define if your GSSAPI library supports handling SPNEGO tokens */
#undef GSSAPI_SUPPORTS_SPNEGO
+
+#include <sys/types.h>

thanks,

Discussion

  • Satosi KAMIYA

    Satosi KAMIYA - 2008-01-22

    Logged In: YES
    user_id=1988822
    Originator: NO

    I posted this ticket and make suitable patch shown below using autoconf feature.

    To work on FreeBSD-7.0, type this:
    % autoconf; ./configure --with-krb5=/usr --without-krb4; gmake

    ----
    Index: config.h.in
    ===================================================================
    RCS file: /cvsroot/modauthkerb/mod_auth_kerb/config.h.in,v
    retrieving revision 1.5
    diff -u -r1.5 config.h.in
    --- config.h.in 5 Aug 2005 15:16:29 -0000 1.5
    +++ config.h.in 22 Jan 2008 19:24:50 -0000
    @@ -1,4 +1,3 @@
    -
    /* Define to the version of this package. */
    /* Conflicts with defintions from Apache */
    /* #undef PACKAGE_VERSION */
    @@ -17,3 +16,9 @@

    /* Define if your GSSAPI library supports handling SPNEGO tokens */
    #undef GSSAPI_SUPPORTS_SPNEGO
    +
    +/* Define to 1 if you have the <unistd.h> header file. */
    +#undef HAVE_UNISTD_H
    +
    +/* Define to 1 if you have the <sys/types.h> header file. */
    +#undef HAVE_SYS_TYPES_H
    Index: configure.in
    ===================================================================
    RCS file: /cvsroot/modauthkerb/mod_auth_kerb/configure.in,v
    retrieving revision 1.35
    diff -u -r1.35 configure.in
    --- configure.in 6 Nov 2006 17:33:53 -0000 1.35
    +++ configure.in 22 Jan 2008 19:24:50 -0000
    @@ -17,7 +17,9 @@

    # Checks for header files.
    AC_HEADER_STDC
    -AC_CHECK_HEADERS([limits.h netdb.h stddef.h stdlib.h string.h unistd.h])
    +AC_CHECK_HEADERS([limits.h netdb.h stddef.h stdlib.h string.h])
    +AC_CHECK_HEADERS([unistd.h])
    +AC_CHECK_HEADERS([sys/types.h])

    # Checks for typedefs, structures, and compiler characteristics.
    #AC_C_CONST
    Index: spnegokrb5/spnegokrb5_locl.h
    ===================================================================
    RCS file: /cvsroot/modauthkerb/mod_auth_kerb/spnegokrb5/Attic/spnegokrb5_locl.h,v
    retrieving revision 1.4
    diff -u -r1.4 spnegokrb5_locl.h
    --- spnegokrb5/spnegokrb5_locl.h 16 Nov 2003 23:20:49 -0000 1.4
    +++ spnegokrb5/spnegokrb5_locl.h 22 Jan 2008 19:24:50 -0000
    @@ -4,6 +4,10 @@

    #include "config.h"

    +#if HAVE_SYS_TYPES_H
    +#include <sys/types.h>
    +#endif
    +
    #ifdef HEIMDAL
    # include <gssapi.h>
    #else
    Index: src/mod_auth_kerb.c
    ===================================================================
    RCS file: /cvsroot/modauthkerb/mod_auth_kerb/src/Attic/mod_auth_kerb.c,v
    retrieving revision 1.134
    diff -u -r1.134 mod_auth_kerb.c
    --- src/mod_auth_kerb.c 22 Nov 2006 11:11:16 -0000 1.134
    +++ src/mod_auth_kerb.c 22 Jan 2008 19:24:51 -0000
    @@ -113,8 +113,7 @@
    #include <netdb.h> /* gethostbyname() */
    #endif /* KRB4 */

    -#ifndef _WIN32
    -/* should be HAVE_UNISTD_H instead */
    +#if HAVE_UNISTD_H
    #include <unistd.h>
    #endif

     
  • Matej Pristak

    Matej Pristak - 2008-10-14

    patch accepted, see

    config.h.in rev. 1.7
    spnegokrb5_locl.h rev. 1.5
    mod_auth_kerb.c rev. 1.145

    thanks ^^

     
  • Matej Pristak

    Matej Pristak - 2008-10-14
    • status: open --> closed-accepted
     

Log in to post a comment.

MongoDB Logo MongoDB