[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#291609: marked as done (libc6-dev: Missing (not exported) funcions in libresolv.so)



Your message dated Sat, 4 Jun 2011 04:37:52 -0500
with message-id <20110604093752.GA9958@elie>
and subject line Re: libc6: Missing funcions in libresolv
has caused the Debian Bug report #291609,
regarding libc6-dev: Missing (not exported) funcions in libresolv.so
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
291609: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=291609
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Package: libc6
Version: 2.3.2.ds1-20
Severity: normal


I'm using functions defined in arpa/nameser.h, undocumented in libc, but
explained in chapter 12 of O'Reilly's DNS & BIND (ISBN: 0-596-00158-4).
I do think that this lack of documentation is also a bug.

They are included in /usr/lib/libresolv.a from libc6-dev package, but
not in libresolv.so. Below is included a small example program to
demonstrate this.

This is the error:

$ gcc -Wall -pedantic test.c -lresolv -o test
/tmp/cc6jU6ZL.o(.text+0xa4): In function `main':
: undefined reference to `__ns_initparse'
/tmp/cc6jU6ZL.o(.text+0x124): In function `main':
: undefined reference to `__ns_parserr'
/tmp/cc6jU6ZL.o(.text+0x190): In function `main':
: undefined reference to `__ns_name_uncompress'
collect2: ld returned 1 exit status
$

But this works:

$ gcc -Wall -pedantic test.c /usr/lib/libresolv.a -o test
$

I have repeated this behaviour in Woody.

Code (test.c)
====================
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>
#include <netdb.h>

int main(void) {
	char domain[] = "debian.org";
	int rlen;
	u_char ans[PACKETSZ];
	u_char *cp;
	ns_msg handle;
	ns_rr rr;
	int i;

	int prio;
	char mx[MAXDNAME + 1];

	rlen = res_query(domain, C_IN, T_MX, ans, PACKETSZ);
	if(rlen < 0) {
		herror("resolver");
		return 1;
	}
	if (ns_initparse(ans, rlen, &handle) < 0) {
		perror("ns_initparse");
		return(1);
	}
	if(ns_msg_count(handle, ns_s_an) == 0) {
		return(1);
	}
	for(i = 0; i < ns_msg_count(handle, ns_s_an); i++) {
		if(ns_parserr(&handle, ns_s_an, i, &rr) < 0) {
			perror("ns_parserr");
			continue;
		}

		cp = (u_char *)ns_rr_rdata(rr);
		prio = ns_get16(cp);
		if(ns_name_uncompress(ns_msg_base(handle), ns_msg_end(handle),
					cp + 2, mx, sizeof(mx)) < 0) {
			perror("ns_name_uncompress");
			continue;
		}
		printf("prio: %d, mx: %s\n", prio, mx);
	}
	return 0;
}
=========================

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (900, 'testing'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.8-1-686
Locale: LANG=es_AR, LC_CTYPE=es_AR (charmap=ISO-8859-1)

Versions of packages libc6 depends on:
ii  libdb1-compat                 2.1.3-7    The Berkeley database routines [gl

-- no debconf information


--- End Message ---
--- Begin Message ---
Version: 2.9-1

Hi Martin,

Martin Ferrari wrote:

> I'm using functions defined in arpa/nameser.h, undocumented in libc, but
> explained in chapter 12 of O'Reilly's DNS & BIND (ISBN: 0-596-00158-4).
> I do think that this lack of documentation is also a bug.
>
> They are included in /usr/lib/libresolv.a from libc6-dev package, but
> not in libresolv.so. Below is included a small example program to
> demonstrate this.

This seems to have been fixed by cvs/glibc-2_9~113 (Export functions
from <arpa/nameser.h> from libresolv in version GLIBC_2.9,
2008-08-01).  Thanks for reporting it.


--- End Message ---

Reply to: