lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Fri,  5 Mar 2021 14:15:58 -0300
From:   Davidson Francis <davidsondfgl@...il.com>
To:     Julia Lawall <Julia.Lawall@...ia.fr>,
        Gilles Muller <Gilles.Muller@...ia.fr>,
        Nicolas Palix <nicolas.palix@...g.fr>,
        Michal Marek <michal.lkml@...kovi.net>
Cc:     Davidson Francis <davidsondfgl@...il.com>, cocci@...teme.lip6.fr,
        linux-kernel@...r.kernel.org
Subject: [PATCH] scripts: coccicheck: Fix chain mode in coccicheck

As described in the Coccinelle documentation (Documentation/dev-tools/
coccinelle.rst), chain mode should try patch, report, context, and org
modes until one of them succeed.

It turns out that currently, the 'run_cmd_parmap' function, by failing
to run $SPATCH, rather than returning an error code, kills the execution
of the script by executing the exit command, rather than returning the
error code.

This way, when running coccicheck in chain mode, as in:
    $ make coccicheck MODE=chain

the first .cocci file that does not support one of the virtual rules
stops the execution of the makefile, rather than trying the remaining
rules as specified in the documentation.

Therefore, modify the coccicheck script to return the error code,
rather than terminating the script.

Signed-off-by: Davidson Francis <davidsondfgl@...il.com>
---
 scripts/coccicheck | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/coccicheck b/scripts/coccicheck
index 65fee63aeadb..15711bd43395 100755
--- a/scripts/coccicheck
+++ b/scripts/coccicheck
@@ -153,7 +153,7 @@ run_cmd_parmap() {
 	err=$?
 	if [[ $err -ne 0 ]]; then
 		echo "coccicheck failed"
-		exit $err
+		return $err
 	fi
 }
 
-- 
2.29.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