Re: tst_security.sh: Use enforce toggle to trigger SELinux measurement

[email protected]
Newsgroups gmane.linux.ltp
Message-ID <[email protected]>
Hi Avinesh,

On Fri, 12 Jun 2026 18:38:04 +0200, Avinesh Kumar wrote:
> tst_security.sh: Use enforce toggle to trigger SELinux measurement

> +	orig_val=$(cat $dir/enforce)
> +	val=$((1 - orig_val))
> +	echo $val > $dir/enforce
> +	echo $orig_val > $dir/enforce

`orig_val` is not declared `local`, unlike `val` and `dir` in the
same function. This leaks `orig_val` into the caller's scope.

Should the declaration on line 145 be:

  local val orig_val

Verdict - Needs revision

---
Note:

The agent can sometimes produce false positives although often its
findings are genuine. If you find issues with the review, please
comment this email or ignore the suggestions.

Regards,
LTP AI Reviewer

-- 
Mailing list info: https://lists.linux.it/listinfo/ltp
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.