[SSSD] [PATCHES] cache_req improvements

Pavel Březina pbrezina at redhat.com
Thu Mar 12 13:10:53 UTC 2015


On 03/12/2015 01:05 PM, Lukas Slebodnik wrote:
> On (12/03/15 12:34), Pavel Březina wrote:
>> On 03/12/2015 12:30 PM, Jakub Hrozek wrote:
>>> On Thu, Mar 12, 2015 at 11:50:21AM +0100, Jakub Hrozek wrote:
>>>> On Thu, Mar 12, 2015 at 11:16:41AM +0100, Jakub Hrozek wrote:
>>>>> I'm also waiting for a Coverity check to finish.
>>>>
>>>> There are some warnings, mostly the same problem copied around:
>>>> Error: COMPILER_WARNING:
>>>> sssd-1.12.90/src/responder/common/responder_cache_req.c:232:8: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]
>>>> #     if (ret == EEXIST) {
>>>> #        ^
>>>> sssd-1.12.90/src/responder/common/responder_cache_req.c:212:13: note: 'ret' was declared here
>>>> #     errno_t ret;
>>>> #             ^
>>>>
>>>> Error: COMPILER_WARNING:
>>>> sssd-1.12.90/src/responder/common/responder_cache_req.c: scope_hint: In function 'cache_req_get_object'
>>>> sssd-1.12.90/src/responder/common/responder_cache_req.c:343:8: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]
>>>> #     if (ret != EOK) {
>>>> #        ^
>>>>
>>>> Error: COMPILER_WARNING:
>>>> sssd-1.12.90/src/responder/common/responder_cache_req.c:348:30: warning: 'one_item_only' may be used uninitialized in this function [-Wmaybe-uninitialized]
>>>> #     } else if (one_item_only && result->count > 1) {
>>>> #                              ^
>>>>
>>>> Error: COMPILER_WARNING:
>>>> sssd-1.12.90/src/responder/common/responder_cache_req.c:26: included_from: Included from here.
>>>> sssd-1.12.90/src/responder/common/responder_cache_req.c: scope_hint: In function 'cache_req_cache_done'
>>>> sssd-1.12.90/src/util/util.h:130:9: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]
>>>> #         debug_fn(__FILE__, __LINE__, __FUNCTION__, \
>>>> #         ^
>>>> sssd-1.12.90/src/responder/common/responder_cache_req.c:243:13: note: 'ret' was declared here
>>>> #     errno_t ret;
>>>> #             ^
>>>>
>>>> I think it's fine to initialize ret to ERR_INTERNAL in that case. We know
>>>> that one of the 'case' statements would hit, so this change could be just
>>>> another precaution.
>>>
>>> btw CI passed: http://sssd-ci.duckdns.org/logs/job/10/53/summary.html
>>
>> Thanks.
>>
>> Since those warning comes from original code that is already present in
>> master, it is fixed in a separate patch (#1).
>>
> I do not agree with separate patch.
> Firstly, it is compiler warning and not coverity
> Secondly, it is caused by 7th patch
>      cache_req: remove default branch from switches
>
>    CC       src/responder/common/responder_cache_req.o
> src/responder/common/responder_cache_req.c: In function ‘cache_req_get_object’:
> src/responder/common/responder_cache_req.c:304:8: error: ‘ret’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
>       if (ret != EOK) {
>          ^
> src/responder/common/responder_cache_req.c:309:30: error: ‘one_item_only’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
>       } else if (one_item_only && result->count > 1) {
>                                ^
> src/responder/common/responder_cache_req.c: In function ‘cache_req_cache_done’:
> src/responder/common/responder_cache_req.c:234:160: error: ‘ret’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
> src/responder/common/responder_cache_req.c:213:13: note: ‘ret’ was declared here
>       errno_t ret;
>               ^
> src/responder/common/responder_cache_req.c: In function ‘cache_req_next_domain’:
> src/responder/common/responder_cache_req.c:262:160: error: ‘ret’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
> src/responder/common/responder_cache_req.c:246:13: note: ‘ret’ was declared here
>       errno_t ret;
>               ^
> src/responder/common/responder_cache_req.c:202:8: error: ‘ret’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
>       if (ret == EEXIST) {
>          ^
> src/responder/common/responder_cache_req.c:185:13: note: ‘ret’ was declared here
>       errno_t ret;
>               ^
> cc1: all warnings being treated as errors
>
> sh$ rpm -q gcc
> gcc-5.0.0-0.17.fc22.x86_64
>
> I did not testen on fedora 21.
>
> LS
> _______________________________________________
> sssd-devel mailing list
> sssd-devel at lists.fedorahosted.org
> https://lists.fedorahosted.org/mailman/listinfo/sssd-devel
>

Ok, new patches attached.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-cache_req-tests-rename-test_user-to-test_user_by_nam.patch
Type: text/x-patch
Size: 8429 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20150312/cc00f86e/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-cache_req-tests-define-user-name-constant.patch
Type: text/x-patch
Size: 4452 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20150312/cc00f86e/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-cache_req-preparations-for-different-input-type.patch
Type: text/x-patch
Size: 24768 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20150312/cc00f86e/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-cache_req-add-support-for-user-by-uid.patch
Type: text/x-patch
Size: 25602 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20150312/cc00f86e/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0005-cache_req-add-support-for-group-by-name.patch
Type: text/x-patch
Size: 20343 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20150312/cc00f86e/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006-cache_req-remove-default-branch-from-switches.patch
Type: text/x-patch
Size: 3242 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20150312/cc00f86e/attachment-0005.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0007-cache_req-add-support-for-group-by-id.patch
Type: text/x-patch
Size: 19920 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20150312/cc00f86e/attachment-0006.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0008-cmocka-include-mock_parse_inp-in-header-file.patch
Type: text/x-patch
Size: 930 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20150312/cc00f86e/attachment-0007.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0009-cache_req-parse-input-name-if-needed.patch
Type: text/x-patch
Size: 20001 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20150312/cc00f86e/attachment-0008.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0010-cache_req-return-ERR_INTERNAL-if-more-than-one-entry.patch
Type: text/x-patch
Size: 1134 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20150312/cc00f86e/attachment-0009.bin>


More information about the sssd-devel mailing list