Unable to build 1.4.2 on FreeBSD

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Unable to build 1.4.2 on FreeBSD

Vladimir Terziev

        Hi,

        i tryed to build Kerberos 1.4.2 on FreeBSD 4.10, but i failed. The error i got is the following:

[snip]
....
[snip]

making all in lib/gssapi/krb5...
gmake[3]: Entering directory `/var/tmp/krb5-1.4.2/src/lib/gssapi/krb5'
gcc -DPACKAGE_NAME=\"\" -DPACKAGE_TARNAME=\"\" -DPACKAGE_VERSION=\"\"
-DPACKAGE_STRING=\"\" -DPACKAGE_BUGREPORT=\"\" -DHAVE_BT_RSEQ=1
-DKRB5_PRIVATE=1 -DKRB5_DEPRECATED=1 -DKRB5_DNS_LOOKUP_KDC=1
-DKRB5_DNS_LOOKUP=1 -DHAVE_RES_SEARCH=1 -DHAVE_NS_INITPARSE=1
-DHAVE_NS_NAME_UNCOMPRESS=1 -DHAVE_DN_SKIPNAME=1 -DHAVE_PRAGMA_WEAK_REF=1
-DCONSTRUCTOR_ATTR_WORKS=1 -DDESTRUCTOR_ATTR_WORKS=1 -DENABLE_THREADS=1
-DHAVE_PTHREAD=1 -DHAVE_PTHREAD_RWLOCK_INIT_IN_THREAD_LIB=1 -DSTDC_HEADERS=1
-DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1
-DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_UNISTD_H=1
-DHAVE_STDLIB_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_MEMORY_H=1
-DSIZEOF_SHORT=2 -DSIZEOF_INT=4 -DSIZEOF_LONG=4   -I../../../include -I./../../../include -I../../../include/krb5 -I./../../../include/krb5 -I. -I. -I./.. -I../generic -I./../generic  -g -O2 -Wall -Wmissing-prototypes -Wcast-qual  -Wcast-align -Wconversion -Wshadow -pedantic -D_THREAD_SAFE -pthread -c import_name.c
In file included from ../../../include/krb5.h:100,
                 from gssapiP_krb5.h:50,
                 from import_name.c:27:
/usr/include/stdlib.h:111: warning: ANSI C does not support `long long'
/usr/include/stdlib.h:117: warning: ANSI C does not support `long long'
import_name.c: In function `krb5_gss_import_name':
import_name.c:125: `BUFSIZ' undeclared (first use in this function)
import_name.c:125: (Each undeclared identifier is reported only once
import_name.c:125: for each function it appears in.)
import_name.c:125: warning: unused variable `pwbuf'
import_name.c:124: warning: unused variable `pwx'
gmake[3]: *** [import_name.o] Error 1

        As i managed to investigate, BUFSIZ is really undeclared, but why?

        Could someone explain me what could be wrong?

        Thanks in advance!

                Vlady
________________________________________________
Kerberos mailing list           [hidden email]
https://mailman.mit.edu/mailman/listinfo/kerberos
Reply | Threaded
Open this post in threaded view
|

Re: Unable to build 1.4.2 on FreeBSD

Dennis Davis-2
On Thu, 11 Aug 2005, Vladimir Terziev wrote:

> From: Vladimir Terziev <[hidden email]>
> To: [hidden email]
> Date: Thu, 11 Aug 2005 12:31:38 +0300
> Subject: Unable to build 1.4.2 on FreeBSD
>
> Hi,
>
> i tryed to build Kerberos 1.4.2 on FreeBSD 4.10, but i failed. The error i got is the following:

...

> In file included from ../../../include/krb5.h:100,
>                  from gssapiP_krb5.h:50,
>                  from import_name.c:27:
> /usr/include/stdlib.h:111: warning: ANSI C does not support `long long'
> /usr/include/stdlib.h:117: warning: ANSI C does not support `long long'
> import_name.c: In function `krb5_gss_import_name':
> import_name.c:125: `BUFSIZ' undeclared (first use in this function)
> import_name.c:125: (Each undeclared identifier is reported only once
> import_name.c:125: for each function it appears in.)
> import_name.c:125: warning: unused variable `pwbuf'
> import_name.c:124: warning: unused variable `pwx'
> gmake[3]: *** [import_name.o] Error 1
>
> As i managed to investigate, BUFSIZ is really undeclared, but why?
>
> Could someone explain me what could be wrong?

I've just been looking at this on OpenBSD.  I strongly suspect that
it's because stdio.h isn't being included for some reason.  I bodged
things by applying the following patch:


*** ./src/lib/gssapi/krb5/import_name.c.orig Mon Jul 18 23:12:42 2005
--- ./src/lib/gssapi/krb5/import_name.c Thu Aug 11 10:06:34 2005
***************
*** 39,44 ****
--- 39,48 ----
  #include <strings.h>
  #endif
 
+ #ifdef __OpenBSD__
+ #include <stdio.h>
+ #endif /* __OpenBSD__ */
+
  /*
   * errors:
   * GSS_S_BAD_NAMETYPE if the type is bogus


Something similar may work for you on FreeBSD.  Note that this *is*
a bodge, not a fix.
--
Dennis Davis, BUCS, University of Bath, Bath, BA2 7AY, UK
[hidden email]               Phone: +44 1225 386101
________________________________________________
Kerberos mailing list           [hidden email]
https://mailman.mit.edu/mailman/listinfo/kerberos
Reply | Threaded
Open this post in threaded view
|

Re: Unable to build 1.4.2 on FreeBSD

Vladimir Terziev

        This is from import_name.c:

[snip] ... [snip]

#include "gssapiP_krb5.h"

#ifndef NO_PASSWORD
#include <pwd.h>
#ifdef HAVE_GETPWUID_R
#include <stdio.h>
#endif
#endif

[snip] ... [snip]

        It seems the configure script doesn't define HAVE_GETPWUID_R for some reason. Respectively stdio.h is not included.

        Vlady


On Thu, 11 Aug 2005 11:19:44 +0100 (BST)
Dennis Davis <[hidden email]> wrote:

> On Thu, 11 Aug 2005, Vladimir Terziev wrote:
>
> > From: Vladimir Terziev <[hidden email]>
> > To: [hidden email]
> > Date: Thu, 11 Aug 2005 12:31:38 +0300
> > Subject: Unable to build 1.4.2 on FreeBSD
> >
> > Hi,
> >
> > i tryed to build Kerberos 1.4.2 on FreeBSD 4.10, but i failed. The error i got is the following:
>
> ...
>
> > In file included from ../../../include/krb5.h:100,
> >                  from gssapiP_krb5.h:50,
> >                  from import_name.c:27:
> > /usr/include/stdlib.h:111: warning: ANSI C does not support `long long'
> > /usr/include/stdlib.h:117: warning: ANSI C does not support `long long'
> > import_name.c: In function `krb5_gss_import_name':
> > import_name.c:125: `BUFSIZ' undeclared (first use in this function)
> > import_name.c:125: (Each undeclared identifier is reported only once
> > import_name.c:125: for each function it appears in.)
> > import_name.c:125: warning: unused variable `pwbuf'
> > import_name.c:124: warning: unused variable `pwx'
> > gmake[3]: *** [import_name.o] Error 1
> >
> > As i managed to investigate, BUFSIZ is really undeclared, but why?
> >
> > Could someone explain me what could be wrong?
>
> I've just been looking at this on OpenBSD.  I strongly suspect that
> it's because stdio.h isn't being included for some reason.  I bodged
> things by applying the following patch:
>
>
> *** ./src/lib/gssapi/krb5/import_name.c.orig Mon Jul 18 23:12:42 2005
> --- ./src/lib/gssapi/krb5/import_name.c Thu Aug 11 10:06:34 2005
> ***************
> *** 39,44 ****
> --- 39,48 ----
>   #include <strings.h>
>   #endif
>  
> + #ifdef __OpenBSD__
> + #include <stdio.h>
> + #endif /* __OpenBSD__ */
> +
>   /*
>    * errors:
>    * GSS_S_BAD_NAMETYPE if the type is bogus
>
>
> Something similar may work for you on FreeBSD.  Note that this *is*
> a bodge, not a fix.
> --
> Dennis Davis, BUCS, University of Bath, Bath, BA2 7AY, UK
> [hidden email]               Phone: +44 1225 386101
________________________________________________
Kerberos mailing list           [hidden email]
https://mailman.mit.edu/mailman/listinfo/kerberos
Reply | Threaded
Open this post in threaded view
|

Re: Unable to build 1.4.2 on FreeBSD

Dennis Davis
On Thu, 11 Aug 2005, Vladimir Terziev wrote:

> From: Vladimir Terziev <[hidden email]>
> To: Dennis Davis <[hidden email]>
> Cc: [hidden email], [hidden email]
> Date: Thu, 11 Aug 2005 13:29:04 +0300
> Subject: Re: Unable to build 1.4.2 on FreeBSD
>
> This is from import_name.c:
>
> [snip] ... [snip]
>
> #include "gssapiP_krb5.h"
>
> #ifndef NO_PASSWORD
> #include <pwd.h>
> #ifdef HAVE_GETPWUID_R
> #include <stdio.h>
> #endif
> #endif
>
> [snip] ... [snip]
>
> It seems the configure script doesn't define HAVE_GETPWUID_R for
> some reason. Respectively stdio.h is not included.

...

getpwuid_r is the re-entrant version of getpwuid.  You may need
this in threaded applications.  getpwuid_r is available on modern
versions of Solaris, isn't there on OpenBSD and presumably isn't
there on FreeBSD.

However I'm not sure that things are as simple as getpwuid_r being
(quite rightly) undefined.  At first glance the code in krb5-1.4.2
doesn't look much different to the code in krb5-1.4.1.  And I didn't
see this problem with krb5-1.4.1.
--
Dennis Davis, BUCS, University of Bath, Bath, BA2 7AY, UK
[hidden email]               Phone: +44 1225 386101
________________________________________________
Kerberos mailing list           [hidden email]
https://mailman.mit.edu/mailman/listinfo/kerberos
Reply | Threaded
Open this post in threaded view
|

Re: Unable to build 1.4.2 on FreeBSD

Vladimir Terziev

        I found the answer. It's not good for me, but it's an answer :(

        FreeBSD 4.x do not have the re-entrant version of getpwuid (e.g. getpwuid_r). FreeBSD 5.x has it, but not 4.x.

        I managed to workaround it. Including stdio.h explicitly in import_name.c solves the problem.

        Thanks for the help!

                Vlady


On Thu, 11 Aug 2005 12:10:22 +0100 (BST)
Dennis Davis <[hidden email]> wrote:

> On Thu, 11 Aug 2005, Vladimir Terziev wrote:
>
> > From: Vladimir Terziev <[hidden email]>
> > To: Dennis Davis <[hidden email]>
> > Cc: [hidden email], [hidden email]
> > Date: Thu, 11 Aug 2005 13:29:04 +0300
> > Subject: Re: Unable to build 1.4.2 on FreeBSD
> >
> > This is from import_name.c:
> >
> > [snip] ... [snip]
> >
> > #include "gssapiP_krb5.h"
> >
> > #ifndef NO_PASSWORD
> > #include <pwd.h>
> > #ifdef HAVE_GETPWUID_R
> > #include <stdio.h>
> > #endif
> > #endif
> >
> > [snip] ... [snip]
> >
> > It seems the configure script doesn't define HAVE_GETPWUID_R for
> > some reason. Respectively stdio.h is not included.
>
> ...
>
> getpwuid_r is the re-entrant version of getpwuid.  You may need
> this in threaded applications.  getpwuid_r is available on modern
> versions of Solaris, isn't there on OpenBSD and presumably isn't
> there on FreeBSD.
>
> However I'm not sure that things are as simple as getpwuid_r being
> (quite rightly) undefined.  At first glance the code in krb5-1.4.2
> doesn't look much different to the code in krb5-1.4.1.  And I didn't
> see this problem with krb5-1.4.1.
> --
> Dennis Davis, BUCS, University of Bath, Bath, BA2 7AY, UK
> [hidden email]               Phone: +44 1225 386101
> ________________________________________________
> Kerberos mailing list           [hidden email]
> https://mailman.mit.edu/mailman/listinfo/kerberos
________________________________________________
Kerberos mailing list           [hidden email]
https://mailman.mit.edu/mailman/listinfo/kerberos
Reply | Threaded
Open this post in threaded view
|

Re: Unable to build 1.4.2 on FreeBSD

Tom Yu
In reply to this post by Dennis Davis
>>>>> "Dennis" == Dennis Davis <[hidden email]> writes:

Dennis> However I'm not sure that things are as simple as getpwuid_r being
Dennis> (quite rightly) undefined.  At first glance the code in krb5-1.4.2
Dennis> doesn't look much different to the code in krb5-1.4.1.  And I didn't
Dennis> see this problem with krb5-1.4.1.

In krb5-1.4.2, a wrapper was made for getpwuid_r and used
unconditionally, hence the exposure of the BUFSIZ problem.  Prior to
krb5-1.4.2, import_name.c only used BUFSIZ if getpwuid_r was detected
at configure time.  I suppose platforms which provided getpwuid_r but
didn't declare BUFSIZ in the headers which were already included would
have failed compilation in earlier releases as well.  The lack of
BUFSIZ due to not including stdio.h was a problem that didn't come up
in our testing, but it will be fixed in a future release.

---Tom
________________________________________________
Kerberos mailing list           [hidden email]
https://mailman.mit.edu/mailman/listinfo/kerberos