]> git.ipfire.org Git - people/ms/linux.git/commit - fs/nfs/client.c
NFS/SUNRPC: don't lookup machine credential until rpcauth_bindcred().
authorNeilBrown <neilb@suse.com>
Mon, 3 Dec 2018 00:30:30 +0000 (11:30 +1100)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Wed, 19 Dec 2018 18:52:45 +0000 (13:52 -0500)
commit5e16923b432bfe79fdfb7cd95ed8e63f6438b663
tree92c842d96a8cacdead34c4f260bd371077f06793
parentecd5f97e1c7cd6124e3c3053beb5f2239aeacf8e
NFS/SUNRPC: don't lookup machine credential until rpcauth_bindcred().

When NFS creates a machine credential, it is a "generic" credential,
not tied to any auth protocol, and is really just a container for
the princpal name.
This doesn't get linked to a genuine credential until rpcauth_bindcred()
is called.
The lookup always succeeds, so various places that test if the machine
credential is NULL, are pointless.

As a step towards getting rid of generic credentials, this patch gets
rid of generic machine credentials.  The nfs_client and rpc_client
just hold a pointer to a constant principal name.
When a machine credential is wanted, a special static 'struct rpc_cred'
pointer is used. rpcauth_bindcred() recognizes this, finds the
principal from the client, and binds the correct credential.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
fs/nfs/client.c
fs/nfs/nfs4_fs.h
fs/nfs/nfs4state.c
fs/nfsd/nfs4callback.c
include/linux/nfs_fs_sb.h
include/linux/sunrpc/auth.h
include/linux/sunrpc/clnt.h
net/sunrpc/auth.c
net/sunrpc/auth_generic.c
net/sunrpc/clnt.c