Jonas, this is the branch I have:

https://code.launchpad.net/~ahasenack/ubuntu/+source/openldap/+git/openldap/+ref/questing-
openldap-apparmor-2119884

The relevant commit:
commit fd332b8d456cfc043ed3dc707c41f8c5912b0a8a
Author: Andreas Hasenack <[email protected]>
Date:   Tue Aug 26 11:24:32 2025 -0300

      * d/rules: fix apparmor profile installation (LP: #2119884)

diff --git a/debian/rules b/debian/rules
index 684d70627a..b570f4ecb7 100755
--- a/debian/rules
+++ b/debian/rules
@@ -144,6 +144,8 @@ override_dh_auto_install-indep:
            ${installdir}/usr/share/man/man5/ldap.conf.5
 
 ifeq (${noslapd},)
+override_dh_install-arch:
+       dh_install
        # install AppArmor profile
        install -D -m 644 $(CURDIR)/debian/apparmor-profile \
            $(CURDIR)/debian/slapd/etc/apparmor.d/usr.sbin.slapd
@@ -157,8 +159,6 @@ ifeq (${noslapd},)
            $(CURDIR)/debian/slapd/etc/ufw/applications.d/slapd
 endif
 
-override_dh_auto_build: override_dh_auto_build-arch
-
 override_dh_installinit:
        dh_installinit --no-restart-after-upgrade 
--error-handler=ignore_init_failure -- "defaults 19 80"


The first part is more or less obvious, it fixes installing the apparmor 
profile. But the second override, the one I'm removing, I just detected because 
it was also part of a bad merge. But I can't say what the impact is of leaving 
it out, or in.

That override_dh_auto_build was removed in debian here:
commit 69b998a5f98c2d07e99a4a252d0ee9616e899bfc (tag: pkg/import/2.6.9+dfsg-1, 
tag: import/2.6.9+dfsg-1)
Author: Ryan Tandy <[email protected]>
Date:   Tue Jan 14 18:30:51 2025 -0800

    2.6.9+dfsg-1 (patches unapplied)
    
    Imported using git-ubuntu import.

...
      * d/rules: Delete override_dh_auto_build target, so that -indep/-arch are
        actually used. See #1014334.

But we reintroduced it (by mistake?) here, in the same commit that
incorrectly tried to reapply the apparmor delta:

$ git show 98a18f4bdc5ba15eab807027b9073fdccaba5119 -- debian/rules
commit 98a18f4bdc5ba15eab807027b9073fdccaba5119
Author: Sergio Durigan Junior <[email protected]>
Date:   Tue Jun 15 13:31:22 2021 -0400

        - Enable AppArmor support:
          + d/apparmor-profile: add AppArmor profile
          + d/rules: use dh_apparmor
          + d/control: Build-Depends on dh-apparmor
          + d/slapd.README.Debian: add note about AppArmor

diff --git a/debian/rules b/debian/rules
index 9d1e9bf717..3361057fad 100755
--- a/debian/rules
+++ b/debian/rules
@@ -143,6 +143,15 @@ override_dh_auto_install-indep:
        install -Dm0644 ${builddir}/doc/man/man5/ldap.conf.5.tmp \
            ${installdir}/usr/share/man/man5/ldap.conf.5
 
+ifeq (${noslapd},)
+       # install AppArmor profile
+       install -D -m 644 $(CURDIR)/debian/apparmor-profile \
+           $(CURDIR)/debian/slapd/etc/apparmor.d/usr.sbin.slapd
+       dh_apparmor -pslapd --profile-name=usr.sbin.slapd
+endif
+
+override_dh_auto_build: override_dh_auto_build-arch
+
 override_dh_installinit:
        dh_installinit --no-restart-after-upgrade 
--error-handler=ignore_init_failure -- "defaults 19 80"


So I think we should delete "override_dh_auto_build: 
override_dh_auto_build-arch", because it was deleted in debian and I think we 
reintroduced it by mistake, but I stopped short of determining what the impact 
of that is. That's why this bug was dragging so long...

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2119884

Title:
  slapd missing apparmor profile, and when applied, fails to start under
  systemd

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/openldap/+bug/2119884/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to