diff mbox series

[meta-security,scarthgap,25/27] aide: fix pkg_postinst_ontarget shell script

Message ID 615c4f6d8af3d6630ecd5e005e309d990927ee9d.1796019369.git.scott.murray@konsulko.com
State New
Headers show
Series Assorted updates 11/30 | expand

Commit Message

Scott Murray Nov. 30, 2026, 6:43 a.m. UTC
From: "jason.lau" <Haitao.Liu@windriver.com>

- Fix conditional checks for AIDE_SCAN_POSTINIT and AIDE_RESCAN_POSTINIT:
  '[ 0 ]' always evaluates to true since it's a non-empty string.
  Use string comparison '= "1"' instead.
- Fix invalid use of '&&' inside '[ ]' test brackets. Use separate
  test expressions joined by shell '&&'.

Signed-off-by: Haitao Liu <haitao.liu@windriver.com>
(reworked for 0.19.3, fixed indentation)
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
---
 recipes-ids/aide/aide_0.19.3.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/recipes-ids/aide/aide_0.19.3.bb b/recipes-ids/aide/aide_0.19.3.bb
index 1ada720..b99c859 100644
--- a/recipes-ids/aide/aide_0.19.3.bb
+++ b/recipes-ids/aide/aide_0.19.3.bb
@@ -62,10 +62,10 @@  CONF_FILE = "${sysconfdir}/aide.conf"
 FILES:${PN} += "${libdir}/${PN} ${sysconfdir}/aide.conf"
 
 pkg_postinst_ontarget:${PN} () {
-    if [ ${AIDE_SCAN_POSTINIT} ]; then
+    if [ "${AIDE_SCAN_POSTINIT}" = "1" ]; then
         ${bindir}/aide -i
     fi
-    if [ ${AIDE_RESCAN_POSTINIT}  && -e ${libdir}/aide/aide.db.gz ]; then
+    if [ "${AIDE_RESCAN_POSTINIT}" = "1" ] && [ -e ${libdir}/aide/aide.db.gz ]; then
         ${bindir}/aide -C
     fi
 }