[apparmor] [patch] aa-notify -p / better error message for wrong group

Seth Arnold seth.arnold at gmail.com
Sun Oct 16 08:31:09 UTC 2011

On Sat, Oct 15, 2011 at 3:57 PM, Christian Boltz <apparmor at cboltz.de> wrote:
> Hello,
> the error message in aa-notify -p if a user is not member of the group
> defined in notify.conf isn't too helpful.
> This patch adds a hint what needs to be changed to get aa-notify -p
> working.
> === modified file 'utils/aa-notify'
> --- utils/aa-notify     2011-10-12 11:08:25 +0000
> +++ utils/aa-notify     2011-10-15 11:59:06 +0000
> @@ -151,7 +151,7 @@
>     if (defined($prefs{use_group})) {
>         my ($name, $passwd, $gid, $members) = getgrnam($prefs{use_group});
>         if (not defined($members) or not defined($login) or (not grep { $_ eq $login } split(/ /, $members) and $login ne "root")) {
> -            _error("'$login' must be in '$prefs{use_group}' group. Aborting");
> +            _error("'$login' must be in '$prefs{use_group}' group. Aborting\nAsk your admin to add you to this group or to change the group in /etc/apparmor/notify.conf if you want to use aa-notify.");

I'm not convinced it _needs_ a new error message, but you did go to
the effort of writing a patch, so it couldn't be just idle hands.

However, I think the error message should use the $conf variable (in
case we ever clean up our /etc/ use it'd be nice if the error messages
Just Worked). And I think it should be line-wrapped before 80 columns.
(Immediately before the filename is probably best.)

More information about the AppArmor mailing list