[SSSD] [PATCH] 1371-Missing resolv.conf should be non-fatal

Michal Židek mzidek at redhat.com
Fri Sep 7 10:41:30 UTC 2012


On 09/07/2012 05:53 AM, Ariel Barria wrote:
> Patch sent for review.
>
> https://fedorahosted.org/sssd/ticket/1371
>
>
> _______________________________________________
> sssd-devel mailing list
> sssd-devel at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/sssd-devel

Hi Ariel,

I have not tested your patch, but I see some problems in it.
Do not set errno variable explicitly to 0. It is not how it is ment
to be used. Also ENOENT is not the only possible error, we
should check for the other errors as well. Also do not clear
the return value of stat.

The check should look something like:

ret = stat( ... );
if (ret != 0) {
     if (errno == ENOENT) {
         /* resolv.conf not found. This is the reason for this patch ...*/;
     } else {
         /* ... but we must check for other errors as well
          (the error msg here can be more general) */
     }
} else {
     /* Here is everything OK */
}

Thanks
Michal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20120907/126c0317/attachment.html>


More information about the sssd-devel mailing list