Bug#1037171: aide: fresh aide package install fails to add the requried _aide user to system

2023-06-07 Thread Marc Haber
Control: tags -1 confirmed
Control: found -1 0.18.1-1
thanks

This confirmation also applies to the severity of the issue :-(  that
slipped itself in in March 2023 with 0.18.1-1. dh_installsysusers is not
called by the normal dh sequence in dh compat level 13 which leads to
the user not being created at package installation.

Patch to source package:
diff -Nru aide-0.18.3/debian/aide-common.postinst 
aide-0.18.3/debian/aide-common.postinst
--- aide-0.18.3/debian/aide-common.postinst 2023-04-20 23:50:04.0 
+0200
+++ aide-0.18.3/debian/aide-common.postinst 2023-05-18 10:25:22.0 
+0200
@@ -45,18 +45,6 @@
 # added updating to 0.18-1
 rm -rf /var/tmp/aide.cron.daily /var/tmp/aide.cron.daily.old.*
 
-if dpkg --compare-versions "$2" lt 0.17.5-1; then
-# we're updating from a version earlier than 0.17.5, chown logs
-# and databases
-chown --quiet _aide:adm /var/log/aide /var/log/aide/aide.log 
/var/log/aide/aide.log.* || true
-chmod --quiet 2755 /var/log/aide || true
-chown --quiet _aide:root /var/lib/aide/aide.db /var/lib/aide/aide.db.new 
|| true
-fi
-if dpkg --compare-versions "$2" lt 0.18-3; then
-# we're updating from a version earlier than 0.18-3, chown aideinit logs
-chown --quiet _aide:adm /var/log/aide/aideinit.log 
/var/log/aide/aideinit.errors|| true
-fi
-
 rm -f /var/lib/aide/aide.conf.autogenerated
 if dpkg --compare-versions "$2" le "0.16-1"; then
 # we're updating from a version earlier than 0.16-1, rename DHCP conffiles
@@ -96,6 +84,20 @@
 
 #DEBHELPER#
 
+# this needs to be after debhelper, otherwise the account doesn't
+# yet exist.
+if dpkg --compare-versions "$2" lt 0.17.5-1; then
+# we're updating from a version earlier than 0.17.5, chown logs
+# and databases
+chown --quiet _aide:adm /var/log/aide /var/log/aide/aide.log 
/var/log/aide/aide.log.* || true
+chmod --quiet 2755 /var/log/aide || true
+chown --quiet _aide:root /var/lib/aide/aide.db /var/lib/aide/aide.db.new 
|| true
+fi
+if dpkg --compare-versions "$2" lt 0.18-3; then
+# we're updating from a version earlier than 0.18-3, chown aideinit logs
+chown --quiet _aide:adm /var/log/aide/aideinit.log 
/var/log/aide/aideinit.errors|| true
+fi
+
 exit 0
 
 # vim:sw=4:sts=4:et:
diff -Nru aide-0.18.3/debian/rules aide-0.18.3/debian/rules
--- aide-0.18.3/debian/rules2023-04-20 23:50:04.0 +0200
+++ aide-0.18.3/debian/rules2023-05-18 10:25:22.0 +0200
@@ -33,6 +33,10 @@
 override_dh_auto_configure:
dh_auto_configure -- $(strip ${COMMON_CONFIGURE_ARGS}) $(strip 
${EXTRA_CONFIGURE_ARGS})
 
+# make this execute_after_dh_auto_install after bookworm
 override_dh_auto_install:
dh_auto_install
dh_installsystemd --name=dailyaidecheck
+   # this is needed until dh compat 14
+   dh_installsysusers
+

A run-time fix would be to call
adduser --system --home /var/lib/aide --shell /usr/sbin/nologin _aide
before package installation.

or to drop the following file
#Type   NameID  GECOS   Home 
directoryShell
u   _aide   -   "Advanced Intrusion Detection Environment"  
/var/lib/aide /usr/sbin/nologin
in /usr/lib/sysusers.d/aide-common.conf and execute systemd-sysusers.

A fixed package will be brought on the way by means of stable proposed
updates and a bookworm point release.

Greetings
Marc



Bug#1037171: aide: fresh aide package install fails to add the requried _aide user to system

2023-06-06 Thread Tomasz Ciolek
Package: aide
Version: 0.18.3-1
Severity: serious
Justification: 5.d

Dear Maintainer,

A fresh aide package install on debina buster fails to add the requried _aide 
user to system. This block the ability to run 'aideinit' script.

While this is mentioned in /usr/share/doc/aide-common/README.Debian.gz there 
are no clear instrucntions as to whar range of UID/GID to give the _aide user 
when cerating them manually.

Pleas resolve as this blocks upgarde on most of my systems as I use aide across 
all of them.


-- System Information:
Debian Release: 12.0
  APT prefers testing-security
  APT policy: (500, 'testing-security'), (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 6.1.0-9-amd64 (SMP w/1 CPU thread; PREEMPT)
Locale: LANG=en_AU, LC_CTYPE=en_AU (charmap=ISO-8859-1), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages aide depends on:
ii  libacl1   2.3.1-3
ii  libaudit1 1:3.0.9-1
ii  libc6 2.36-9
ii  libcap2   1:2.66-4
ii  libext2fs21.47.0-2
ii  libmhash2 0.9.9.9-9
ii  libpcre2-8-0  10.42-1
ii  libselinux1   3.4-1+b6
ii  zlib1g1:1.2.13.dfsg-1

Versions of packages aide recommends:
ii  aide-common  0.18.3-1

Versions of packages aide suggests:
pn  figlet  

-- no debconf information