Fixed findings

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1]
sssd-2.11.0/src/providers/ipa/ipa_selinux.c: scope_hint: In function 'selinux_fork_child'
sssd-2.11.0/src/providers/ipa/ipa_selinux.c:689:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'pipefd_to_child[0]'
sssd-2.11.0/src/util/atomic_io.h:27: included_from: Included from here.
sssd-2.11.0/src/util/util.h:55: included_from: Included from here.
sssd-2.11.0/src/db/sysdb.h:25: included_from: Included from here.
sssd-2.11.0/src/db/sysdb_selinux.h:25: included_from: Included from here.
sssd-2.11.0/src/providers/ipa/ipa_selinux.c:26: included_from: Included from here.
#  687|           DEBUG(SSSDBG_OP_FAILURE, "talloc_asprintf failed.\n");
#  688|           ret = ENOMEM;
#  689|->         return ret;
#  690|       }
#  691|       c++;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def2]
sssd-2.11.0/src/providers/ipa/ipa_selinux.c:689:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'pipefd_to_child[1]'
#  687|           DEBUG(SSSDBG_OP_FAILURE, "talloc_asprintf failed.\n");
#  688|           ret = ENOMEM;
#  689|->         return ret;
#  690|       }
#  691|       c++;

Error: CPPCHECK_WARNING (CWE-457): [#def3]
sssd-2.11.0/src/providers/ipa/selinux_child.c:202: error[uninitvar]: Uninitialized variable: &chain_id
#  200|           {"debug-fd", 0, POPT_ARG_INT, &debug_fd, 0,
#  201|            _("An open file descriptor for the debug logs"), NULL},
#  202|->         {"chain-id", 0, POPT_ARG_LONG, &chain_id,
#  203|            0, _("Tevent chain ID used for logging purposes"), NULL},
#  204|           SSSD_LOGGER_OPTS

Error: COMPILER_WARNING (CWE-252): [#def4]
sssd-2.11.0/src/providers/ipa/selinux_child.c: scope_hint: In function ‘main’
sssd-2.11.0/src/providers/ipa/selinux_child.c:359:9: warning[-Wunused-result]: ignoring return value of ‘setresuid’ declared with attribute ‘warn_unused_result’
#  359 |         setresuid(suid, suid, suid);
#      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
#  357|   
#  358|       if (getresuid(&ruid, &euid, &suid) == 0) {
#  359|->         setresuid(suid, suid, suid);
#  360|       }
#  361|       if (getresgid(&rgid, &egid, &sgid) == 0) {

Error: COMPILER_WARNING (CWE-252): [#def5]
sssd-2.11.0/src/providers/ipa/selinux_child.c:362:9: warning[-Wunused-result]: ignoring return value of ‘setresgid’ declared with attribute ‘warn_unused_result’
#  362 |         setresgid(sgid, sgid, sgid);
#      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~
#  360|       }
#  361|       if (getresgid(&rgid, &egid, &sgid) == 0) {
#  362|->         setresgid(sgid, sgid, sgid);
#  363|       }
#  364|   

Scan Properties

analyzer-version-clippy1.88.0
analyzer-version-cppcheck2.17.1
analyzer-version-gcc15.1.1
analyzer-version-gcc-analyzer15.1.1
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
diffbase-analyzer-version-clippy1.88.0
diffbase-analyzer-version-cppcheck2.17.1
diffbase-analyzer-version-gcc15.1.1
diffbase-analyzer-version-gcc-analyzer15.1.1
diffbase-analyzer-version-shellcheck0.10.0
diffbase-analyzer-version-unicontrol0.0.2
diffbase-enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
diffbase-exit-code0
diffbase-hostip-172-16-1-92.us-west-2.compute.internal
diffbase-known-false-positives/usr/share/csmock/known-false-positives.js
diffbase-known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
diffbase-mock-configfedora-rawhide-x86_64
diffbase-project-namesssd-2.11.0-99.20250708125703207599.pr7262.47.g72135eff7
diffbase-store-results-to/tmp/tmpy8lu1lmw/sssd-2.11.0-99.20250708125703207599.pr7262.47.g72135eff7.tar.xz
diffbase-time-created2025-07-08 13:55:30
diffbase-time-finished2025-07-08 14:20:38
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'shellcheck,unicontrol,gcc,clippy,cppcheck' '-o' '/tmp/tmpy8lu1lmw/sssd-2.11.0-99.20250708125703207599.pr7262.47.g72135eff7.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmpy8lu1lmw/sssd-2.11.0-99.20250708125703207599.pr7262.47.g72135eff7.src.rpm'
diffbase-tool-versioncsmock-3.8.1.20250626.171830.gc374be3-1.el9
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-92.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-namesssd-2.11.0-99.20250708103540739233.master.45.g8daa3e11a
store-results-to/tmp/tmpf_hs1va0/sssd-2.11.0-99.20250708103540739233.master.45.g8daa3e11a.tar.xz
time-created2025-07-08 13:14:50
time-finished2025-07-08 13:54:32
titleFixed findings
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'shellcheck,unicontrol,gcc,clippy,cppcheck' '-o' '/tmp/tmpf_hs1va0/sssd-2.11.0-99.20250708103540739233.master.45.g8daa3e11a.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '/tmp/tmpf_hs1va0/sssd-2.11.0-99.20250708103540739233.master.45.g8daa3e11a.src.rpm'
tool-versioncsmock-3.8.1.20250626.171830.gc374be3-1.el9