NFSv4: Don't use cred->cr_ops->cr_name in nfs4_proc_setclientid()
authorTrond Myklebust <Trond.Myklebust@netapp.com>
Tue, 8 Apr 2008 00:49:28 +0000 (20:49 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Sat, 19 Apr 2008 20:54:53 +0000 (16:54 -0400)
With the recent change to generic creds, we can no longer use
cred->cr_ops->cr_name to distinguish between RPCSEC_GSS principals and
AUTH_SYS/AUTH_NULL identities. Replace it with the rpc_authops->au_name
instead...

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/nfs4proc.c
include/linux/sunrpc/auth.h
net/sunrpc/auth_generic.c
net/sunrpc/auth_gss/auth_gss.c
net/sunrpc/auth_null.c
net/sunrpc/auth_unix.c

index a1069325b876ad10abc06dfc8c37879f68e9ae41..dbc09271af027f9d48b316e5a987c85aca79788e 100644 (file)
@@ -2885,7 +2885,7 @@ int nfs4_proc_setclientid(struct nfs_client *clp, u32 program, unsigned short po
                                                        RPC_DISPLAY_ADDR),
                                rpc_peeraddr2str(clp->cl_rpcclient,
                                                        RPC_DISPLAY_PROTO),
-                               cred->cr_ops->cr_name,
+                               clp->cl_rpcclient->cl_auth->au_ops->au_name,
                                clp->cl_id_uniquifier);
                setclientid.sc_netid_len = scnprintf(setclientid.sc_netid,
                                sizeof(setclientid.sc_netid),
index e93cd8aa3eb6f46734a6b626262b89c5f23969d2..a19c3af933ca5898bdc8ad504afae0398451a56e 100644 (file)
@@ -96,9 +96,7 @@ struct rpc_auth {
 struct rpc_authops {
        struct module           *owner;
        rpc_authflavor_t        au_flavor;      /* flavor (RPC_AUTH_*) */
-#ifdef RPC_DEBUG
        char *                  au_name;
-#endif
        struct rpc_auth *       (*create)(struct rpc_clnt *, rpc_authflavor_t);
        void                    (*destroy)(struct rpc_auth *);
 
index 6a3f77c9e4d3f89b0398419209012570a8a8bea3..b6f124c85072d069baf1e81c99aad2d065b5b07a 100644 (file)
@@ -136,9 +136,7 @@ static struct rpc_cred_cache generic_cred_cache = {
 
 static const struct rpc_authops generic_auth_ops = {
        .owner = THIS_MODULE,
-#ifdef RPC_DEBUG
        .au_name = "Generic",
-#endif
        .lookup_cred = generic_lookup_cred,
        .crcreate = generic_create_cred,
 };
index 55948cd5ea5555206644fee20ca259fc189e3ae6..7567eb95823b6cab458b6fb16fe5f69701e52306 100644 (file)
@@ -1287,9 +1287,7 @@ out:
 static const struct rpc_authops authgss_ops = {
        .owner          = THIS_MODULE,
        .au_flavor      = RPC_AUTH_GSS,
-#ifdef RPC_DEBUG
        .au_name        = "RPCSEC_GSS",
-#endif
        .create         = gss_create,
        .destroy        = gss_destroy,
        .lookup_cred    = gss_lookup_cred,
index 3c26c18df0dec1eca563c6fa8ff34cf7f50e10ad..c70dd7f5258e18b440f02a072a9a62337cd61d87 100644 (file)
@@ -104,9 +104,7 @@ nul_validate(struct rpc_task *task, __be32 *p)
 const struct rpc_authops authnull_ops = {
        .owner          = THIS_MODULE,
        .au_flavor      = RPC_AUTH_NULL,
-#ifdef RPC_DEBUG
        .au_name        = "NULL",
-#endif
        .create         = nul_create,
        .destroy        = nul_destroy,
        .lookup_cred    = nul_lookup_cred,
index 04e936a56fb23676096f573f93762015deb6ec19..44920b90bdc45a438faca8b2aa8d5cfb388a26c7 100644 (file)
@@ -210,9 +210,7 @@ void __init rpc_init_authunix(void)
 const struct rpc_authops authunix_ops = {
        .owner          = THIS_MODULE,
        .au_flavor      = RPC_AUTH_UNIX,
-#ifdef RPC_DEBUG
        .au_name        = "UNIX",
-#endif
        .create         = unx_create,
        .destroy        = unx_destroy,
        .lookup_cred    = unx_lookup_cred,