diff options
author | Benjamin Coddington <bcodding@redhat.com> | 2014-11-04 14:46:17 -0500 |
---|---|---|
committer | Steve Dickson <steved@redhat.com> | 2014-11-04 14:48:07 -0500 |
commit | 7afda720e48d774ccc02c7e6b97f05882bba3d06 (patch) | |
tree | 14523582156ba9e7a84ed49b3f43ec40c1f6a264 | |
parent | f862ad1a94201df13b46cedca3cef2192c100b50 (diff) | |
download | nfs-utils-7afda720e48d774ccc02c7e6b97f05882bba3d06.tar.gz nfs-utils-7afda720e48d774ccc02c7e6b97f05882bba3d06.tar.xz nfs-utils-7afda720e48d774ccc02c7e6b97f05882bba3d06.zip |
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 <bcodding@redhat.com>
Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r-- | utils/nfsidmap/nfsidmap.c | 3 |
1 files changed, 3 insertions, 0 deletions
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) |