Re: [exim-dev] [exim-cvs] cvs commit: exim/exim-src/src/rout…

Top Page
Delete this message
Reply to this message
Author: Tony Finch
Date:  
To: Philip Hazel
CC: exim-dev
Old-Topics: [exim-cvs] cvs commit: exim/exim-doc/doc-txt ChangeLog exim/exim-src/src route.c exim/exim-test/stderr 0022 0085 0094 0275 0278 0279 0283 0303 0361 0362 0381 0386 0398 0402 0403 0404 0408 0414 0465
Subject: Re: [exim-dev] [exim-cvs] cvs commit: exim/exim-src/src/route.c
On Fri, 14 Jul 2006, Philip Hazel wrote:
>
> Rejig debug output in route_finduser() to show more data, including the
> error from getpwnam() if it issues one.


I think you need to set errno to 0 before calling getpwnam, in order to
correctly tell the difference between no result (in which case it
doesn't set errno at all, not even to zero) and error.

>   +  else DEBUG(D_uid)
>   +    {
>   +    if (errno != 0) debug_printf("getpwnam(%s) failed: %s\n", s,
>   +      strerror(errno));
>   +    }
>   +  }
>   +
>   +if (lastpw == NULL)
>   +  {
>   +  DEBUG(D_uid) debug_printf("getpwnam() returned NULL (user not found)\n");
>   +  return FALSE;
>      }


Tony.
--
<fanf@???> <dot@???> http://dotat.at/ ${sg{\N${sg{\
N\}{([^N]*)(.)(.)(.*)}{\$1\$3\$2\$1\$3\n\$2\$3\$4\$3\n\$3\$2\$4}}\
\N}{([^N]*)(.)(.)(.*)}{\$1\$3\$2\$1\$3\n\$2\$3\$4\$3\n\$3\$2\$4}}