Re: DNS lookups on a different port for testing?

2020-01-23 Thread Claus Assmann
On Thu, Jan 23, 2020, Stuart Henderson wrote:
> On 2020-01-22, Claus Assmann  wrote:
> > The functional tests for sendmail use ldns-testns as DNS server
> > which provides specific test data and error behaviours.
> > It runs on a port  > 1024 to avoid requiring root access.

> For the libbind port, to avoid the conflict with libc/asr, those two
> symbols are renamed. You need to set cpp flags to make sure you're
> getting the version of resolv.h from /usr/local/include *not* the one in
> /usr/include.

With these flags (CPP/LD):
-I/usr/local/include/bind
-L/usr/local/bind/libbind -lbind
and a little bit more hacking of the code
(only to call res_init() in the "right" place)
this work!

Thank you, now I can continue to use my OpenBSD
machine for testing the DANE code in sm8.

-- 
Address is valid for this mailing list only, please do not reply
to it direcly, but to the list.



Re: DNS lookups on a different port for testing?

2020-01-23 Thread Stuart Henderson
On 2020-01-22, Claus Assmann  wrote:
> The functional tests for sendmail use ldns-testns as DNS server
> which provides specific test data and error behaviours.
> It runs on a port  > 1024 to avoid requiring root access.
> There's code in sendmail to set the IP and port for a NS:
>   _res.nsaddr_list[0].sin_family = AF_INET;
>   _res.nsaddr_list[0].sin_addr = *ns;
>   _res.nsaddr_list[0].sin_port = htons(port);
>   _res.nscount = 1;
> but this does not work (anymore) on OpenBSD -- AFAICT the
> resolver implementation (asr?) has a hardcoded port (53).
> Is there some way to set a different port for testing?  I also tried
> to link sendmail against libbind but then it fails during executtion:
>
> sendmail:/usr/lib/libc.so.95.0: ../sendmail/sendmail : WARNING: 
> symbol(__p_type_syms) size mismatch, relink your program
> sendmail:/usr/lib/libc.so.95.0: ../sendmail/sendmail : WARNING: symbol(_res) 
> size mismatch, relink your program
> fill_fd: before readcf: fd 0 not open: Bad file descriptor
>
> Any (simple?) suggestion to get this working on OpenBSD (just for
> functional testing)?
>

For the libbind port, to avoid the conflict with libc/asr, those two
symbols are renamed. You need to set cpp flags to make sure you're
getting the version of resolv.h from /usr/local/include *not* the one in
/usr/include.




Re: DNS lookups on a different port for testing?

2020-01-22 Thread Ted Unangst
Claus Assmann wrote:
> The functional tests for sendmail use ldns-testns as DNS server
> which provides specific test data and error behaviours.
> It runs on a port  > 1024 to avoid requiring root access.

you can use a combination of pf.conf rdr-to and 127.0.0.2 etc.
i.e., bind to port 5353, have pf rdr 127.0.0.2:53 to 5353.
this requires root to setup, but not afterwards.



DNS lookups on a different port for testing?

2020-01-22 Thread Claus Assmann
The functional tests for sendmail use ldns-testns as DNS server
which provides specific test data and error behaviours.
It runs on a port  > 1024 to avoid requiring root access.
There's code in sendmail to set the IP and port for a NS:
_res.nsaddr_list[0].sin_family = AF_INET;
_res.nsaddr_list[0].sin_addr = *ns;
_res.nsaddr_list[0].sin_port = htons(port);
_res.nscount = 1;
but this does not work (anymore) on OpenBSD -- AFAICT the
resolver implementation (asr?) has a hardcoded port (53).
Is there some way to set a different port for testing?  I also tried
to link sendmail against libbind but then it fails during executtion:

sendmail:/usr/lib/libc.so.95.0: ../sendmail/sendmail : WARNING: 
symbol(__p_type_syms) size mismatch, relink your program
sendmail:/usr/lib/libc.so.95.0: ../sendmail/sendmail : WARNING: symbol(_res) 
size mismatch, relink your program
fill_fd: before readcf: fd 0 not open: Bad file descriptor

Any (simple?) suggestion to get this working on OpenBSD (just for
functional testing)?

-- 
Address is valid for this mailing list only, please do not reply
to it direcly, but to the list.