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