Skip Menu |
 

Subject: Build issues --with-kdc-kdb-update HPUX 11.23 and Linux x86_64
CC: mike.coyne@paccar.com
Download (untitled) / with headers
text/plain 6.3KiB
please note this may be a repost as i have been bounced from the mail
server when using the krb5-send-pr



Show quoted text
>Submitter-Id: net
>Originator: mike coyne
>Organization:

Show quoted text
>Confidential: no
>Synopsis: Build issues --with-kdc-kdb-update HPUX 11.23
>Severity: serious
>Priority: medium
>Category: krb5-build
>Class: sw-bug
>Release: 1.6.2
>Environment:

System: HP-UX pbccfd01 B.11.23 U ia64 0508688805 unlimited-user license


Show quoted text
>Description:
The default system dose not compile with kdc-kdb-update option
the 1.4.4 version of the kdc we have in production should be updated
due to recent problems with kadmin. We use
the kdc-kdb-update feature to track last usage based on authication.
The feature is missing or has old referances
to krb5_db_init and krb5_db_set_name . I am trying a patch based on a
posting in the kerberos mailing list. It
was pointed out the lack of locking in the update function was non
ideal, although not worse than the 1.4.x version
we are using currently . One thing not covered in the posting was the
issue of what to do with the dbargs argument to the
int the krb5_db_open call. I set the value to NULL based on some other
calls to the function . But i could not
locact the documentaion for the api.. So this is a guess/hack.

Also there are issues with the hpux version compiling the db2 module .
To creat the module you have to change to
the src/plugins/kdb/db2 directory and create the plugin by a "make
db2.sl" although the library is actualy a db2.so
for the hpux64 version , Also to make a usable plugin the Makefile in
that directory was modified to add -lnsl and -lc
to fix unresolved referances so the db2 module would load. I created a
hard link in the modules directory bewteen db2.sl db2.so and db2
just to cover the bases on the dlopen.

SHLIB_EXPLIBS= $(GSSRPC_LIBS) -lkrb5 -lcom_err -lk5crypto
$(KDB5_DB_LIB) $(SUPPORT_LIB) $(LIBS) -lnsl -lc

