tst_security.sh: Fix bug in tst_disable_selinux()
PATCH 1/1 tst_security.sh: Fix bug in tst_disable_selinux()
tst_disable_selinux() used "cat 0 > $f" which attempts to read a file named "0" instead of writing the value 0 to the enforce file. Replace with "echo 0 > $f" to correctly disable SELinux enforcing mode.
Reported by ltp-agent [0]
[0] https://lore.kernel.org/ltp/[email protected]/
--- testcases/lib/tst_security.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
testcases/lib/tst_security.sh +1 -1
@@ -119,7 +119,7 @@ tst_disable_selinux() local f="$(tst_get_enforce)" - [ -f "$f" ] && cat 0 > $f + [ -f "$f" ] && echo 0 > $f } # Get SELinux directory path
Signature · 5 lines
2.54.0 -- Mailing list info: https://lists.linux.it/listinfo/ltp
Hi Avinesh,
Quoted 1 line · Avinesh Kumar
tst_security.sh: Fix bug intst_disable_selinux()
Verdict - Reviewed
---
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
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
[email protected]
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp
Andrea Cervesato via ltp
AppliedMerged, Thanks!
--
Andrea Cervesato
SUSE QE Automation Engineer Linux
[email protected]
Signature · 1 line
Mailing list info: https://lists.linux.it/listinfo/ltp