[pkg-apparmor] Bug#917874: /etc/init.d/apparmor: 60: shift: can't shift that many

Christian Boltz debian-bugs at cboltz.de
Mon Dec 31 11:22:56 GMT 2018


Hello,

Am Montag, 31. Dezember 2018, 10:35:58 CET schrieb Jakub Wilk:
> Package: apparmor
> Version: 2.13.2-2
> 
> The init script is broken. The start action fails with:
> 
>    /etc/init.d/apparmor: 60: shift: can't shift that many

This looks like a regression from upstream commit
0d5ab43d592245d011b2614e6e20fc7cb851c53c
which got backported into the Debian package.


The fix is most likely (untested, because I don't see this error on 
openSUSE):

--- a/parser/rc.apparmor.functions
+++ b/parser/rc.apparmor.functions
@@ -252,7 +253,7 @@ mount_securityfs() {
 
 apparmor_start() {
        aa_log_daemon_msg "Starting AppArmor"
-       if ! is_apparmor_present ; then
+       if ! is_apparmor_present apparmor ; then
                aa_log_failure_msg "Starting AppArmor - failed, To enable AppArmor, ensure your kernel is configured with CONFIG_SECURITY_APPARMOR=y then add 'security=apparmor apparmor=1' to the kernel command line"
                aa_log_end_msg 1
                return 1

Jakub, can you please test if the patch fixes the problem?


@intrigeri: do you want to include this as another fix into
https://gitlab.com/apparmor/apparmor/merge_requests/252 ?
If not, I'll submit the above patch as separate merge request.

is_apparmor_present() might also need a round of cleanup, because since
upstream 94ff870f78ad32053392b19b4600b4b5584e3bfb (which removed 
grepping /proc/modules for $modules) the only code that still actually 
does something there is
    [ -d /sys/module/apparmor ]
    return $?
but that's another topic ;-)


Regards,

Christian Boltz
-- 
Foot:
    A device for finding furniture in the dark
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <http://alioth-lists.debian.net/pipermail/pkg-apparmor-team/attachments/20181231/40648590/attachment-0001.sig>


More information about the pkg-apparmor-team mailing list