[SSSD] [PATCH] IFP: touch config when changing debug level temporarily

Pavel Březina pbrezina at redhat.com
Tue Jul 8 08:23:23 UTC 2014


On 07/07/2014 02:14 PM, Pavel Reichl wrote:
> On Wed, 2014-07-02 at 13:10 +0200, Pavel Březina wrote:
>> This fixes a bug found by Jan Šafránek. The debug level was not restored
>> after sssd restart because the time of last modification of sssd.conf
>> was older than config.ldb.
>> _______________________________________________
>> sssd-devel mailing list
>> sssd-devel at lists.fedorahosted.org
>> https://lists.fedorahosted.org/mailman/listinfo/sssd-devel
>
> Hi Pavel,
>
>
>>       ret = change_debug_level_tmp(ctx->rctx->cdb, name, type, arg_new_level);
>> +    if (ret != EOK) {
>> +        goto done;
>> +    }
>> +
>> +    errno = 0;
>
> I just wonder if there is any need to initialize errno as it is set by utime() in case of failure and we directly check return value of utime().
> I'm not sure but I don't think it's a common practice in SSSD codebase to always initialize errno.

You are correct sir. I removed it also from sss_debuglevel tool.

>
> I think it would be better to replace this line with comment like you put in commit message, something like
>
> /* Touch configuration file to make sure debug level is reloaded. */
>

Done.

>> +    if (utime(CONFDB_DEFAULT_CONFIG_FILE, NULL) == -1) {
>> +        ret = errno;
>> +        goto done;
>> +    }
>> +
>> +    ret = EOK;
>
> Thanks,
>
> PR
>
>
> _______________________________________________
> sssd-devel mailing list
> sssd-devel at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/sssd-devel
>

Patches are attached.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-IFP-touch-config-when-changing-debug-level-temporari.patch
Type: text/x-patch
Size: 1377 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20140708/45442866/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-sss_debuglevel-remove-unnecessary-errno.patch
Type: text/x-patch
Size: 903 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20140708/45442866/attachment-0001.bin>


More information about the sssd-devel mailing list