From 0caf14224a9153bb488be9e52d67892a2c441a5a Mon Sep 17 00:00:00 2001 From: Marc Dionne Date: Fri, 22 Jan 2010 20:03:58 -0500 Subject: [PATCH] Linux Keyrings: don't ignore error code from session keyring creation Creating a session keyring can fail, for instance if the user's keyring quotas are reached (number of keys/keyrings or data size). Instead of ignoring errors, return them so they can be passed back to the caller. FIXES 126230 Change-Id: I745abeef4b3b8e4c3ab1b90667c6a5478c1e0ad2 Change-Id: I4b0ce6423ee493fbbcbdac1c580e3a157d3c11f4 Reviewed-on: http://gerrit.openafs.org/1151 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- src/afs/LINUX/osi_groups.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/afs/LINUX/osi_groups.c b/src/afs/LINUX/osi_groups.c index 11bd17a8e1..835e1e2127 100644 --- a/src/afs/LINUX/osi_groups.c +++ b/src/afs/LINUX/osi_groups.c @@ -228,9 +228,8 @@ setpag(cred_t **cr, afs_uint32 pagvalue, afs_uint32 *newpag, #ifdef LINUX_KEYRING_SUPPORT if (code == 0 && afs_cr_rgid(*cr) != NFSXLATOR_CRED) { - (void) install_session_keyring(NULL); - - if (current_session_keyring()) { + code = install_session_keyring(NULL); + if (code == 0 && current_session_keyring()) { struct key *key; key_perm_t perm; @@ -243,6 +242,8 @@ setpag(cred_t **cr, afs_uint32 pagvalue, afs_uint32 *newpag, key_instantiate_and_link(key, (void *) newpag, sizeof(afs_uint32), current_session_keyring(), NULL); key_put(key); + } else { + code = PTR_ERR(key); } } }