#1862 negative return in files.c
Closed: Fixed None Opened 6 years ago by jhrozek.

In some cases, copy_dir may return negative value which may propagate all the way up and cause the DEBUG messages to print spurious error codes. We should return errno, not -1 here:

701    /* Set the desired mode. Do this explicitly to preserve S_ISGID and
702     * other bits. Do this after chown, because chown is permitted to
703     * reset these bits. */
704    ret = fchmod(dest_dir_fd, mode);

8. Condition "ret == -1", taking true branch

9. var_tested_neg: Variable "ret" is negative.
705    if (ret == -1) {

10. Condition "debug_level & __debug_macro_newlevel", taking false branch

11. Condition "debug_level == 0", taking true branch

12. Condition "__debug_macro_newlevel & (48 /* 0x10 | 0x20 */)", taking false branch
706        DEBUG(SSSDBG_OP_FAILURE,
707              ("Error setting mode of '%s': %s",
708              dest_dir_path, strerror(ret)));

13. Jumping to label "done"
709        goto done;
710    }

Fields changed

coverity: 10027 => 10027,10026,10025

Fields changed

owner: somebody => jhrozek
patch: 0 => 1
status: new => assigned

Fields changed

milestone: NEEDS_TRIAGE => SSSD 1.10.0
rhbz: => 0

Fields changed

milestone: SSSD 1.10.0 => SSSD 1.10 beta

resolution: => fixed
status: assigned => closed

Metadata Update from @jhrozek:
- Issue assigned to jhrozek
- Issue set to the milestone: SSSD 1.10 beta

2 years ago

Login to comment on this ticket.

Metadata