smartmontools-7.5-5.fc44

List of Findings

Error: SHELLCHECK_WARNING (CWE-563): [#def1]
/etc/smartmontools/smartd_warning.sh:21:1: warning[SC2034]: prefix appears unused. Verify use (or export if used externally).
#   19|   PACKAGE="smartmontools"
#   20|   VERSION="7.5"
#   21|-> prefix="/usr"
#   22|   sysconfdir="/etc/smartmontools"
#   23|   smartdscriptdir="${sysconfdir}"

Error: SHELLCHECK_WARNING (CWE-563): [#def2]
/usr/bin/update-smart-drivedb:21:1: warning[SC2034]: exec_prefix appears unused. Verify use (or export if used externally).
#   19|   VERSION="7.5"
#   20|   prefix="/usr"
#   21|-> exec_prefix="/usr"
#   22|   sbindir="/usr/bin"
#   23|   datarootdir="${prefix}/share"

Error: SHELLCHECK_WARNING (CWE-563): [#def3]
/usr/bin/update-smart-drivedb:23:1: warning[SC2034]: datarootdir appears unused. Verify use (or export if used externally).
#   21|   exec_prefix="/usr"
#   22|   sbindir="/usr/bin"
#   23|-> datarootdir="${prefix}/share"
#   24|   datadir="/usr/share"
#   25|   localstatedir="/var"

Error: SHELLCHECK_WARNING (CWE-563): [#def4]
/usr/bin/update-smart-drivedb:25:1: warning[SC2034]: localstatedir appears unused. Verify use (or export if used externally).
#   23|   datarootdir="${prefix}/share"
#   24|   datadir="/usr/share"
#   25|-> localstatedir="/var"
#   26|   drivedbinstdir="${datadir}/${PACKAGE}"
#   27|   drivedbdir="${datadir}/${PACKAGE}"

Error: SHELLCHECK_WARNING: [#def5]
/usr/bin/update-smart-drivedb:144:3: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  142|   inpath()
#  143|   {
#  144|->   local d rc save
#  145|     rc=1
#  146|     save=$IFS

Error: SHELLCHECK_WARNING: [#def6]
/usr/bin/update-smart-drivedb:184:3: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  182|   vrun2()
#  183|   {
#  184|->   local f err rc
#  185|     f=$1; shift
#  186|     rc=0

Error: SHELLCHECK_WARNING: [#def7]
/usr/bin/update-smart-drivedb:203:3: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  201|   download()
#  202|   {
#  203|->   local f u rc
#  204|     u=$1; f=$2
#  205|     rc=0

Error: SHELLCHECK_WARNING: [#def8]
/usr/bin/update-smart-drivedb:267:3: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  265|   check_file()
#  266|   {
#  267|->   local firstchar f maxsize minsize size
#  268|     f=$1; firstchar=$2; minsize=$3; maxsize=$4
#  269|   

Error: SHELLCHECK_WARNING: [#def9]
/usr/bin/update-smart-drivedb:498:3: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  496|   gpg_verify()
#  497|   {
#  498|->   local gnupgtmp i out rc
#  499|   
#  500|     # Create temp home dir

Error: SHELLCHECK_WARNING: [#def10]
/usr/bin/update-smart-drivedb:545:3: warning[SC3043]: In POSIX sh, 'local' is undefined.
#  543|   get_db_version()
#  544|   {
#  545|->   local r v x
#  546|     x=`sed -n '/^[ {]*"VERSION: *[^"]*"/{
#  547|          s,^[ {]*"VERSION: \([1-9][./0-9]* [^"]*\)".*$,\1,p

Error: COMPILER_WARNING (CWE-477): [#def11]
smartmontools-7.5/os_linux.cpp: scope_hint: In function ‘int os_linux::setup_3ware_nodes(const char*, const char*)’
smartmontools-7.5/os_linux.cpp:1613:22: warning[-Wdeprecated-declarations]: ‘security_context_t’ is deprecated
# 1613 |   security_context_t orig_context = NULL;
#      |                      ^~~~~~~~~~~~
smartmontools-7.5/os_linux.cpp:67: included_from: Included from here.
/usr/include/selinux/selinux.h:19:15: note: declared here
#   19 | typedef char *security_context_t
#      |               ^~~~~~~~~~~~~~~~~~
# 1611|     int              retval = 0;
# 1612|   #ifdef HAVE_LIBSELINUX
# 1613|->   security_context_t orig_context = NULL;
# 1614|     security_context_t node_context = NULL;
# 1615|     int                selinux_enabled  = is_selinux_enabled();

Error: COMPILER_WARNING (CWE-477): [#def12]
smartmontools-7.5/os_linux.cpp:1614:22: warning[-Wdeprecated-declarations]: ‘security_context_t’ is deprecated
# 1614 |   security_context_t node_context = NULL;
#      |                      ^~~~~~~~~~~~
/usr/include/selinux/selinux.h:19:15: note: declared here
#   19 | typedef char *security_context_t
#      |               ^~~~~~~~~~~~~~~~~~
# 1612|   #ifdef HAVE_LIBSELINUX
# 1613|     security_context_t orig_context = NULL;
# 1614|->   security_context_t node_context = NULL;
# 1615|     int                selinux_enabled  = is_selinux_enabled();
# 1616|     int                selinux_enforced = security_getenforce();

Error: COMPILER_WARNING (CWE-477): [#def13]
smartmontools-7.5/os_linux.cpp:1651:26: warning[-Wdeprecated-declarations]: ‘void matchpathcon_fini()’ is deprecated: Use selabel_close
# 1651 |         matchpathcon_fini();
#      |         ~~~~~~~~~~~~~~~~~^~
/usr/include/selinux/selinux.h:506:13: note: declared here
#  506 | extern void matchpathcon_fini(void)
#      |             ^~~~~~~~~~~~~~~~~
# 1649|         pout("Error retrieving original SELinux fscreate context");
# 1650|         if (selinux_enforced) {
# 1651|->         matchpathcon_fini();
# 1652|           return 6;
# 1653|         }

Error: COMPILER_WARNING (CWE-477): [#def14]
smartmontools-7.5/os_linux.cpp:1663:23: warning[-Wdeprecated-declarations]: ‘int matchpathcon(const char*, mode_t, char**)’ is deprecated: Use selabel_lookup instead
# 1663 |       if (matchpathcon(nodestring, S_IRUSR | S_IWUSR, &node_context) < 0) {
#      |           ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/selinux/selinux.h:523:12: note: declared here
#  523 | extern int matchpathcon(const char *path,
#      |            ^~~~~~~~~~~~
# 1661|       /* Get context of the node and set it as the default */
# 1662|       if (selinux_enabled) {
# 1663|->       if (matchpathcon(nodestring, S_IRUSR | S_IWUSR, &node_context) < 0) {
# 1664|           pout("Could not retrieve context for %s", nodestring);
# 1665|           if (selinux_enforced) {

Error: COMPILER_WARNING (CWE-477): [#def15]
smartmontools-7.5/os_linux.cpp:1740:22: warning[-Wdeprecated-declarations]: ‘void matchpathcon_fini()’ is deprecated: Use selabel_close
# 1740 |     matchpathcon_fini();
#      |     ~~~~~~~~~~~~~~~~~^~
/usr/include/selinux/selinux.h:506:13: note: declared here
#  506 | extern void matchpathcon_fini(void)
#      |             ^~~~~~~~~~~~~~~~~
# 1738|       if(node_context)
# 1739|         freecon(node_context);
# 1740|->     matchpathcon_fini();
# 1741|     }
# 1742|   #endif

Error: COMPILER_WARNING: [#def16]
smartmontools-7.5/scsiprint.cpp: scope_hint: In function ‘int scsiPrintActiveTapeAlerts(scsi_device*, int, bool)’
smartmontools-7.5/scsiprint.cpp:435:12: warning[-Wunused-but-set-variable=]: variable ‘k’ set but not used
#  435 |     int i, k, j, m, err;
#      |            ^
#  433|       unsigned short pagelength;
#  434|       unsigned short parametercode;
#  435|->     int i, k, j, m, err;
#  436|       const char *s;
#  437|       const char *ts;

Error: COMPILER_WARNING (CWE-252): [#def17]
smartmontools-7.5/smartd.cpp: scope_hint: In function ‘void capabilities_drop_now()’
smartmontools-7.5/smartd.cpp:1059:14: warning[-Wunused-result]: ignoring return value of ‘int capng_apply(capng_select_t)’ declared with attribute ‘warn_unused_result’
# 1059 |   capng_apply(CAPNG_SELECT_BOTH);
#      |   ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~
# 1057|         CAP_SETGID, CAP_SETUID, CAP_CHOWN, CAP_FOWNER, CAP_DAC_OVERRIDE, -1);
# 1058|     }
# 1059|->   capng_apply(CAPNG_SELECT_BOTH);
# 1060|   }
# 1061|   

Scan Properties

analyzer-version-clippy1.92.0
analyzer-version-cppcheck2.19.1
analyzer-version-gcc16.0.0
analyzer-version-gcc-analyzer16.0.0
analyzer-version-shellcheck0.11.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-63.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-namesmartmontools-7.5-5.fc44
store-results-to/tmp/tmp41gjcfgz/smartmontools-7.5-5.fc44.tar.xz
time-created2026-01-08 21:51:52
time-finished2026-01-08 21:53:25
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmp41gjcfgz/smartmontools-7.5-5.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmp41gjcfgz/smartmontools-7.5-5.fc44.src.rpm'
tool-versioncsmock-3.8.3.20251215.161544.g62de9a5-1.el9