[SSSD] [PATCH] proxy: Do not try to store same alias twice

Michal Židek mzidek at redhat.com
Wed Nov 12 13:53:00 UTC 2014


On 11/11/2014 01:37 PM, Jakub Hrozek wrote:
> On Thu, Nov 06, 2014 at 07:48:20PM +0100, Michal Židek wrote:
>> On 11/06/2014 07:43 PM, Michal Židek wrote:
>>> On 11/05/2014 04:53 PM, Michal Židek wrote:
>>>> I found this bug while working on
>>>> https://fedorahosted.org/sssd/ticket/2461
>>>>
>>>> It turned out that not only case_sensitive = preserving,
>>>> but also case_sensitive = false did not work
>>>> with proxy provider.
>>>>
>>>> But this patch does not solve the issue in the ticket,
>>>> so I did not link them.
>>>
>>> After  some investigation I actually think this was
>>> the main issue that caused the bug mentioned in
>>> the ticket so I added the "Fixes" label to it.
>>>
>>> I also added second patch that preservers the
>>> service name with proxy provider.
>>>
>>> Michal
>>>
>>
>> And now with patches :)
>>
>
> Coverity found a warning in the patches:
> Error: UNUSED_VALUE (CWE-563):
> sssd-1.12.3/src/providers/proxy/proxy_id.c:609: value_overwrite: Value from "sysdb_attrs_add_string(attrs, "nameAlias", lc_gr_name)" is overwritten with value "12".
> sssd-1.12.3/src/providers/proxy/proxy_id.c:614: value_overwrite: Value from "sysdb_attrs_add_string(attrs, "nameAlias", lc_gr_name)" is overwritten with value from "sysdb_attrs_add_string(attrs, "nameAlias", cased_alias)".
> sssd-1.12.3/src/providers/proxy/proxy_id.c:623: value_overwrite: Value from "sysdb_attrs_add_string(attrs, "nameAlias", lc_gr_name)" is overwritten with value from "sysdb_store_group(dom, real_name, grp->gr_gid, attrs, cache_timeout, now)".
> sssd-1.12.3/src/providers/proxy/proxy_id.c:603: returned_value: Value from "sysdb_attrs_add_string(attrs, "nameAlias", lc_gr_name)" is assigned to "ret" here, but that stored value is not used before it is overwritten.
>
> Looks like an unchecked call. Apart from that, the code looks good.

Thank you Jakub and Pavel for the review. New patches are attached.

Michal

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-proxy-Do-not-try-to-store-same-alias-twice.patch
Type: text/x-patch
Size: 5233 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20141112/19ac1426/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-PROXY-Preserve-service-name-in-proxy-provider.patch
Type: text/x-patch
Size: 2027 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20141112/19ac1426/attachment-0001.bin>


More information about the sssd-devel mailing list