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