I see absolutely nothing security-related about this, but it is a 
potential bug report, so we should consider it.

At 10:53 AM -0600 1/29/02, Gilles Detillieux wrote:
>  >         status = ::connect(sock, (struct sockaddr *)&server, 
>sizeof(server));
>>  +        if (status < 0 && errno == EAGAIN)
>>  +        {
>>  +            sleep(1);
>>  +            continue;
>>  +        }
>>          if (status < 0 && errno == EINTR && !allow_EINTR)
>>          {
>>              ::close(sock);
>>              open();
>  >             continue;

The problem I have with this is the errno == EAGAIN. While it seems 
to compile OK on Mac OS X and Solaris (which don't mention it in 
their manpages), I'm not so sure how portable that is. And I'm 
hesitant to mess around with portability problems right before a 
release. In contrast, here's the code currently in 3.1.6

         status = ::connect(sock, (struct sockaddr *)&server, sizeof(server));
         //
         // Disable alarm and restore previous policy if any
         //
         alarm(0);
         sigaction(SIGALRM, &old_action, 0);

         if (status == 0 || errno == EALREADY || errno == EISCONN)
           {
             connected = 1;
             return OK;
           }

         //
         // Only loop if timed out. Other errors are fatal.
         //
         if (status < 0 && errno != EINTR)
           break;

         ::close(sock);
         open();
         sleep(wait_time);

In this case, you're saying that Linux is going to set errno to 
EAGAIN != EINTR, so it will break and fail immediately, rather than 
timeout and retry. (Interestingly, it seems like the allow_EINTR has 
disappeared, which could be a problem.)

I'd be glad to revise this *if* someone can confirm that EAGAIN is 
portable and/or in some spec like POSIX.

Otherwise, I worry about releasing 3.1.6 and finding this new 
revision in Connection.cc prevents compilation on some platforms. 
(Remember that this section of the code is the most heavily 
autoconf'ed.)

-- 
--
-Geoff Hutchison
Williams Students Online
http://wso.williams.edu/

_______________________________________________
htdig-general mailing list <[EMAIL PROTECTED]>
To unsubscribe, send a message to <[EMAIL PROTECTED]> with a 
subject of unsubscribe
FAQ: http://htdig.sourceforge.net/FAQ.html

Reply via email to