Bug 42127 - kadm5 header not C++ safe
Summary: kadm5 header not C++ safe
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Raw Hide
Classification: Retired
Component: krb5
Version: 1.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Nalin Dahyabhai
QA Contact: Brian Brock
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-05-24 12:59 UTC by Enrico Scholz
Modified: 2007-04-18 16:33 UTC (History)
0 users

(edit)
Clone Of:
(edit)
Last Closed: 2001-05-24 12:59:27 UTC


Attachments (Terms of Use)

Description Enrico Scholz 2001-05-24 12:59:23 UTC
Description of Problem:

kadm5 headers can not be used (without dirty hacks) in C++ programs:

How Reproducible:

$ cat test.c
#include <kadm5/admin.h>

int main()
{
  kadm5_init(0,0,0,0,0,0,0);
}


Steps to Reproduce:
1. gcc -I/usr/kerberos/include -L/usr/kerberos/lib -lkadm5srv test.c  # C
test case
2. g++ -I/usr/kerberos/include -L/usr/kerberos/lib -lkadm5srv test.c  # C++
test case
3. 

Actual Results:

1. succeeds
2. 
/tmp/ccoJWP5E.o: In function `main':
/tmp/ccoJWP5E.o(.text+0x18): undefined reference to `kadm5_init(char *,
char *, char *, _kadm5_config_params *, unsigned int, unsigned int, void
**)'
collect2: ld returned 1 exit status


Expected Results:

2. succeeds also

Additional Information:

$ rpm -q krb5-devel gcc
krb5-devel-1.2.2-4
gcc-2.96-85

Bug was reported to the maintainers
(http://diswww.mit.edu:8008/menelaus.mit.edu/krb5-bugs/3213) also.

Comment 1 Nalin Dahyabhai 2001-06-28 13:39:51 UTC
The header file is not actually meant for use outside of the Kerberos source
tree itself.  We install the kadm5 headers to get some way of programmatically
manipulating the Kerberos database, but this practice is not the preferred one,
and we're looking at alternative methods.

I suggest including the header in an extern "C" block, which appears to be
sufficient to compile your sample program with g++ on my test machine.


Note You need to log in before you can comment on or make changes to this bug.