CSMOCK(1)
π CSMOCK(1) Β· User Commands Β· csmock π
okay bestie, welcome to CSMOCK(1) β the csmock page, fresh from the User Commands section and ready to spill all the static-analysis tea ββ¨
π NAME π
csmock β run static analysis of the given SRPM using mock. literally thatβs the whole vibe π
π¦ DESCRIPTION π¦
csmock takes your SRPM and sends it through static analyzers using mock. hereβs the usage, copied exactly so nobody loses a single flag π«Ά
usage: csmock [-h] [-r MOCK_PROFILE] [-t TOOLS] [-a] [-l] [--install
INSTALL]
[-o OUTPUT] [-f] [-j JOBS] [--rpm-build-opts RPM_BUILD_OPTS]
[--cswrap-timeout CSWRAP_TIMEOUT] [-U EMBED_CONTEXT]
[--warning-rate-limit WARNING_RATE_LIMIT] [--limit-msg-len
LIMIT_MSG_LEN] [-k] [--skip-init] [--skip-build] [--use-ldpwrap]
[--no-clean | --scrub-on-exit] [--no-scan] [--run-check]
[--no-run-check] [--print-defects] [--no-print-defects]
[--base-srpm BASE_SRPM] [--base-root BASE_MOCK_PROFILE]
[--root-override MOCK_ROOT_OVERRIDE] [--hermetic-build LOCKFILE
REPO_DIRECTORY] [--skip-patches | --diff-patches | -c SHELL_CMD]
[--known-false-positives KNOWN_FALSE_POSITIVES] [--kfp-git-url
KFP_GIT_URL] [--use-login-shell] [--no-use-login-shell]
[--version] [--bandit-scan-build] [--no-bandit-scan-build]
[--bandit-scan-install] [--no-bandit-scan-install]
[--bandit-evt-filter BANDIT_EVT_FILTER] [--bandit-severity-filter
{LOW,MEDIUM,HIGH}] [--cbmc-add-flag CBMC_ADD_FLAG]
[--cbmc-timeout CBMC_TIMEOUT] [--clang-add-flag CLANG_ADD_FLAG]
[--use-host-cppcheck] [--cppcheck-add-flag CPPCHECK_ADD_FLAG]
[--divine-add-flag DIVINE_ADD_FLAG] [--divine-timeout
DIVINE_TIMEOUT] [--strace-add-flag STRACE_ADD_FLAG]
[--valgrind-add-flag VALGRIND_ADD_FLAG] [--valgrind-timeout
VALGRIND_TIMEOUT] [--symbiotic-add-flag SYMBIOTIC_ADD_FLAG]
[--symbiotic-timeout SYMBIOTIC_TIMEOUT] [--gitleaks-bin-url
GITLEAKS_BIN_URL] [--gitleaks-cache-dir GITLEAKS_CACHE_DIR]
[--gitleaks-config GITLEAKS_CONFIG] [--gitleaks-rate-limit
GITLEAKS_RATE_LIMIT] [--gitleaks-limit-msg-len
GITLEAKS_LIMIT_MSG_LEN] [--gitleaks-refresh]
[--infer-analyze-add-flag INFER_ANALYZE_ADD_FLAG]
[--infer-archive-path INFER_ARCHIVE_PATH] [--infer-filter]
[--no-infer-filter] [--infer-biabduction-filter]
[--no-infer-biabduction-filter] [--infer-inferbo-filter]
[--no-infer-inferbo-filter] [--infer-uninit-filter]
[--no-infer-uninit-filter] [--infer-dead-store-severity]
[--no-infer-dead-store-severity] [--infer-timeout INFER_TIMEOUT]
[--pylint-scan-build] [--no-pylint-scan-build]
[--pylint-scan-install] [--no-pylint-scan-install]
[--pylint-evt-filter PYLINT_EVT_FILTER] [--semgrep-metrics
SEMGREP_METRICS] [--semgrep-rules-repo SEMGREP_RULES_REPO]
[--semgrep-verbose] [--semgrep-scan-opts SEMGREP_SCAN_OPTS]
[--shellcheck-scan-build] [--no-shellcheck-scan-build]
[--shellcheck-scan-install] [--no-shellcheck-scan-install]
[--shellcheck-batch SHELLCHECK_BATCH] [--shellcheck-timeout
SHELLCHECK_TIMEOUT] [--snyk-bin-url SNYK_BIN_URL | --snyk-bin
SNYK_BIN] [--snyk-auth SNYK_AUTH] [--snyk-cache-dir
SNYK_CACHE_DIR] [--snyk-refresh] [--snyk-timeout SNYK_TIMEOUT]
[--snyk-code-test-opts SNYK_CODE_TEST_OPTS]
[--unicontrol-bidi-only] [--unicontrol-notests] [-w
GCC_WARNING_LEVEL] [--gcc-analyze] [--gcc-analyzer-bin
GCC_ANALYZER_BIN] [--gcc-analyze-add-flag GCC_ANALYZE_ADD_FLAG]
[--gcc-set-env] [--gcc-sanitize-address | --gcc-sanitize-leak |
--gcc-sanitize-thread | --gcc-sanitize-undefined] [--gcc-add-flag
GCC_ADD_FLAG] [--gcc-add-c-only-flag GCC_ADD_C_ONLY_FLAG]
[--gcc-add-cxx-only-flag GCC_ADD_CXX_ONLY_FLAG] [--gcc-del-flag
GCC_DEL_FLAG] [SRPM]
πΈ positional arguments: πΈ
SRPMβ the source RPM package that the static analyzers are gonna scan, bestie π
π optional arguments: π
-h,--helpβ show this help message and exit, iconic behavior β¨-r MOCK_PROFILE,--root MOCK_PROFILEβ the mock profile to use; defaults to mockβs default π-t TOOLS,--tools TOOLSβ comma-separated list of tools to enable (use--listavailable-toolsto see the list of available tools) π οΈ-a,--all-toolsβ enable all stable csmock plug-ins (use--listavailable-toolsto see the list of available tools) π-l,--list-available-toolsβ list available tools and exit π--install INSTALLβ space-separated list of packages to install into the chroot π¦-o OUTPUT,--output OUTPUTβ name of the tarball or directory to put the results to π-f,--forceβ overwrite the resulting file or directory if it exists already π₯-j JOBS,--jobs JOBSβ maximal number of jobs running in parallel (passed to'make') π--rpm-build-opts RPM_BUILD_OPTSβ shell-quoted options passed torpm-buildπ§°--cswrap-timeout CSWRAP_TIMEOUTβ maximal amount of time taken by analysis of a single module [s] β±οΈ-U EMBED_CONTEXT,--embed-context EMBED_CONTEXTβ embed a number of lines of context from the source file for the key event (defaults to3). π--warning-rate-limit WARNING_RATE_LIMITβ stop processing a warning if the count of its occurrences exceeds the specified limit (defaults to1024). π¦--limit-msg-len LIMIT_MSG_LENβ limit length of diagnostic messages by the specified number of chars (defaults to512). βοΈ-k,--keep-goingβ continue as much as possible after an error π«Ά--skip-initβ do not run'mock --init'before the scan (may lead to unpredictable scan results) π
bestie, --skip-init can make scan results unpredictable β youβve been warned π
--skip-buildβ do not run%buildand%installsections [EXPERIMENTAL] π§ͺ--use-ldpwrapβ useldpwrapinstead ofcsexec-loader[EXPERIMENTAL] π§ͺ--no-cleanβ do not clean chroot when it becomes unused π§Ή--scrub-on-exitβ scrub all caches after the scan π§Ό--no-scanβ do not analyze any package, just check versions of the analyzers π--run-checkβ run the%checksection of specfile (disabled by default) β--no-run-checkβ disables--run-checkβ--print-defectsβ print the resulting list of defects (default if connected to a tty) π¨οΈ--no-print-defectsβ disables--print-defectsπ--base-srpm BASE_SRPMβ perform a differential scan against the specified base package π--base-root BASE_MOCK_PROFILEβ mock profile to use for the base scan (use only with--base-srpm) π§¬--root-override MOCK_ROOT_OVERRIDEβ override the build root directory for mock (disables yum and root cache) ποΈ--hermetic-build LOCKFILE REPO_DIRECTORYβ perform a hermetic (fully offline) build using a pregenerated lockfile and offline RPM repository (seemock --hermetic-build) π΄--skip-patchesβ skip patches not annotated by%{?_rawbuild}(vanilla build) π¦--diff-patchesβ scan with/without patches and diff the lists of defects π¬-c SHELL_CMD,--shell-cmd SHELL_CMDβ use shell command to build the given tarball (instead of SRPM) π--known-false-positives KNOWN_FALSE_POSITIVESβ suppress known false positives loaded from the given file (defaults to"/usr/share/csmock/known-falsepositives.js"if available) π«--kfp-git-url KFP_GIT_URLβ known false positives git URL (optionally taking a revision delimited by#) π--use-login-shellβ use login shell for build (default) π--no-use-login-shellβ disables--use-login-shellπ«--versionβ print the version of csmock and exit π·οΈ--bandit-scan-buildβ make bandit scan files in the build directory (disabled by default) π΅οΈ--no-bandit-scan-buildβ disables--bandit-scan-buildπ--bandit-scan-installβ make bandit scan files in the install directory (enabled by default) π¦--no-bandit-scan-installβ disables--bandit-scan-installπ--bandit-evt-filter BANDIT_EVT_FILTERβ report only Bandit defects whose key event matches the given regex (defaults to'^B[0-9]+') π―--bandit-severity-filter {LOW,MEDIUM,HIGH}β suppress Bandit defects whose severity level is below given level (default'LOW') β οΈ--cbmc-add-flag CBMC_ADD_FLAGβ append the given flag when invoking cbmc (can be used multiple times) π§©--cbmc-timeout CBMC_TIMEOUTβ maximal amount of time taken by analysis of a single process [s] β±οΈ--clang-add-flag CLANG_ADD_FLAGβ append the given flag when invoking clang static analyzer (can be used multiple times) π§©--use-host-cppcheckβ use statically linked cppcheck installed on the host (automatically enables the Cppcheck plug-in) π₯οΈ--cppcheck-add-flag CPPCHECK_ADD_FLAGβ append the given flag when invoking cppcheck (can be used multiple times) π§©--divine-add-flag DIVINE_ADD_FLAGβ append the given flag when invoking divine (can be used multiple times) π§©--divine-timeout DIVINE_TIMEOUTβ maximal amount of time taken by analysis of a single process [s] β±οΈ--strace-add-flag STRACE_ADD_FLAGβ append the given flag when invoking strace (can be used multiple times) π§©--valgrind-add-flag VALGRIND_ADD_FLAGβ append the given flag when invoking valgrind (can be used multiple times) π§©--valgrind-timeout VALGRIND_TIMEOUTβ maximal amount of time taken by analysis of a single process [s] β±οΈ--symbiotic-add-flag SYMBIOTIC_ADD_FLAGβ append the given flag when invoking symbiotic (can be used multiple times) π§©--symbiotic-timeout SYMBIOTIC_TIMEOUTβ maximal amount of time taken by analysis of a single process [s] β±οΈ--gitleaks-bin-url GITLEAKS_BIN_URLβ URL to download gitleaks binary executable (in a.tar.gz) from π--gitleaks-cache-dir GITLEAKS_CACHE_DIRβ directory where downloaded Gitleaks tarballs are cached across runs ποΈ--gitleaks-config GITLEAKS_CONFIGβ local configuration file to be used for gitleaks βοΈ--gitleaks-rate-limit GITLEAKS_RATE_LIMITβ drop warnings if their count exceeds the specified limit π¦--gitleaks-limit-msg-len GITLEAKS_LIMIT_MSG_LENβ trim message if it exceeds max message length βοΈ--gitleaks-refreshβ force download of gitleaks binary executable (in a.tar.gz) from π--infer-analyze-add-flag INFER_ANALYZE_ADD_FLAGβ appends the given flag (except'-o') when invoking'infer analyze'(can be used multiple times)(default flags'--bufferoverrun','--pulse') π§©--infer-archive-path INFER_ARCHIVE_PATHβ use the given archive to install Infer (default is/opt/infer-linux*.tar.xz) π¦--infer-filterβ apply false positive filter (enabled by default) β--no-infer-filterβ disables--infer-filterβ--infer-biabduction-filterβ applies the false-positive bi-abduction filter, and bestie itβs enabled by default β¨--no-infer-biabduction-filterβ disables--infer-biabduction-filter, periodt π--infer-inferbo-filterβ applies the false-positive inferbo filter (enabled by default) π¦--no-infer-inferbo-filterβ disables--infer-inferbo-filter, no cap π--infer-uninit-filterβ applies the false-positive uninit filter (enabled by default) πΈ--no-infer-uninit-filterβ disables--infer-uninit-filterπ--infer-dead-store-severityβ lowers dead store severity (enabled by default) π--no-infer-dead-store-severityβ disables--infer-dead-store-severityβ--infer-timeout INFER_TIMEOUTβ the maximal amount of time taken by Inferβs analysis phase, in seconds [s] (default300) β³--pylint-scan-buildβ makes pylint scan files in the build directory (disabled by default) π--no-pylint-scan-buildβ disables--pylint-scan-buildπ«Ά--pylint-scan-installβ makes pylint scan files in the install directory (enabled by default) β¨--no-pylint-scan-installβ disables--pylint-scan-installπ--pylint-evt-filter PYLINT_EVT_FILTERβ filters out Pylint defects whose key event matches the given regex (defaults to'^W[0-9]+', use'.*'to get all defects detected by Pylint) π―--semgrep-metrics SEMGREP_METRICSβ configures whether usage metrics are sent to the Semgrep server (defaults to off) π--semgrep-rules-repo SEMGREP_RULES_REPOβ the semgrep rules repo, assuming rules are located under the'rules'sub-directory ποΈ--semgrep-verboseβ shows more details about what rules are running, which files failed to parse, etc. π--semgrep-scan-opts SEMGREP_SCAN_OPTSβ a space-separated list of additional options passed to the'semgrep scan'command π§--shellcheck-scan-buildβ makes shellcheck scan files in the build directory (disabled by default) π--no-shellcheck-scan-buildβ disables--shellcheck-scan-buildπ--shellcheck-scan-installβ makes shellcheck scan files in the install directory (enabled by default) π--no-shellcheck-scan-installβ disables--shellcheck-scan-installπ--shellcheck-batch SHELLCHECK_BATCHβ maximum number of scripts scanned by a single shellcheck process (defaults to1) π¦--shellcheck-timeout SHELLCHECK_TIMEOUTβ maximum amount of wall-clock time taken by a single shellcheck process, in seconds [s] (defaults to30) β°--snyk-bin-url SNYK_BIN_URLβ URL to download the snyk binary executable π--snyk-bin SNYK_BINβ path to the local snyk binary executable (skips download) π--snyk-auth SNYK_AUTHβ file containing the snyk authentication token π--snyk-cache-dir SNYK_CACHE_DIRβ directory where downloaded snyk tarballs are cached across runs ποΈ--snyk-refreshβ forces download of the snyk binary executable π--snyk-timeout SNYK_TIMEOUTβ maximum amount of time taken by invocation of Snyk, in seconds [s] β--snyk-code-test-opts SNYK_CODE_TEST_OPTSβ a space-separated list of additional options passed to the'snyk code test'command π§ͺ--unicontrol-bidi-onlyβ looks for bidirectional control characters only βοΈ--unicontrol-notestsβ excludes tests (basicallytest.*as a component of path) π«-w GCC_WARNING_LEVEL,--gcc-warning-level GCC_WARNING_LEVELβ adjusts the GCC warning level.-w0means default flags,-w1appends-Walland-Wextra, and-w2enables some other useful warnings. (automatically enables the GCC plugin) β οΈ--gcc-analyzeβ runsgcc -fanalyzerin a separate process π¬--gcc-analyzer-bin GCC_ANALYZER_BINβ uses a custom build of gcc to perform the scan. Absolute path to the binary must be provided. π--gcc-analyze-add-flag GCC_ANALYZE_ADD_FLAGβ appends the given flag when invokinggcc -fanalyzer(can be used multiple times) β--gcc-set-envβ sets$CCand$CXXtogccandg++, respectively, for the build π οΈ--gcc-sanitize-addressβ enables%checkand compiles with-fsanitize=addressπ§Ό--gcc-sanitize-leakβ enables%checkand compiles with-fsanitize=leakπ§--gcc-sanitize-threadβ enables%checkand compiles with-fsanitize=threadπ§΅--gcc-sanitize-undefinedβ enables%checkand compiles with-fsanitize=undefinedπͺοΈ--gcc-add-flag GCC_ADD_FLAGβ appends the given compiler flag when invoking gcc (can be used multiple times) π§·--gcc-add-c-only-flag GCC_ADD_C_ONLY_FLAGβ appends the given compiler flag when invoking gcc for C (can be used multiple times) π¨--gcc-add-cxx-only-flag GCC_ADD_CXX_ONLY_FLAGβ appends the given compiler flag when invoking gcc for C++ (can be used multiple times) ββ--gcc-del-flag GCC_DEL_FLAGβ drops the given compiler flag when invoking gcc (can be used multiple times) β
π OUTPUT FORMAT π
If itβs not overridden by the --output option, csmock creates an archive NVR.tar.xz in the current directory for an SRPM named NVR.src.rpm (or NVR.tar.* if the --shell-cmd option is used). The archive contains a directory named NVR as the only top-level directory, containing these items, bestie:
scan-results.errβ scan results encoded as plain-text (for source code editors) πscan-results.htmlβ scan results encoded as HTML (suitable for web browsers) πscan-results.jsβ scan results, including scan metadata, encoded using JSON π§Ύscan-results-summary.txtβ total count of defects found by particular checkers π’scan.iniβ scan metadata encoded in the INI format βοΈscan.logβ scan log file (useful for debugging scan failures) πͺ΅debugβ a directory containing additional data (intended for csmock debugging) π
Note that external plug-ins of csmock may create additional files (not covered by this man page) in the directory with results. π
Thatβs the whole page, bestie β source/version csmock csmock-3.8.7-1.el9, dated June 2026. Now go scan something iconic π
β¨
π¦ where this page comes from
- epel 9: csmock-common 3.8.7-1.el9 Β· GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms