From: Simon Wilkinson Date: Sat, 19 Dec 2009 21:53:54 +0000 (+0000) Subject: Fix PAGs for all platforms without Linux keyrings X-Git-Tag: openafs-devel-1_5_69~93 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=846c28282fb4ccd2136e3e27b60b9363ea7f759e;p=packages%2Fo%2Fopenafs.git Fix PAGs for all platforms without Linux keyrings The changes in 7b272177de4c6f78db7f2315f4e30e85ab7660bb sadly break all platforms which aren't Linux. This is because the logic in PagInCred doesn't handle the non-Linux case at all. Fix this so that we call afs_get_group_pag whenever we're not running on Linux. The code also doesn't match the comment - Linux kernels which don't have keyrings should use afs_get_group_pag(), regardless of whether STRUCT_TASK_HAS_CRED. It's unlikely this bit would ever bite anyone though, kernels with cred support almost certainly require keyrings. Change-Id: I5373da51151229dc13b6dc60c3cf10700f0f881a Reviewed-on: http://gerrit.openafs.org/1006 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- diff --git a/src/afs/afs_osi_pag.c b/src/afs/afs_osi_pag.c index 4a8eb4443..4db10a83a 100644 --- a/src/afs/afs_osi_pag.c +++ b/src/afs/afs_osi_pag.c @@ -609,6 +609,7 @@ PagInCred(afs_ucred_t *cred) if (cred == NULL || cred == afs_osi_credp) { return NOPAG; } +#if defined(AFS_LINUX26_ENV) && defined(LINUX_KEYRING_SUPPORT) /* * If linux keyrings are in use and we carry the session keyring in our credentials * structure, they should be the only criteria for determining @@ -617,12 +618,13 @@ PagInCred(afs_ucred_t *cred) * With keyrings but no kernel credentials, look at groups first and fall back * to looking at the keyrings. */ -#if defined(AFS_LINUX26_ENV) && !defined(STRUCT_TASK_HAS_CRED) +# if !defined(STRUCT_TASK_HAS_CRED) pag = afs_get_group_pag(cred); -#endif -#if defined(AFS_LINUX26_ENV) && defined(LINUX_KEYRING_SUPPORT) +# endif if (pag == NOPAG) - pag = osi_get_keyring_pag(cred); + pag = osi_get_keyring_pag(cred); +#else + pag = afs_get_group_pag(cred); #endif return pag; }