[krbdev.mit.edu #2628] Patch to build krb5-1.3.4 under Cygwin

The RT System itself via RT rt-comment at krbdev.mit.edu
Thu Jul 8 17:33:36 EDT 2004


>From krb5-bugs-incoming-bounces at mit.edu  Thu Jul  8 17:33:32 2004
Received: from pch.mit.edu (PCH.MIT.EDU [18.7.21.90]) by krbdev.mit.edu (8.9.3p2) with ESMTP
	id RAA11639; Thu, 8 Jul 2004 17:33:31 -0400 (EDT)
Received: from pch.mit.edu (localhost [127.0.0.1])
	by pch.mit.edu (8.12.8p2/8.12.8) with ESMTP id i68LXVl1008015
	for <krb5-send-pr at krbdev.mit.edu>; Thu, 8 Jul 2004 17:33:31 -0400 (EDT)
Received: from pacific-carrier-annex.mit.edu (PACIFIC-CARRIER-ANNEX.MIT.EDU
	[18.7.21.83])
	by pch.mit.edu (8.12.8p2/8.12.8) with ESMTP id i68KnSl1003970
	for <krb5-bugs-incoming at PCH.mit.edu>;
	Thu, 8 Jul 2004 16:49:28 -0400 (EDT)
Received: from mailwasher-b.lanl.gov (mailwasher.lanl.gov [192.16.0.25])
	i68KnPFp016698
	for <krb5-bugs at mit.edu>; Thu, 8 Jul 2004 16:49:25 -0400 (EDT)
Received: from mailrelay3.lanl.gov (localhost.localdomain [127.0.0.1])
	i68KnOCp007190
	for <krb5-bugs at mit.edu>; Thu, 8 Jul 2004 14:49:24 -0600
Received: from x-mail.lanl.gov (localhost.localdomain [127.0.0.1])
	i68KnO24004514;	Thu, 8 Jul 2004 14:49:24 -0600
Received: from reinhold.lanl.gov (reinhold.lanl.gov [128.165.116.129])
	i68KnOu7032360;	Thu, 8 Jul 2004 14:49:24 -0600
Date: Thu, 8 Jul 2004 14:49:24 -0600
From: David Sigeti <sigeti at lanl.gov>
X-X-Sender: rsigeti at reinhold.lanl.gov
To: krb5-bugs at mit.edu
Message-ID: <Pine.CYG.4.58.0407081446570.1764 at reinhold.lanl.gov>
X-send-pr-version: 3.99
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
X-Scanned-By: MIMEDefang 2.35
X-Mailman-Approved-At: Thu, 08 Jul 2004 17:33:30 -0400
cc: David Sigeti <sigeti at lanl.gov>
Subject: Building krb5-1.3.4 under Cygwin
X-BeenThere: krb5-bugs-incoming at mit.edu
X-Mailman-Version: 2.1
Precedence: list
Reply-To: David Sigeti <sigeti at lanl.gov>
Sender: krb5-bugs-incoming-bounces at mit.edu
Errors-To: krb5-bugs-incoming-bounces at mit.edu


>Submitter-Id:  net
>Originator:    David Sigeti
>Organization:
        Los Alamos National Laboratory
>Confidential:  no
>Synopsis:      Patch to build krb5-1.3.4 under Cygwin
>Severity:      serious
>Priority:      high
>Category:      krb5-build
>Class:         sw-bug
>Release:       krb5-1.3.4
>Environment:
        <machine, os, target, libraries (multiple lines)>
System: CYGWIN_NT-5.0 reinhold 1.5.10(0.116/4/2) 2004-05-25 22:07 i686
unknown unknown Cygwin
machine: Windows 2000

>Description:
        <precise description of the problem (multiple lines)>
krb5-1.3.4 does not build under Cygwin.  Three problems are encountered:

1. configure fails for lack of a resolver library.

2. Compilation fails because of a mismatch between the
   declaration of the function __kdb2_hash_open in file
   krb5-1.3.4/src/util/db2/include/db-int.h and the definition in file
   krb5-1.3.4/src/util/db2/hash/hash.c.  Certain parameters appear
   with type int in the declaration but with type int32_t in the
   definition.  Note that the function appears as __hash_open in
   db-int.h because of some preprocessor nonsense.

3. Linking fails because the file
   krb5-1.3.4/spermits rc/lib/krb5/os/locate_kdc.c contains a function
   (krb5_locate_srv_dns_1) which calls the function
   krb5int_make_srv_query_realm which has not been compiled.
   krb5int_make_srv_query_realm is defined in
   krb5-1.3.4/src/lib/krb5/os/dnssrv.c and is only compiled if the
   preprocessor macro KRB5_DNS_LOOKUP is defined.  No such conditional
   compilation is done on the function in locate_kdc.c that calls
   krb5int_make_srv_query_realm.  Note that the compilation line for
   locate_kdc.c mentions that the function, which is static, is
   defined but never used.

>How-To-Repeat:
        <code/input/activities to reproduce the problem (multiple lines)>
Attempt to configure and build under Cygwin.  Perform the fixes below
in the order given to see the successive problems.
>Fix:
        <how to correct or work around the problem, if known (multiple
lines)>
1. configure with the --with-netlib option.

2. Change either the declaration (in file
   krb5-1.3.4/src/util/db2/include/db-int.h) or the definition (in
   file krb5-1.3.4/src/util/db2/hash/hash.c) of the function
   __kdb2_hash_open to make the parameter types consistent.  (See
   patch below.)

3. Insert preprocessor directives into the file
   krb5-1.3.4/src/lib/krb5/os/locate_kdc.c to make compilation of the
   function krb5_locate_srv_dns_1 conditional on the definition of the
   preprocessor macro KRB5_DNS_LOOKUP.  Also, insert preprocessor
   directives into the file krb5-1.3.4/src/include/k5-int.h to make
   the compilation of the declarations of the functions
   krb5int_make_srv_query_realm and krb5int_free_srv_dns_data
   similarly conditional.  (See patch below.)

A patch file made from the distribution of krb5-1.3.4 (downloaded on 6
July 2004) follows.  Note that the first two diffs implement fix 3
above and the last diff implements fix 2.

diff -Naur original/krb5-1.3.4/src/include/k5-int.h
local/krb5-1.3.4/src/include/k5-int.h
--- original/krb5-1.3.4/src/include/k5-int.h	2004-01-05
15:49:32.000000000 -0700
+++ local/krb5-1.3.4/src/include/k5-int.h	2004-07-07
13:31:07.621701800 -0600
@@ -1655,12 +1655,14 @@
     unsigned short port;
     char *host;
 };