There was a series of problems in the src/plugins/kdb/db2/libdb2
directory revolving arround
....
making all in plugins/kdb/db2/libdb2/hash...
gmake[3]: Entering directory
`/home/mcoyne/krb5/humm/krb5-1.6.2_ab/src/plugins/kdb/db2/libdb2/hash'
cc -Ae +DD64 +z -DSHARED -DHAVE_CONFIG_H -I../../../../../include
-I./../../../../../include -I. -I./../include -I../include -I./../mpool
-I./../db -DKRB5_DEPRECATED=1 -DKRB5_PRIVATE=1 -g -D_REENTRANT
-D_THREAD_SAFE -D_POSIX_C_SOURCE=199506L -c hash_log2.c -o
hash_log2.so.o && mv -f hash_log2.so.o hash_log2.so
"/usr/include/sys/_inttypes.h", line 111: error #2084: invalid
combination of
type specifiers
typedef int int32_t; /* 32-bit signed integer */
^
... putting <sys/types.h> ahead of or in db-int.h header ,
fixed this, note other files needed the fix as well in this
directory...

Show quoted text
>How-To-Repeat:

./configure --with-kdc-kdb-update --prefix=/opt/krb5-1.6.2p/hpux64
CC="cc -Ae +DD64"
Show quoted text
>Fix:


"diff of pulugins libdb2/include "
diff -c include/db-int.h
/home/mcoyne/krb5/krb5-1.6.2_ab/src/plugins/kdb/db2/libdb2/include/db-int.h
*** include/db-int.h Sun May 23 12:20:09 2004
---
/home/mcoyne/krb5/krb5-1.6.2_ab/src/plugins/kdb/db2/libdb2/include/db-int.h
Fri Sep 7 13:20:44 2007
***************
*** 35,41 ****

#ifndef _DB_INT_H_
#define _DB_INT_H_
!
#include "config.h"
#include "db.h"

--- 35,41 ----

#ifndef _DB_INT_H_
#define _DB_INT_H_
! #include <sys/types.h>
#include "config.h"
#include "db.h"





Suggested patch based on posting to correct --kdb-kdc-update .

*** krb5-1.6.2_ab/src/kdc/do_as_req.c 2007-09-06 13:01:10.000000000 -0500
--- krb5-1.6.2/src/kdc/do_as_req.c 2006-11-14 16:47:21.000000000 -0600
***************
*** 475,521 ****
if (sname)
free(sname);
if (c_nprincs) {
- /*
#ifdef KRBCONF_KDC_MODIFIES_KDB
if (update_client) {
krb5_db_put_principal(kdc_context, &client, &c_nprincs);
- */
/*
* ptooey. We want krb5_db_sync() or something like that.
*/
! /* krb5_db_fini(kdc_context);
if (kdc_active_realm->realm_dbname)
krb5_db_set_name(kdc_active_realm->realm_context,
kdc_active_realm->realm_dbname);
krb5_db_init(kdc_context);
! */ /* Reset master key */
! /* krb5_db_set_mkey(kdc_context,
&kdc_active_realm->realm_mkey);
}
! #endif
! */
! /* KRBCONF_KDC_MODIFIES_KDB */
!
! #ifdef KRBCONF_KDC_MODIFIES_KDB
! if (update_client) {
! krb5_db_put_principal(kdc_context, &client, &c_nprincs);
! /*
! ** ptooey. We want krb5_db_sync() or something like that.
! **/
! krb5_db_fini(kdc_context);
! if (kdc_active_realm->realm_dbname)
! if ((errcode =
krb5_set_default_realm(kdc_active_realm->realm_context,
kdc_active_realm->realm_dbname))) {
! return errcode;
! }
! /* if((errcode =
krb5_db_open(kdc_active_realm->realm_context, kdc_active_realm->db_args,
KRB5_KDB_OPEN_RW | KRB5_KDB_SRV_TYPE_KDC)))
! */
! if((errcode =
krb5_db_open(kdc_active_realm->realm_context, NULL , KRB5_KDB_OPEN_RW |
KRB5_KDB_SRV_TYPE_KDC)))
! return errcode;
! /* Reset master key */
! krb5_db_set_mkey(kdc_context, &kdc_active_realm->realm_mkey);
! }
! #endif /* KRBCONF_KDC_MODIFIES_KDB */
!
!
krb5_db_free_principal(kdc_context, &client, c_nprincs);
}
if (s_nprincs)
--- 475,495 ----
if (sname)
free(sname);
if (c_nprincs) {
#ifdef KRBCONF_KDC_MODIFIES_KDB
if (update_client) {
krb5_db_put_principal(kdc_context, &client, &c_nprincs);
/*
* ptooey. We want krb5_db_sync() or something like that.
*/
! krb5_db_fini(kdc_context);
if (kdc_active_realm->realm_dbname)
krb5_db_set_name(kdc_active_realm->realm_context,
kdc_active_realm->realm_dbname);
krb5_db_init(kdc_context);
! /* Reset master key */
! krb5_db_set_mkey(kdc_context, &kdc_active_realm->realm_mkey);
}
! #endif /* KRBCONF_KDC_MODIFIES_KDB */
krb5_db_free_principal(kdc_context, &client, c_nprincs);
}
if (s_nprincs)
Download (untitled) / with headers
text/plain 1.1KiB
In cleaning things up this morning I thought i would try to the forced
db re-open in a test to see if krb5_db_put_principal wrote what it was
susposed to write? Should save quite a bit of overhead unless
krb5_db_put_principal lies.. just a thought


... exerpt from src/kdc/do_as_req.c

if (c_nprincs) {

#ifdef KRBCONF_KDC_MODIFIES_KDB
if (update_client) {
int test_c_nprincs = c_nprincs ;
krb5_db_put_principal(kdc_context, &client, &c_nprincs);
if ( test_c_nprincs != c_nprincs )
{

/*
** ptooey. We want krb5_db_sync() or something like that.
**/
krb5_db_fini(kdc_context);
if (kdc_active_realm->realm_dbname)
if ((errcode =
krb5_set_default_realm(kdc_active_realm->realm_context,
kdc_active_realm->realm_dbname))) {
return errcode;
}
if((errcode = krb5_db_open(kdc_active_realm->realm_context, NULL ,
KRB5_KDB_OPEN_RW | KRB5_KDB_SRV_TYPE_KDC)))
return errcode;
/* Reset master key */
krb5_db_set_mkey(kdc_context, &kdc_active_realm->realm_mkey);
}
}
#endif /* KRBCONF_KDC_MODIFIES_KDB */
krb5_db_free_principal(kdc_context, &client, c_nprincs);
}
RT-Send-CC: john.allan@paccar.com,maqsood.ahmed@paccar.com
Download (untitled) / with headers
text/plain 1.5KiB
Attached a diff of what i did to get a working kdc under HPUX 11.23
compiled as a 32bit application . When i compiled and ran the kdc as a
64bit application on hpux11.23 i got series of errors from kdc/network.c
(see below) it appears there may be some 32/64 bit low level network
issue. Our site does not use ipv6 currently , it appeard to be coming
from a error return in inet_ntop compiled as a 64 bit applications
under both the hpux64(ia64 ) and pa20_64(hppa2.0w)from hpux11.11. i also
had to do some (extern) int type manuipulations in spnego.c to get it to
compile which were not needed in the 64bit version of hpux or linux for
that matter.

Sep 12 10:14:01 pbccfd01 krb5kdc[8016](info): setting up network...
Sep 12 10:14:01 pbccfd01 krb5kdc[8016](info): listening on fd 8: udp
160.69.126.50.750
Sep 12 10:14:01 pbccfd01 krb5kdc[8016](info): listening on fd 9: udp
160.69.126.50.88
Sep 12 10:14:01 pbccfd01 krb5kdc[8016](info): set up 2 sockets
Sep 12 10:14:01 pbccfd01 krb5kdc[8017](info): commencing operation
Sep 12 10:15:02 pbccfd01 krb5kdc[8017](info): AS_REQ (7 etypes {18 17 16
23 1 3 2}) <unknown>: ISSUE: authtime
1189610102, etypes {rep=16 tkt=16 ses=16}, mcoyne@PBDENTON.PACCAR.COM
for krbtgt/PBDENTON.PACCAR.COM@PBDENTON.P
ACCAR.COM
krb5kdc: Address family not supported by protocol family - while sending
reply to ?/0
Sep 12 10:15:38 pbccfd01 krb5kdc[8017](info): AS_REQ (7 etypes {18 17 16
23 1 3 2}) <unknown>: ISSUE: authtime
1189610138, etypes {rep=16 tkt=16 ses=16}, mcoyne@PBDENTON.PACCAR.COM
for krbtgt/PBDENTON.PACCAR.COM@PBDENTON.P
ACCAR.COM
k
diff -rcb krb5-1.6.2/src/kdc/do_as_req.c krb5-1.6.2_ab_32/src/kdc/do_as_req.c
*** krb5-1.6.2/src/kdc/do_as_req.c Tue Nov 14 16:47:21 2006
--- krb5-1.6.2_ab_32/src/kdc/do_as_req.c Wed Sep 12 11:53:21 2007
***************
*** 428,434 ****
update_client = 1;
#endif /* KRBCONF_KDC_MODIFIES_KDB */

! errout:
if (pa_context)
free_padata_context(kdc_context, &pa_context);

--- 428,434 ----
update_client = 1;
#endif /* KRBCONF_KDC_MODIFIES_KDB */

! errout:
if (pa_context)
free_padata_context(kdc_context, &pa_context);

***************
*** 475,493 ****
if (sname)
free(sname);
if (c_nprincs) {
#ifdef KRBCONF_KDC_MODIFIES_KDB
if (update_client) {
krb5_db_put_principal(kdc_context, &client, &c_nprincs);
/*
! * ptooey. We want krb5_db_sync() or something like that.
! */
krb5_db_fini(kdc_context);
if (kdc_active_realm->realm_dbname)
! krb5_db_set_name(kdc_active_realm->realm_context,
! kdc_active_realm->realm_dbname);
! krb5_db_init(kdc_context);
/* Reset master key */
krb5_db_set_mkey(kdc_context, &kdc_active_realm->realm_mkey);
}
#endif /* KRBCONF_KDC_MODIFIES_KDB */
krb5_db_free_principal(kdc_context, &client, c_nprincs);
--- 475,501 ----
if (sname)
free(sname);
if (c_nprincs) {
+
#ifdef KRBCONF_KDC_MODIFIES_KDB
if (update_client) {
+ int test_c_nprincs = c_nprincs ;
krb5_db_put_principal(kdc_context, &client, &c_nprincs);
+ if ( test_c_nprincs != c_nprincs )
+ {
+
/*
! ** ptooey. We want krb5_db_sync() or something like that.
! **/
krb5_db_fini(kdc_context);
if (kdc_active_realm->realm_dbname)
! if ((errcode = krb5_set_default_realm(kdc_active_realm->realm_context, kdc_active_realm->realm_dbname))) {
! return errcode;
! }
! if((errcode = krb5_db_open(kdc_active_realm->realm_context, NULL , KRB5_KDB_OPEN_RW | KRB5_KDB_SRV_TYPE_KDC)))
! return errcode;
/* Reset master key */
krb5_db_set_mkey(kdc_context, &kdc_active_realm->realm_mkey);
+ }
}
#endif /* KRBCONF_KDC_MODIFIES_KDB */
krb5_db_free_principal(kdc_context, &client, c_nprincs);
diff -rcb krb5-1.6.2/src/lib/gssapi/spnego/spnego_mech.c krb5-1.6.2_ab_32/src/lib/gssapi/spnego/spnego_mech.c
*** krb5-1.6.2/src/lib/gssapi/spnego/spnego_mech.c Thu Jun 29 17:12:19 2006
--- krb5-1.6.2_ab_32/src/lib/gssapi/spnego/spnego_mech.c Wed Sep 12 11:01:20 2007
***************
*** 53,61 ****
typedef const gss_OID_desc *gss_OID_const;

/* der routines defined in libgss */
! extern unsigned int gssint_der_length_size(OM_uint32);
! extern int gssint_get_der_length(unsigned char **, OM_uint32, OM_uint32*);
! extern int gssint_put_der_length(OM_uint32, unsigned char **, OM_uint32);


/* private routines for spnego_mechanism */
--- 53,61 ----
typedef const gss_OID_desc *gss_OID_const;

/* der routines defined in libgss */
! extern unsigned int gssint_der_length_size(unsigned int);
! extern int gssint_get_der_length(unsigned char **, unsigned int, unsigned int*);
! extern int gssint_put_der_length(unsigned int, unsigned char **, unsigned int);


/* private routines for spnego_mechanism */
***************
*** 2638,2644 ****

/* determine size of token */
static int
! g_token_size(gss_OID_const mech, unsigned int body_size)
{
int hdrsize;

--- 2638,2644 ----

/* determine size of token */
static int
! g_token_size(gss_OID_const mech, OM_uint32 body_size)
{
int hdrsize;

diff -rcb krb5-1.6.2/src/plugins/kdb/db2/Makefile.in krb5-1.6.2_ab_32/src/plugins/kdb/db2/Makefile.in
*** krb5-1.6.2/src/plugins/kdb/db2/Makefile.in Fri Oct 6 16:17:56 2006
--- krb5-1.6.2_ab_32/src/plugins/kdb/db2/Makefile.in Wed Sep 12 12:43:21 2007
***************
*** 34,40 ****
$(GSSRPC_DEPLIBS) \
$(TOPLIBD)/libk5crypto$(SHLIBEXT) \
$(TOPLIBD)/libkrb5$(SHLIBEXT)
! SHLIB_EXPLIBS= $(GSSRPC_LIBS) -lkrb5 -lcom_err -lk5crypto $(KDB5_DB_LIB) $(SUPPORT_LIB) $(LIBS)

SHLIB_DIRS=-L$(TOPLIBD)
SHLIB_RDIRS=$(KRB5_LIBDIR)
--- 34,40 ----
$(GSSRPC_DEPLIBS) \
$(TOPLIBD)/libk5crypto$(SHLIBEXT) \
$(TOPLIBD)/libkrb5$(SHLIBEXT)
! SHLIB_EXPLIBS= $(GSSRPC_LIBS) -lkrb5 -lcom_err -lk5crypto $(KDB5_DB_LIB) $(SUPPORT_LIB) $(LIBS) -c

SHLIB_DIRS=-L$(TOPLIBD)
SHLIB_RDIRS=$(KRB5_LIBDIR)
diff -rcb krb5-1.6.2/src/plugins/kdb/db2/libdb2/hash/hash_log2.c krb5-1.6.2_ab_32/src/plugins/kdb/db2/libdb2/hash/hash_log2.c
*** krb5-1.6.2/src/plugins/kdb/db2/libdb2/hash/hash_log2.c Thu Jul 5 06:30:16 2001
--- krb5-1.6.2_ab_32/src/plugins/kdb/db2/libdb2/hash/hash_log2.c Fri Sep 7 13:18:21 2007
***************
*** 38,43 ****
--- 38,45 ----
static char sccsid[] = "@(#)hash_log2.c 8.4 (Berkeley) 11/7/95";
#endif /* LIBC_SCCS and not lint */

+ #include <sys/types.h>
+
#include "db-int.h"
#include "hash.h"
#include "page.h"
diff -rcb krb5-1.6.2/src/plugins/kdb/db2/libdb2/include/db-int.h krb5-1.6.2_ab_32/src/plugins/kdb/db2/libdb2/include/db-int.h
*** krb5-1.6.2/src/plugins/kdb/db2/libdb2/include/db-int.h Sun May 23 12:20:09 2004
--- krb5-1.6.2_ab_32/src/plugins/kdb/db2/libdb2/include/db-int.h Fri Sep 7 13:20:44 2007
***************
*** 35,41 ****

#ifndef _DB_INT_H_
#define _DB_INT_H_
!
#include "config.h"
#include "db.h"

--- 35,41 ----

#ifndef _DB_INT_H_
#define _DB_INT_H_
! #include <sys/types.h>
#include "config.h"
#include "db.h"