Bug 2259 - Checking for external _res fails
Summary: Checking for external _res fails
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Build system (show other bugs)
Version: 6.6p1
Hardware: Other Other
: P5 minor
Assignee: Darren Tucker
URL:
Keywords:
Depends on:
Blocks: V_7_2
  Show dependency treegraph
 
Reported: 2014-07-26 05:24 AEST by sconeu
Modified: 2016-08-02 10:41 AEST (History)
1 user (show)

See Also:


Attachments
updated check for _res (499 bytes, patch)
2015-05-08 14:18 AEST, Darren Tucker
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description sconeu 2014-07-26 05:24:05 AEST
I'm not familiar enough with autoconf to edit the configure.ac file, but...

The location in configure.ac is around line 3902

In the configure script, when it checks to see if _res is an extern, there are two problems:

1.  There is no ac_WHATEVER variable to control it and override it.
2.  Because the extern reference to _res is unused, the linker on some systems may elide it, causing an erroneous definition of HAS__RES_EXTERN

The test should be coded in "configure" as follows:

/* ... confdefs.h */
#include <stdio.h>
#if HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#include <netinet/in.h>
#include <arpa/nameser.h>
#include <resolv.h>
extern struct __res_state _res;

int
main ()
{
struct __res_state *volatile p = &_res;  /* force resolution of _res */ return 0; }
Comment 1 Darren Tucker 2015-05-08 14:18:51 AEST
Created attachment 2618 [details]
updated check for _res

Here's the autoconf implementation of your suggestion.  Could you please confirm it does what you want?  (You'll need to run "autoreconf" after applying the patch to rebuild configure).
Comment 2 Damien Miller 2015-08-12 11:00:50 AEST
Move unfinished bugs from 6.9 (how did I miss these?) to 7.1
Comment 3 Darren Tucker 2015-09-04 13:39:12 AEST
sconeu: could you please confirm whether or not the patch resolves the problem you are seeing?  Thanks.
Comment 4 sconeu 2015-09-09 01:01:55 AEST
That  works, thanks.
Comment 5 Darren Tucker 2015-09-11 13:14:51 AEST
Thanks.  Patch applied and will be in 7.2p1.
Comment 6 Damien Miller 2016-08-02 10:41:40 AEST
Close all resolved bugs after 7.3p1 release