This is the mail archive of the
libc-hacker@sourceware.cygnus.com
mailing list for the glibc project.
_res.options used without res_init()
- To: libc-alpha@cygnus.com
- Subject: _res.options used without res_init()
- From: Keith Owens <kaos@ocs.com.au>
- Date: Tue, 22 Dec 1998 00:55:08 +1100
>Submitter-Id: net
>Originator: Keith Owens
>Organization:
>Confidential: no
>Synopsis: _res.options is tested before res_init() has been called
>Severity: non-critical
>Priority: low
>Category: libc
>Class: sw-bug
>Release: libc-2.0.106
>Environment:
<machine, os, target, libraries (multiple lines)>
Host type: i586-pc-linux-gnu
System: Linux ocs4 2.1.131 #1 SMP Thu Dec 3 22:08:53 EST 1998 i586 unknown
Architecture: i586
Addons: crypt linuxthreads
Build CC: egcs
Compiler version: egcs-2.91.60 19981201 (egcs-1.1.1 release)
Kernel headers: 2.1.131
Symbol versioning: yes
Build static: yes
Build shared: yes
Build pic-default: no
Build profile: yes
Build omitfp: no
Build bounded: no
Build static-nss: no
Stdio: libio
>Description:
nss/getXXbyYY.c does # include "digits_dots.c" which contains
the line
af = (_res.options & RES_USE_INET6) ? AF_INET6 : AF_INET;
If the application has not called res_init itself, _res is not
initialised yet. In particular the environment has not been
checked for RES_OPTIONS=inet6 so the above test always yields
AF_INET.
>Fix:
Invoke res_init() from digits_dots.c if not already
initialised. Unless you think that all applications should
call res_init themselves.