From patchwork Mon Nov 3 17:49:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Coddington X-Patchwork-Id: 5218601 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 24A0DC11AC for ; Mon, 3 Nov 2014 17:49:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5B9C120127 for ; Mon, 3 Nov 2014 17:49:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D5F522015D for ; Mon, 3 Nov 2014 17:49:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752681AbaKCRtk (ORCPT ); Mon, 3 Nov 2014 12:49:40 -0500 Received: from mx1.redhat.com ([209.132.183.28]:43052 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751436AbaKCRtk (ORCPT ); Mon, 3 Nov 2014 12:49:40 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sA3HnYdS002634 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 3 Nov 2014 12:49:34 -0500 Received: from bcodding-csb.redhat.com (vpn-50-102.rdu2.redhat.com [10.10.50.102]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sA3HnYCx023989; Mon, 3 Nov 2014 12:49:34 -0500 Received: by bcodding-csb.redhat.com (Postfix, from userid 24008) id 1055983F04; Mon, 3 Nov 2014 12:49:33 -0500 (EST) From: Benjamin Coddington 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 Message-Id: <13a6c96c4a94b19e4e4e9f95250dca6e46c1969d.1415036893.git.bcodding@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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)