All of lore.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Coddington <bcodding@redhat.com>
To: linux-nfs@vger.kernel.org
Cc: chuck.lever@oracle.com
Subject: [PATCH 2/2] nfsidmap: Correct a failure to set key timeout values
Date: Mon,  3 Nov 2014 12:49:33 -0500	[thread overview]
Message-ID: <13a6c96c4a94b19e4e4e9f95250dca6e46c1969d.1415036893.git.bcodding@redhat.com> (raw)
In-Reply-To: <cover.1415036893.git.bcodding@redhat.com>
In-Reply-To: <cover.1415036893.git.bcodding@redhat.com>

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>
---
 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..b141f9e 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)
-- 
1.7.1


  parent reply	other threads:[~2014-11-03 17:49 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-03 17:49 [PATCH 0/2] nfsidmap not setting key timeouts Benjamin Coddington
2014-11-03 17:49 ` [PATCH 1/2] nfsidmap: set the correct DEFAULT_KEYRING string Benjamin Coddington
2014-11-03 17:49 ` Benjamin Coddington [this message]
2014-11-03 20:43 ` [PATCH 0/2] nfsidmap not setting key timeouts Chuck Lever
2014-11-04 19:49 ` Steve Dickson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=13a6c96c4a94b19e4e4e9f95250dca6e46c1969d.1415036893.git.bcodding@redhat.com \
    --to=bcodding@redhat.com \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.