Re: squid_kerb_auth build issues with 3.1.0.1 on FreeBSD

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Tue, 11 Nov 2008 02:42:08 +1300

Markus Moeller wrote:
> I will update accordingly
>
> Regarding the FD_SETSIZE issue I can remove unistd.h if I use squids
> getopt implementation and MAXHOSTNAMELEN (instead of sysconf), but I am
> not sure about gethostname. I saw you have also a getfullhostname
> function which also uses config.h and unistd.h but doesn't show this
> conflict.
>
> Thank you
> Markus

The issue is only occuring because system headers are included ahead of
Squid's config.h include (both in the .cc directly, and generated into
autoconf.h).

The whole purpose of the config.h file is to make the code portable. It
pulls in the needed alternate system headers depending on which are
available and the OS. Some trivial and not so trivial function calls are
underlaid with emulators. The getfullhostname() in Squid is one such
emulator. xgetaddrinfo() is another.

It does this based on your own autoconf.h and Squids. After its included
that your code can do whatever it likes.

I'm minded to just make the changes as part of the import. Is this
helper often built without Squid?

Amos

>
> ----- Original Message ----- From: "Amos Jeffries" <squid3_at_treenet.co.nz>
> To: "Markus" <markus_moeller_at_compuserve.com>
> Cc: "Amos Jeffries" <squid3_at_treenet.co.nz>; <squid-dev_at_squid-cache.org>
> Sent: Monday, November 10, 2008 2:48 AM
> Subject: Re: squid_kerb_auth build issues with 3.1.0.1 on FreeBSD
>
>
>>
>> Okay, I've pulled the new bundle over. Just diff'ing it in place at
>> present.
>>
>> It still seems to have the same dist problem. It seems to be that spnego
>> is installed on squid-cache.org where I built the 3.1.0.2 package.
>>
>> All optionally built files (spnegohelp/*) need to be part of EXTRA_DIST.
>>
>>
>> --- squid_kerb_auth.old/Makefile.am 2008-11-03 00:55:39.000000000 +1300
>> +++ squid_kerb_auth.new/Makefile.am 2008-11-10 15:31:35.000000000 +1300
>> @@ -1,13 +1,21 @@
>> EXTRA_DIST = configure README NEWS ChangeLog AUTHORS INSTALL
>> SUBDIRS =
>>
>> -bin_PROGRAMS = squid_kerb_auth squid_kerb_auth_test
>> +bin_PROGRAMS = squid_kerb_auth squid_kerb_auth_test negotiate_kerb_auth
>> negotiate_kerb_auth_test
>> +
>> +SPNEGO_SOURCE= \
>> + spnegohelp/derparse.c \
>> + spnegohelp/spnego.c \
>> + spnegohelp/spnegohelp.c \
>> + spnegohelp/spnegoparse.c
>> +
>> +EXTRA_DIST += $(SPNEGO_SOURCE)
>>
>> if HAVE_SPNEGO
>> squid_kerb_auth_SOURCES = squid_kerb_auth.c base64.c
>> squid_kerb_auth_test_SOURCES = squid_kerb_auth_test.c base64.c
>> else
>> -squid_kerb_auth_SOURCES = squid_kerb_auth.c base64.c
>> spnegohelp/derparse.c spnegohelp/spnego.c spnegohelp/spnegohelp.c sp
>> negohelp/spnegoparse.c
>> +squid_kerb_auth_SOURCES = squid_kerb_auth.c base64.c $(SPNEGO_SOURCE)
>> INCLUDES = -Ispnegohelp
>> squid_kerb_auth_test_SOURCES = squid_kerb_auth_test.c base64.c
>> endif
>>
>>
>> Amos
>>
>>> Amos,
>>>
>>> can you use version 1.0.5 from sourceforge ? It will create a copy of
>>> squid_kerb_auth binary to negotiate_kerb_auth at the end of the make.
>>>
>>> Markus
>>>
>>> ----- Original Message -----
>>> From: "Amos Jeffries" <squid3_at_treenet.co.nz>
>>> Newsgroups: gmane.comp.web.squid.devel
>>> To: "Thomas-Martin Seck" <tmseck-lists_at_netcologne.de>
>>> Cc: <squid-dev_at_squid-cache.org>; "Markus Moeller"
>>> <huaraz_at_moeller.plus.com>
>>> Sent: Sunday, November 09, 2008 1:55 AM
>>> Subject: Re: squid_kerb_auth build issues with 3.1.0.1 on FreeBSD
>>>
>>>
>>>> Thomas-Martin Seck wrote:
>>>>> Squid devs,
>>>>>
>>>>> I had a look at 3.1.0.1 today and started to create a FreeBSD port for
>>>>> the 3.1 series.
>>>>>
>>>>> The environments in which I test the port are clean FreeBSD jails
>>>>> running 6.3-RELEASE and 7.0-RELEASE i386 respectively. The directory
>>>>> prefix passed to configure is set to /usr/scratch, CFLAGS are the
>>>>> FreeBSD default of "-O2 -fno-strict-aliasing") and CONFIG_SHELL is
>>>>> /bin/sh. I included aufs and COSS into the build.
>>>>>
>>>>> I ran into the following issues while build-testing:
>>>>>
>>>>> 1) two (probably harmless) bashisms snuck into configure.in, see this
>>>>> patch:
>>>>>
>>>>
>>>> Thanks. Now Fixed. Will be in next daily snapshot and 3.1.0.2 shortly.
>>>>
>>>>
>>>>> 2) squid_kerb_auth does not build on either FreeBSD 6 or 7 (and
>>>>> probably 8-CURRENT):
>>>>
>>>> The kerb issue is more difficult. (cc'ing the author).
>>>> For an initial build the helper can be omitted.
>>>>
>>>> The configure is going to have to change something to get the squid
>>>> portability file 'config.h' included before every system header.
>>>>
>>>>>
>>>>> Making all in negotiate_auth
>>>>> Making all in squid_kerb_auth
>>>>> make all-recursive
>>>>> if
>>>>> c -DHAVE_CONFIG_H -I. -I. -I. -Ispnegohelp -I/usr/include
>>>>> -I/usr/scratch/include
>>>>> -I../../../include -O2 -fno-strict-aliasing -pipe -Wall -Wextra
>>>>> -Werror
>>>>> -Wcomment -Wpointer-arith -Wcast-align -Wwrite-strings
>>>>> -Wstrict-prototypes
>>>>> -Wmissing-prototypes -Wmissing-declarations
>>>>> -Wdeclaration-after-statement
>>>>> -Wshadow -MT squid_kerb_auth.o -MD -MP -MF
>>>>> ".deps/squid_kerb_auth.Tpo" -c -o squid_kerb_auth.o squid_kerb_auth.c;
>>>>> then mv -f ".deps/squid_kerb_auth.Tpo" ".deps/squid_kerb_auth.Po";
>>>>> else
>>>>> rm -f ".deps/squid_kerb_auth.Tpo"; exit 1; fi
>>>>> In file included from ../../../include/getaddrinfo.h:21,
>>>>> from squid_kerb_auth.c:65:
>>>>> ../../../include/config.h:196:1: "FD_SETSIZE" redefined
>>>>> In file included from /usr/include/sys/types.h:299,
>>>>> from /usr/include/unistd.h:41,
>>>>> from squid_kerb_auth.c:36:
>>>>> /usr/include/sys/select.h:59:1: this is the location of the previous
>>>>> definition
>>>>> squid_kerb_auth.c:121:20: base64.h: No such file or directory
>>>>> squid_kerb_auth.c:123:24: spnegohelp.h: No such file or directory
>>>>> squid_kerb_auth.c: In function `main':
>>>>> squid_kerb_auth.c:424: warning: implicit declaration of function
>>>>> `ska_base64_decode_len'
>>>>> squid_kerb_auth.c:429: warning: implicit declaration of function
>>>>> `ska_base64_decode'
>>>>> squid_kerb_auth.c:433: warning: implicit declaration of function
>>>>> `parseNegTokenInit'
>>>>> squid_kerb_auth.c:512: warning: implicit declaration of function
>>>>> `makeNegTokenTarg'
>>>>> squid_kerb_auth.c:529: warning: implicit declaration of function
>>>>> `ska_base64_encode_len'
>>>>> squid_kerb_auth.c:537: warning: implicit declaration of function
>>>>> `ska_base64_encode'
>>>>> *** Error code 1
>>>>>
>>>>> On FreeBSD 6, helpers/negotiate_auth/squid_kerb_auth/config.h looks
>>>>> like the following, on FreeBSD 7 the only difference is that
>>>>> HAVE_GSSAPI_GSSAPI_KRB5_H is (correctly) defined:
>>>>>
>>>>> /* config.h. Generated from config.h.in by configure. */
>>>>> /* config.h.in. Generated from configure.in by autoheader. */
>>>>>
>>>>> /*
>>>>> *
>>>>> -----------------------------------------------------------------------------
>>>>>
>>>>> *
>>>>> * Author: Markus Moeller (markus_moeller_at_compuserve.com)
>>>>> *
>>>>> * Copyright (C) 2007 Markus Moeller. All rights reserved.
>>>>> *
>>>> <snip>
>>>>>
>>>>>
>>>>> #ifdef HAVE_HEIMDAL_KERBEROS
>>>>> #ifdef HAVE_GSSAPI_GSSAPI_H
>>>>> #include <gssapi/gssapi.h>
>>>>> #elif defined(HAVE_GSSAPI_H)
>>>>> #include <gssapi.h>
>>>>> #endif
>>>>> #define gss_nt_service_name GSS_C_NT_HOSTBASED_SERVICE
>>>>> #else
>>>>> #ifdef HAVE_SEAM_KERBEROS
>>>>> #ifdef HAVE_GSSAPI_GSSAPI_H
>>>>> #include <gssapi/gssapi.h>
>>>>> #elif defined(HAVE_GSSAPI_H)
>>>>> #include <gssapi.h>
>>>>> #endif
>>>>> #ifdef HAVE_GSSAPI_GSSAPI_EXT_H
>>>>> #include <gssapi/gssapi_ext.h>
>>>>> #endif
>>>>> #define gss_nt_service_name GSS_C_NT_HOSTBASED_SERVICE
>>>>> #else /*MIT*/
>>>>> #ifdef HAVE_GSSAPI_GSSAPI_H
>>>>> #include <gssapi/gssapi.h>
>>>>> #elif defined(HAVE_GSSAPI_H)
>>>>> #include <gssapi.h>
>>>>> #endif
>>>>> #ifdef HAVE_GSSAPI_GSSAPI_KRB5_H
>>>>> #include <gssapi/gssapi_krb5.h>
>>>>> #endif
>>>>> #ifdef HAVE_GSSAPI_GSSAPI_GENERIC_H
>>>>> #include <gssapi/gssapi_generic.h>
>>>>> #endif
>>>>> #endif
>>>>> #endif
>>>>>
>>>>
>>>> Amos
>>>> --
>>>> Please be using
>>>> Current Stable Squid 2.7.STABLE5 or 3.0.STABLE10
>>>> Current Beta Squid 3.1.0.1
>>>>
>>>
>>>
>>>
>>
>>
>
>

-- 
Please be using
   Current Stable Squid 2.7.STABLE5 or 3.0.STABLE10
   Current Beta Squid 3.1.0.1
Received on Mon Nov 10 2008 - 13:42:13 MST

This archive was generated by hypermail 2.2.0 : Mon Nov 10 2008 - 12:00:04 MST