#1332 Abort unit test when open() fails
Closed: Invalid None Opened 11 years ago by jhrozek.

Unfortunately the fail_if macro doesn't return.

494    fd = open("/dev/zero", O_RDONLY);
At conditional (1): "!(fd == -1)" taking the false branch.
CID 12618: Improper use of negative value (NEGATIVE_RETURNS)Variable "fd" tests negative.
495    fail_if(fd == -1, "Cannot open /dev/zero");
496
497    errno = 0;
"fd" is passed to a parameter that cannot be negative. [show details]
498    numread = sss_atomic_read_s(fd, buf, bufsize);

A very similar case is in test_atomicio_read_from_empty_file:

629    fd = open("/dev/null", O_RDONLY);
At conditional (1): "!(fd == -1)" taking the false branch.
CID 12617: Improper use of negative value (NEGATIVE_RETURNS)Variable "fd" tests negative.
630    fail_if(fd == -1, "Cannot open /dev/null");
631
632    errno = 0;
"fd" is passed to a parameter that cannot be negative. [show details]
633    numread = sss_atomic_read_s(fd, buf, 64);

Fields changed

keywords: easyfix => Coverity easyfix

Fields changed

owner: somebody => arielb
status: new => assigned

As stated on the sssd-devel list, closing as wontfix. The proper fix is in the check library, see also https://bugzilla.redhat.com/show_bug.cgi?id=821933

resolution: => wontfix
status: assigned => closed

Metadata Update from @jhrozek:
- Issue assigned to arielb
- Issue set to the milestone: NEEDS_TRIAGE

7 years ago

SSSD is moving from Pagure to Github. This means that new issues and pull requests
will be accepted only in SSSD's github repository.

This issue has been cloned to Github and is available here:
- https://github.com/SSSD/sssd/issues/2374

If you want to receive further updates on the issue, please navigate to the github issue
and click on subscribe button.

Thank you for understanding. We apologize for all inconvenience.

Login to comment on this ticket.

Metadata