Mailing List ecs-isp@2rosenthals.com Archived Message #772

Fra: "Steven Levine" <ecs-isp@2rosenthals.com> Full Headers
Undecoded message
Emne: Re: [eCS-ISP] Bind 9.11.37 issue - ticket #784 - update
Dato: Fri, 28 Jun 2024 00:15:52 -0700
Til: "eCS ISP Mailing List" <ecs-isp@2rosenthals.com>

In <list-10070785@2rosenthals.com>, on 06/28/24
   at 07:26 AM, "Paul Smedley" <ecs-isp@2rosenthals.com> said:

Hi Paul,

>I got around to looking at this this morning.@Steven I'm assuming the
>select call at lib\isc\unix\socket.c  is the one you had in mind to add
>the timeout to?

Yes, that should be the one.  In the isc sources it's

lib\isc\unix\socket.c:4377
cc = select(maxfd, manager->read_fds_copy,
   manager->write_fds_copy, NULL, NULL);

The select is wrapped in a do while loop so the net effect of a timeout
should be to re-issue the select which is what we want.

BTW, I may have mentioned that I finally tracked down the code that causes
the database dump to be corrupted on a slave dns server.  The code path is

dns_master_dump3 ->
  opentmp ->
    isc_file_bopenunique ->
      isc_file_openuniquemode

because we have

lib\dns\masterdump.c:1826
if (format == dns_masterformat_text)
result = isc_file_openunique(tempname, &f);
else
result = isc_file_bopenunique(tempname, &f);

The problem is since we use the unix version of file.c,
isc_file_bopenunique does not set O_BINARY.  This is technically wrong,
but not a problem on linux because O_TEXT and O_BINARY are effectively
nops.

In our case the dump file that should be binary gets spurious NLs inserted
and the resulting binary database file is corrupt.  This slows down the
slave server a bit because it needs to fully rebuild its internal database
which means it needs to contact the master dns.

I'm sure the corruption would be logged if the logging was configured to
log this kind of error.

Fixing this is a bit messy.  Since we have

lib\isc\unix\file.c:388
isc_result_t
isc_file_bopenuniquemode(char *templet, int mode, FILE **fp) {
return (isc_file_openuniquemode(templet, mode, fp));
}

There's no easy way to pass the O_BINARY flag without creating a helper
function that both isc_file_bopenuniquemode and isc_file_openuniquemode
can call.  The helper function would take an additional argument that
would pass either O_TEXT or O_BINARY.


Steven

--
----------------------------------------------------------------------
"Steven Levine" <steve53@earthlink.net>  Warp/DIY/BlueLion etc.
www.scoug.com www.arcanoae.com www.warpcave.com
----------------------------------------------------------------------


Abboner: Feed, Digest, Index.
Stopp abbonement
E-post til ListMaster