[apparmor] aa-enabled

Seth Arnold seth.arnold at canonical.com
Wed Dec 16 00:56:01 UTC 2015


On Tue, Dec 15, 2015 at 06:41:48PM -0600, Tyler Hicks wrote:
> > +	if (!quiet) {
> > +		switch(err) {
> > +		case ENOSYS:
> > +			printf(_("No - not available on this system.\n"));
> > +			break;
> > +		case ECANCELED:
> > +			printf(_("No - disabled at boot.\n"));
> > +			break;
> > +		case ENOENT:
> > +			printf(_("Maybe - policy interface not available.\n"));
> > +			break;
> > +		case EPERM:
> > +		case EACCES:
> > +			printf(_("Maybe - insufficient permissions to determine availability.\n"));
> > +			break;
> > +		default:
> > +		  printf(_("Error - '%s'\n"), strerror(err));
> > +		}
> > +	}
> > +
> > +	return err;
> 
> Do we really want to return an errno value here? Why not just
> EXIT_FAILURE?

Sigh, I looked right at this, made suggestions, and missed the point
entirely -- we have to exit with different exit codes because the exit
code from aa-status(8) is documented with these descriptions. But we
can't just return with EPERM, we actually need to map all these to 1--4.

Thanks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20151215/94c8b212/attachment.pgp>


More information about the AppArmor mailing list