[krbdev.mit.edu #2598] Cannot compile KRB5 on HP-UX 11

Douglas E. Engert deengert at anl.gov
Thu Jul 22 11:51:28 EDT 2004



"Dehner, Benjamin T." wrote:
> 
> Thanks for the replies.  I've implemented Ken's work-around and defined the
> ioctl's out, and it has allowed me to compile the source code.  I'm not at a
> point right now where I can perform a functional test.  Also, we do not have
> any IP6 in our environment that I can test against.  Apparently, others have
> seen similar issues, because there is a reference to BIND9 on
> http://www.isc.org/product/BIND/bind9.html that HP-UX 11.11 is not supported
> due to incompatible ioctls.
> 
> Also, when I started compiling, there is also an issue in
> appl/bsd/compat_recv.c.  It references a header file "sys/select.h", which
> does not exist on HP.  I have 10.20, 11.0, and 11.11 systems, and none of
> them had it.  By removing this file, I (apparently) could work around it.
> Again, I have not performed any functional tests yet.

Yes, ifdef it out instead.  

FYI We have krb5-1.3.2 running on HP UX 10.20, 11.0, 11.11 and 11.23(Itanium)
We use gcc for the compiler. 
Here is a list of all the HP related mods we have:

--- src/appl/bsd/,krlogin.c Fri Feb 27 09:02:15 2004
+++ src/appl/bsd/krlogin.c  Fri Feb 27 09:02:15 2004
@@ -1474,7 +1474,8 @@

     mark = 0;

-    recv(rem, &mark, 1, MSG_OOB);
+    if (recv(rem, &mark, 1, MSG_OOB) != 1)
+       return;

     if (server_message(mark)) {
    for (;;) {
@@ -1577,7 +1578,28 @@
    if (select(rem+1, &readset, &writeset, &excset, 0) > 0 ) {
        if (!do_inband)
        if (FD_ISSET(rem, &excset))
+       {
            oob();
+#if defined(hpux) || defined(__hpux)
+              {
+              /* HPUX 11 appears to have a bug.
+               * After the excset is set, and the oob
+               * reads the byte, select will continue to
+               * return readset=0, and excset=rem
+               * This code says, after the oob,
+               * and there is read data, do the FD_SET
+               * so we will read it.
+               * Select then starts working as expected.
+               * DEE - 2/9/00
+               */
+                  int bytes = 0;
+                  ioctl(rem, FIONREAD, (int *)&bytes);
+                  /*DEE fprintf(stderr,"RB=%d",bytes); */
+                  /*if (bytes) */
+                      FD_SET(rem,&readset);
+              }
+#endif
+       }
        if (FD_ISSET(1,&writeset)) {
        n = write(1, bufp, remaining);
        if (n < 0) {
--- src/appl/bsd/,compat_recv.c Tue Mar  4 19:20:50 2003
+++ src/appl/bsd/compat_recv.c  Fri Feb 27 13:20:31 2004
@@ -464,7 +464,9 @@
 #endif
 #endif

+#ifdef HAVE_SYS_SELECT_H
 #include <sys/select.h>
+#endif
 #include "port-sockets.h"

 int
--- src/lib/rpc/unit-test/,Makefile.in  Fri Feb 27 09:17:08 2004
+++ src/lib/rpc/unit-test/Makefile.in   Fri Feb 27 09:17:08 2004
@@ -13,6 +13,7 @@
 client: client.o rpc_test_clnt.o $(GSSRPC_DEPLIBS) $(KRB5_BASE_DEPLIBS)
    $(CC_LINK) -o client client.o rpc_test_clnt.o \
        $(GSSRPC_LIBS) $(KRB5_BASE_LIBS)
+#on HPUX11 needed to add -lrpcsvc to above
 
 server: server.o rpc_test_svc.o $(GSSRPC_DEPLIBS) $(KRB5_BASE_DEPLIBS)
    $(CC_LINK) -o server server.o rpc_test_svc.o \

--- src/include/,foreachaddr.c  Mon Sep 29 14:07:29 2003
+++ src/include/foreachaddr.c   Fri Feb 27 13:21:59 2004
@@ -259,7 +259,7 @@
     return ret;
 }

-#ifdef SIOCGLIFCONF /* Solaris */
+#if defined(SIOCGLIFCONF) && !defined(__hpux) /* Solaris */
 static int
 get_lifconf (int af, int s, size_t *lenp, /*@out@*/ char *buf)
     /*@modifies *buf,*lenp@*/
@@ -431,7 +431,7 @@
     return 0;
 }

-#elif defined (SIOCGLIFNUM) /* Solaris 8 and later; Sol 7? */
+#elif defined (SIOCGLIFNUM) && !defined(__hpux) /* Solaris 8 and later; Sol 7? */

 static int
 foreach_localaddr (/*@null@*/ void *data,
--- src/include/,fake-addrinfo.h    Mon Dec 15 20:19:09 2003
+++ src/include/fake-addrinfo.h Wed Mar 10 16:10:03 2004
@@ -552,6 +552,9 @@
 /* Hack for HPUX, to get h_errno.  */
 # define _XOPEN_SOURCE_EXTENDED 1
 # include <netdb.h>
+# ifndef h_ERRNO_KT_DEFINED
+extern int h_errno;
+# endif
 # undef _XOPEN_SOURCE_EXTENDED
 #endif



> 
> Thanks,
> Ben
> 
> -----Original Message-----
> From: Douglas E. Engert [mailto:deengert at anl.gov]
> Sent: Tuesday, July 20, 2004 9:56 AM
> To: Ken Raeburn
> Cc: Dehner, Benjamin T.; krb5-prs at MIT.EDU; rt-comment at krbdev.MIT.EDU
> Subject: Re: [krbdev.mit.edu #2598] Cannot compile KRB5 on HP-UX 11
> 
> Ken, Looking at the HP 11.11 header net/ip6.h I see that HP does support the
> SIOCGLIFCONF but it uses a differnet structure then Solaris. Many of the
> comments are the same, indicating they had some common source.
> 
> I don't quite understand the foreachaddr.c and since we do not have any
> HPs with IPV6, the simplist thing was to ifdef them out for now.
> 
> I have copied 3 of the header files from an HP 11.11 which pertain to
> IPv6 into AFS at /afs/anl.gov/usr/ctd/b17783/pub/hp.11.11
> If you can not access these I can send you a copy.
> 
> If you need to test any thing, I can try and compile any changes.
> See below too.
> 
> 
> Ken Raeburn wrote:
> >
> > "Douglas E. Engert" <deengert at anl.gov> writes:
> > > Dehner at mit.edu, "Benjamin T.\" via RT\"" wrote:
> > >> Release: 1.3.4
> > >> Environment: HP ANSI-C compiler
> > >> System: HP-UX 11.i RISC 64-bit
> > >> Description:
> > >>         KRB5 compile fails on foreachaddr.c, does not recognize lifconf
> > >> structure.  It is possible that
> > >>         HP-UX does not support the SIOCGLIFCONF ioctl.
> > >> How-To-Repeat: compile on HP-UX 11.i
> > >> Fix: Either avoid incomopatible ioctl, or get vendor to implement it.
> > >
> > > I have used this with HP-UX and krb5-1.3.2
> > >
> > >
> > >>
> > >>
> > >> --- ,foreachaddr.c      Mon Sep 29 14:07:29 2003
> > >> +++ foreachaddr.c       Fri Feb 27 13:21:59 2004
> > >> @@ -259,7 +259,7 @@
> > >>      return ret;
> > >>  }
> > >>
> > >> -#ifdef SIOCGLIFCONF /* Solaris */
> > >> +#if defined(SIOCGLIFCONF) && !defined(__hpux) /* Solaris */
> > >>  static int
> > >>  get_lifconf (int af, int s, size_t *lenp, /*@out@*/ char *buf)
> > >>      /*@modifies *buf,*lenp@*/
> > >> @@ -431,7 +431,7 @@
> > >>      return 0;
> > >>  }
> > >>
> > >> -#elif defined (SIOCGLIFNUM) /* Solaris 8 and later; Sol 7? */
> > >> +#elif defined (SIOCGLIFNUM) && !defined(__hpux) /* Solaris 8 and
> later; Sol 7? */
> > >>
> > >>  static int
> > >>  foreach_localaddr (/*@null@*/ void *data,
> > >>
> >
> > I'm reluctant to add an OS test, as Doug suggested, when we could make
> > it a feature test.
> >
> > If "struct lifconf" isn't present, presumably a test for that
> > structure will do?
> 
> The structure is called if_laddrconf in net/if6.h
> 
> >
> > Does the definition of or comments near SIOCGLIFCONF in the HP-UX
> > header files indicate what data structure should be used with
> > SIOCGLIFCONF?  Is it similar to the type "struct ifconf", such that
> > perhaps it's intended to be used in the same way as Solaris did
> > things, just with different names?
> >
> 
> Yes.
> 
> > Actually, there's something else I'd ask one of you to check for too:
> > If there's a "struct lifconf" in the header files, but not defined
> > because it's dependent on some _XOPEN_foo macro or something like
> > that, that we could enable?
> >
> 
> No, can't find libconf.
> 
> > Unfortunately, I don't have any HP-UX 11 system available to test
> > things on. :-(
> >
> > Ben, do you have IPv6 running at your site, so you could test to see
> > if a patched version finds local IPv6 addresses or not?  Doug's
> > already told me that he does not.
> >
> > Ken
> 
> --
> 
>  Douglas E. Engert  <DEEngert at anl.gov>
>  Argonne National Laboratory
>  9700 South Cass Avenue
>  Argonne, Illinois  60439
>  (630) 252-5444
> 
> 
> 
> 
> The information contained in this E-mail message and the documents accompanying this message are
> privileged and confidential, and may be protected from disclosure.  Please be aware that any use,
> printing, copying, disclosure or dissemination of this communication may be subject to legal
> restriction or sanction. If you think that you have received this E-mail message in error, please
> reply to the sender.
> 
> For more information about Valmont Industries, Inc., please visit our web site at www.valmont.com

-- 

 Douglas E. Engert  <DEEngert at anl.gov>
 Argonne National Laboratory
 9700 South Cass Avenue
 Argonne, Illinois  60439 
 (630) 252-5444


More information about the krb5-bugs mailing list