+#ifdef KRB5_DNS_LOOKUP
 krb5_error_code
 krb5int_make_srv_query_realm(const krb5_data *realm,
 			     const char *service,
 			     const char *protocol,
 			     struct srv_dns_entry **answers);
 void krb5int_free_srv_dns_data(struct srv_dns_entry *);
+#endif /* KRB5_DNS_LOOKUP */

 #if defined(macintosh) && defined(__CFM68K__) &&
!defined(__USING_STATIC_LIBS__)
 #pragma import reset
diff -Naur original/krb5-1.3.4/src/lib/krb5/os/locate_kdc.c
local/krb5-1.3.4/src/lib/krb5/os/locate_kdc.c
--- original/krb5-1.3.4/src/lib/krb5/os/locate_kdc.c	2004-01-05
19:30:15.000000000 -0700
+++ local/krb5-1.3.4/src/lib/krb5/os/locate_kdc.c	2004-07-07
13:39:02.103040100 -0600
@@ -502,6 +502,7 @@
 }
 #endif

+#ifdef KRB5_DNS_LOOKUP
 static krb5_error_code
 krb5_locate_srv_dns_1 (const krb5_data *realm,
 		       const char *service,
@@ -561,6 +562,7 @@
     krb5int_free_srv_dns_data(head);
     return code;
 }
+#endif /* KRB5_DNS_LOOKUP */

 /*
  * Wrapper function for the two backends
diff -Naur original/krb5-1.3.4/src/util/db2/hash/hash.c
local/krb5-1.3.4/src/util/db2/hash/hash.c
--- original/krb5-1.3.4/src/util/db2/hash/hash.c	2001-07-09
06:06:36.000000000 -0600
+++ local/krb5-1.3.4/src/util/db2/hash/hash.c	2004-07-07
15:55:59.472323600 -0600
@@ -96,7 +96,7 @@
 extern DB *
 __kdb2_hash_open(file, flags, mode, info, dflags)
 	const char *file;
-	int32_t flags, mode, dflags;
+	int flags, mode, dflags;
 	const HASHINFO *info;	/* Special directives for create */
 {
 	struct stat statbuf;




More information about the krb5-bugs mailing list