[SSSD] [PATCH] Move settig the SELinux context into a privileged child process

Michal Židek mzidek at redhat.com
Thu Nov 6 15:40:59 UTC 2014


On 11/06/2014 12:09 PM, Lukas Slebodnik wrote:
>> +    DEBUG(SSSDBG_TRACE_FUNC, "performing selinux operations\n");
>> +
>> +    ret = set_seuser(ibuf->username, ibuf->seuser, ibuf->mls_range);
>> +
>> +    ret = prepare_response(main_ctx, ret, &resp);
>        ^^^
> return value is not tested. It might happen that resp will not be used
> initialized in sss_atomic_write_s.
>> +
>> +    errno = 0;
>> +
>> +    written = sss_atomic_write_s(STDOUT_FILENO, resp->buf, resp->size);
>> +    if (written == -1) {
>> +        ret = errno;
>> +        DEBUG(SSSDBG_CRIT_FAILURE, "write failed [%d][%s].\n", ret,
>> +                    strerror(ret));
>> +        goto fail;
>> +    }
>
> html report from clang is attached.
>
> LS
>

Thanks, please see the attached simple patch.

Michal
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-selinux_child-Do-not-ignore-return-values.patch
Type: text/x-patch
Size: 1024 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20141106/d1eeef51/attachment.bin>


More information about the sssd-devel mailing list