mirror of
https://git.openafs.org/openafs.git
synced 2025-01-19 15:30:14 +00:00
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 <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
This commit is contained in:
parent
8462b1a1b2
commit
0caf14224a
@ -228,9 +228,8 @@ setpag(cred_t **cr, afs_uint32 pagvalue, afs_uint32 *newpag,
|
|||||||
|
|
||||||
#ifdef LINUX_KEYRING_SUPPORT
|
#ifdef LINUX_KEYRING_SUPPORT
|
||||||
if (code == 0 && afs_cr_rgid(*cr) != NFSXLATOR_CRED) {
|
if (code == 0 && afs_cr_rgid(*cr) != NFSXLATOR_CRED) {
|
||||||
(void) install_session_keyring(NULL);
|
code = install_session_keyring(NULL);
|
||||||
|
if (code == 0 && current_session_keyring()) {
|
||||||
if (current_session_keyring()) {
|
|
||||||
struct key *key;
|
struct key *key;
|
||||||
key_perm_t perm;
|
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),
|
key_instantiate_and_link(key, (void *) newpag, sizeof(afs_uint32),
|
||||||
current_session_keyring(), NULL);
|
current_session_keyring(), NULL);
|
||||||
key_put(key);
|
key_put(key);
|
||||||
|
} else {
|
||||||
|
code = PTR_ERR(key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user