From 7afda720e48d774ccc02c7e6b97f05882bba3d06 Mon Sep 17 00:00:00 2001 From: Benjamin Coddington Date: Tue, 4 Nov 2014 14:46:17 -0500 Subject: nfsidmap: Correct a failure to set key timeout values The caller must be a possesor of the key to set the attributes, so link the destination keyring to the current thread's keyring before instantiation so that after instantiation the timeout can be set. Signed-off-by: Benjamin Coddington Signed-off-by: Steve Dickson --- utils/nfsidmap/nfsidmap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/utils/nfsidmap/nfsidmap.c b/utils/nfsidmap/nfsidmap.c index 4da7f5c..5d62078 100644 --- a/utils/nfsidmap/nfsidmap.c +++ b/utils/nfsidmap/nfsidmap.c @@ -329,6 +329,9 @@ int main(int argc, char **argv) key, type, value, timeout); } + /* Become a possesor of the to-be-instantiated key to set the key's timeout */ + request_key("keyring", DEFAULT_KEYRING, NULL, KEY_SPEC_THREAD_KEYRING); + if (strcmp(type, "uid") == 0) rc = id_lookup(value, key, USER); else if (strcmp(type, "gid") == 0) -- cgit