From 6c31d0d894093c3151ef821ae2575e593627f1fb Mon Sep 17 00:00:00 2001 From: Steve Beattie Date: Thu, 19 Aug 2010 08:24:41 -0700 Subject: [PATCH] This commit teaches pam_apparmor about the current errno returned by the kernel when the hat that was passed does not exist in the profile (but other hats exist). It also removes the very old EPERM case, which hasn't been accurate for a while. (LP: #619521) --- changehat/pam_apparmor/pam_apparmor.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/changehat/pam_apparmor/pam_apparmor.c b/changehat/pam_apparmor/pam_apparmor.c index eb43ca81e..21c323f8f 100644 --- a/changehat/pam_apparmor/pam_apparmor.c +++ b/changehat/pam_apparmor/pam_apparmor.c @@ -1,10 +1,14 @@ /* pam_apparmor module */ /* - * $Id$ + * Copyright (c) 2006 + * NOVELL (All rights reserved) + * + * Copyright (c) 2010 + * Canonical, Ltd. (All rights reserved) * * Written by Jesse Michael 2006/08/24 - * and Steve Beattie 2006/10/25 + * and Steve Beattie 2006/10/25 * * Based off of pam_motd by: * Ben Collins 2005/10/04 @@ -165,8 +169,8 @@ int pam_sm_open_session(pam_handle_t *pamh, int flags, * stop attempting to use change_hat */ goto nodefault; break; - case EPERM: /* Disable when ECHILD patch gets accepted */ case EACCES: + case ENOENT: /* failed to change into attempted hat, so we'll * jump back out and try the next one */ break;