<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
new patch.<br>thanks again.<br><br><div><div id="SkyDrivePlaceholder"></div>&gt; Date: Thu, 13 Sep 2012 19:21:17 +0200<br>&gt; From: mzidek@redhat.com<br>&gt; To: sssd-devel@lists.fedorahosted.org<br>&gt; Subject: Re: [SSSD] [PATCH] 1371-Missing resolv.conf should be non-fatal<br>&gt; <br>&gt; On 09/13/2012 05:18 AM, Ariel Barria wrote:<br>&gt; &gt;<br>&gt; &gt; hi, new patch :).<br>&gt; &gt;<br>&gt; &gt; Apparently was required also monitor_config_file_fallback().<br>&gt; &gt;<br>&gt; &gt;  &gt; Hi Ariel,<br>&gt; &gt;  &gt;<br>&gt; &gt;  &gt; actually I reread the patch and I think there is a simpler way to fix<br>&gt; &gt;  &gt; the ticket..directly in the monitor_config_file() function, there is<br>&gt; &gt;  &gt; already a stat() call:<br>&gt; &gt;  &gt; 1823 ret = stat(file, &amp;file_stat);<br>&gt; &gt;  &gt; 1824 if (ret &lt; 0) {<br>&gt; &gt;  &gt; 1825 err = errno;<br>&gt; &gt;  &gt; 1826 DEBUG(0, ("Could not stat file [%s]. Error [%d:%s]\n",<br>&gt; &gt;  &gt; 1827 file, err, strerror(err)));<br>&gt; &gt;  &gt; 1828 return err;<br>&gt; &gt;  &gt; 1829 }<br>&gt; &gt;  &gt;<br>&gt; &gt;  &gt;<br>&gt; &gt;  &gt; So I think that simply extending the error handler with special-casing<br>&gt; &gt;  &gt; ENOENT as you had in your patch would work fine:<br>&gt; &gt;  &gt; + if (ret == ENOENT) {<br>&gt; &gt;  &gt; + DEBUG(SSSDBG_MINOR_FAILURE,<br>&gt; &gt;  &gt; + ("file [%s] is missing, but will skip this check.\n",<br>&gt; &gt;  &gt; + RESOLV_CONF_PATH));<br>&gt; &gt;  &gt; + } else {<br>&gt; &gt;  &gt; + DEBUG(SSSDBG_MINOR_FAILURE,("Could not stat file [%s]. Error<br>&gt; &gt; [%d:%s]\n",<br>&gt; &gt;  &gt; + RESOLV_CONF_PATH, ret, strerror(ret)));<br>&gt; &gt;  &gt; + }<br>&gt; &gt;<br>&gt; <br>&gt; Hi Ariel,<br>&gt; <br>&gt; you should always check the return value of the stat function<br>&gt; and not only if the 'verify_exists_file' is false (also please change<br>&gt; the name of this parameter to something like 'ignore_missing', I find<br>&gt; 'verify_exists_file' a bit obfuscated).<br>&gt; <br>&gt; If 'ignore_missing' is set to false and the file is missing, SSSD will<br>&gt; exit with error. If it is true, it will tolerate ENOENT and continue<br>&gt; (but still we need to check the return value and print appropriate<br>&gt; debug message). Also ENOENT is not the only possible error and whatever<br>&gt; ignore_missing is set to, we must not allow SSSD continue if they<br>&gt; occur).<br>&gt; <br>&gt; In other words. If ignore_missing is set to false, we do not tolerate<br>&gt; any errors, if it is true, we tolerate ENOENT.<br>&gt; <br>&gt; Also please add this new parameter to the ifdefed call to the<br>&gt; monitor_config_file (currently on line 2031 in monitor.c).<br>&gt; <br>&gt; Thanks<br>&gt; Michal<br>&gt; _______________________________________________<br>&gt; sssd-devel mailing list<br>&gt; sssd-devel@lists.fedorahosted.org<br>&gt; https://lists.fedorahosted.org/mailman/listinfo/sssd-devel<br></div>                                               </div></body>
</html>