aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/sunrpc/auth.h15
-rw-r--r--include/linux/sunrpc/gss_api.h2
-rw-r--r--net/sunrpc/auth.c8
-rw-r--r--net/sunrpc/auth_gss/auth_gss.c8
-rw-r--r--net/sunrpc/auth_gss/gss_krb5_mech.c2
-rw-r--r--net/sunrpc/auth_gss/gss_spkm3_mech.c2
-rw-r--r--net/sunrpc/auth_null.c4
-rw-r--r--net/sunrpc/auth_unix.c6
8 files changed, 22 insertions, 25 deletions
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h
index bc77c730325c..e606c2804685 100644
--- a/include/linux/sunrpc/auth.h
+++ b/include/linux/sunrpc/auth.h
@@ -35,7 +35,7 @@ struct rpc_credops;
35struct rpc_cred { 35struct rpc_cred {
36 struct hlist_node cr_hash; /* hash chain */ 36 struct hlist_node cr_hash; /* hash chain */
37 struct rpc_auth * cr_auth; 37 struct rpc_auth * cr_auth;
38 struct rpc_credops * cr_ops; 38 const struct rpc_credops *cr_ops;
39 unsigned long cr_expire; /* when to gc */ 39 unsigned long cr_expire; /* when to gc */
40 atomic_t cr_count; /* ref count */ 40 atomic_t cr_count; /* ref count */
41 unsigned short cr_flags; /* various flags */ 41 unsigned short cr_flags; /* various flags */
@@ -73,7 +73,7 @@ struct rpc_auth {
73 unsigned int au_verfsize; 73 unsigned int au_verfsize;
74 74
75 unsigned int au_flags; /* various flags */ 75 unsigned int au_flags; /* various flags */
76 struct rpc_authops * au_ops; /* operations */ 76 const struct rpc_authops *au_ops; /* operations */
77 rpc_authflavor_t au_flavor; /* pseudoflavor (note may 77 rpc_authflavor_t au_flavor; /* pseudoflavor (note may
78 * differ from the flavor in 78 * differ from the flavor in
79 * au_ops->au_flavor in gss 79 * au_ops->au_flavor in gss
@@ -119,14 +119,11 @@ struct rpc_credops {
119 void *, __be32 *, void *); 119 void *, __be32 *, void *);
120}; 120};
121 121
122extern struct rpc_authops authunix_ops; 122extern const struct rpc_authops authunix_ops;
123extern struct rpc_authops authnull_ops; 123extern const struct rpc_authops authnull_ops;
124#ifdef CONFIG_SUNRPC_SECURE
125extern struct rpc_authops authdes_ops;
126#endif
127 124
128int rpcauth_register(struct rpc_authops *); 125int rpcauth_register(const struct rpc_authops *);
129int rpcauth_unregister(struct rpc_authops *); 126int rpcauth_unregister(const struct rpc_authops *);
130struct rpc_auth * rpcauth_create(rpc_authflavor_t, struct rpc_clnt *); 127struct rpc_auth * rpcauth_create(rpc_authflavor_t, struct rpc_clnt *);
131void rpcauth_release(struct rpc_auth *); 128void rpcauth_release(struct rpc_auth *);
132struct rpc_cred * rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred *, int); 129struct rpc_cred * rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred *, int);
diff --git a/include/linux/sunrpc/gss_api.h b/include/linux/sunrpc/gss_api.h
index 5eca9e442051..bbac101ac372 100644
--- a/include/linux/sunrpc/gss_api.h
+++ b/include/linux/sunrpc/gss_api.h
@@ -77,7 +77,7 @@ struct gss_api_mech {
77 struct module *gm_owner; 77 struct module *gm_owner;
78 struct xdr_netobj gm_oid; 78 struct xdr_netobj gm_oid;
79 char *gm_name; 79 char *gm_name;
80 struct gss_api_ops *gm_ops; 80 const struct gss_api_ops *gm_ops;
81 /* pseudoflavors supported by this mechanism: */ 81 /* pseudoflavors supported by this mechanism: */
82 int gm_pf_num; 82 int gm_pf_num;
83 struct pf_desc * gm_pfs; 83 struct pf_desc * gm_pfs;
diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c
index 1686dc74c6a9..d3f0f944c0b5 100644
--- a/net/sunrpc/auth.c
+++ b/net/sunrpc/auth.c
@@ -19,7 +19,7 @@
19#endif 19#endif
20 20
21static DEFINE_SPINLOCK(rpc_authflavor_lock); 21static DEFINE_SPINLOCK(rpc_authflavor_lock);
22static struct rpc_authops * auth_flavors[RPC_AUTH_MAXFLAVOR] = { 22static const struct rpc_authops *auth_flavors[RPC_AUTH_MAXFLAVOR] = {
23 &authnull_ops, /* AUTH_NULL */ 23 &authnull_ops, /* AUTH_NULL */
24 &authunix_ops, /* AUTH_UNIX */ 24 &authunix_ops, /* AUTH_UNIX */
25 NULL, /* others can be loadable modules */ 25 NULL, /* others can be loadable modules */
@@ -33,7 +33,7 @@ pseudoflavor_to_flavor(u32 flavor) {
33} 33}
34 34
35int 35int
36rpcauth_register(struct rpc_authops *ops) 36rpcauth_register(const struct rpc_authops *ops)
37{ 37{
38 rpc_authflavor_t flavor; 38 rpc_authflavor_t flavor;
39 int ret = -EPERM; 39 int ret = -EPERM;
@@ -50,7 +50,7 @@ rpcauth_register(struct rpc_authops *ops)
50} 50}
51 51
52int 52int
53rpcauth_unregister(struct rpc_authops *ops) 53rpcauth_unregister(const struct rpc_authops *ops)
54{ 54{
55 rpc_authflavor_t flavor; 55 rpc_authflavor_t flavor;
56 int ret = -EPERM; 56 int ret = -EPERM;
@@ -70,7 +70,7 @@ struct rpc_auth *
70rpcauth_create(rpc_authflavor_t pseudoflavor, struct rpc_clnt *clnt) 70rpcauth_create(rpc_authflavor_t pseudoflavor, struct rpc_clnt *clnt)
71{ 71{
72 struct rpc_auth *auth; 72 struct rpc_auth *auth;
73 struct rpc_authops *ops; 73 const struct rpc_authops *ops;
74 u32 flavor = pseudoflavor_to_flavor(pseudoflavor); 74 u32 flavor = pseudoflavor_to_flavor(pseudoflavor);
75 75
76 auth = ERR_PTR(-EINVAL); 76 auth = ERR_PTR(-EINVAL);
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c
index 459dc9b1d1ad..177a9e413c0a 100644
--- a/net/sunrpc/auth_gss/auth_gss.c
+++ b/net/sunrpc/auth_gss/auth_gss.c
@@ -54,9 +54,9 @@
54#include <linux/sunrpc/gss_api.h> 54#include <linux/sunrpc/gss_api.h>
55#include <asm/uaccess.h> 55#include <asm/uaccess.h>
56 56
57static struct rpc_authops authgss_ops; 57static const struct rpc_authops authgss_ops;
58 58
59static struct rpc_credops gss_credops; 59static const struct rpc_credops gss_credops;
60 60
61#ifdef RPC_DEBUG 61#ifdef RPC_DEBUG
62# define RPCDBG_FACILITY RPCDBG_AUTH 62# define RPCDBG_FACILITY RPCDBG_AUTH
@@ -1193,7 +1193,7 @@ out:
1193 return status; 1193 return status;
1194} 1194}
1195 1195
1196static struct rpc_authops authgss_ops = { 1196static const struct rpc_authops authgss_ops = {
1197 .owner = THIS_MODULE, 1197 .owner = THIS_MODULE,
1198 .au_flavor = RPC_AUTH_GSS, 1198 .au_flavor = RPC_AUTH_GSS,
1199#ifdef RPC_DEBUG 1199#ifdef RPC_DEBUG
@@ -1205,7 +1205,7 @@ static struct rpc_authops authgss_ops = {
1205 .crcreate = gss_create_cred 1205 .crcreate = gss_create_cred
1206}; 1206};
1207 1207
1208static struct rpc_credops gss_credops = { 1208static const struct rpc_credops gss_credops = {
1209 .cr_name = "AUTH_GSS", 1209 .cr_name = "AUTH_GSS",
1210 .crdestroy = gss_destroy_cred, 1210 .crdestroy = gss_destroy_cred,
1211 .cr_init = gss_cred_init, 1211 .cr_init = gss_cred_init,
diff --git a/net/sunrpc/auth_gss/gss_krb5_mech.c b/net/sunrpc/auth_gss/gss_krb5_mech.c
index 7b1943217053..71b9daefdff3 100644
--- a/net/sunrpc/auth_gss/gss_krb5_mech.c
+++ b/net/sunrpc/auth_gss/gss_krb5_mech.c
@@ -201,7 +201,7 @@ gss_delete_sec_context_kerberos(void *internal_ctx) {
201 kfree(kctx); 201 kfree(kctx);
202} 202}
203 203
204static struct gss_api_ops gss_kerberos_ops = { 204static const struct gss_api_ops gss_kerberos_ops = {
205 .gss_import_sec_context = gss_import_sec_context_kerberos, 205 .gss_import_sec_context = gss_import_sec_context_kerberos,
206 .gss_get_mic = gss_get_mic_kerberos, 206 .gss_get_mic = gss_get_mic_kerberos,
207 .gss_verify_mic = gss_verify_mic_kerberos, 207 .gss_verify_mic = gss_verify_mic_kerberos,
diff --git a/net/sunrpc/auth_gss/gss_spkm3_mech.c b/net/sunrpc/auth_gss/gss_spkm3_mech.c
index 7e15aa68ae64..577d590e755f 100644
--- a/net/sunrpc/auth_gss/gss_spkm3_mech.c
+++ b/net/sunrpc/auth_gss/gss_spkm3_mech.c
@@ -202,7 +202,7 @@ gss_get_mic_spkm3(struct gss_ctx *ctx,
202 return err; 202 return err;
203} 203}
204 204
205static struct gss_api_ops gss_spkm3_ops = { 205static const struct gss_api_ops gss_spkm3_ops = {
206 .gss_import_sec_context = gss_import_sec_context_spkm3, 206 .gss_import_sec_context = gss_import_sec_context_spkm3,
207 .gss_get_mic = gss_get_mic_spkm3, 207 .gss_get_mic = gss_get_mic_spkm3,
208 .gss_verify_mic = gss_verify_mic_spkm3, 208 .gss_verify_mic = gss_verify_mic_spkm3,
diff --git a/net/sunrpc/auth_null.c b/net/sunrpc/auth_null.c
index 890bd9b3794b..fe9b6aaf91eb 100644
--- a/net/sunrpc/auth_null.c
+++ b/net/sunrpc/auth_null.c
@@ -101,7 +101,7 @@ nul_validate(struct rpc_task *task, __be32 *p)
101 return p; 101 return p;
102} 102}
103 103
104struct rpc_authops authnull_ops = { 104const struct rpc_authops authnull_ops = {
105 .owner = THIS_MODULE, 105 .owner = THIS_MODULE,
106 .au_flavor = RPC_AUTH_NULL, 106 .au_flavor = RPC_AUTH_NULL,
107#ifdef RPC_DEBUG 107#ifdef RPC_DEBUG
@@ -122,7 +122,7 @@ struct rpc_auth null_auth = {
122}; 122};
123 123
124static 124static
125struct rpc_credops null_credops = { 125const struct rpc_credops null_credops = {
126 .cr_name = "AUTH_NULL", 126 .cr_name = "AUTH_NULL",
127 .crdestroy = nul_destroy_cred, 127 .crdestroy = nul_destroy_cred,
128 .crmatch = nul_match, 128 .crmatch = nul_match,
diff --git a/net/sunrpc/auth_unix.c b/net/sunrpc/auth_unix.c
index e54782e75d59..6600c7ad72a9 100644
--- a/net/sunrpc/auth_unix.c
+++ b/net/sunrpc/auth_unix.c
@@ -34,7 +34,7 @@ struct unx_cred {
34 34
35static struct rpc_auth unix_auth; 35static struct rpc_auth unix_auth;
36static struct rpc_cred_cache unix_cred_cache; 36static struct rpc_cred_cache unix_cred_cache;
37static struct rpc_credops unix_credops; 37static const struct rpc_credops unix_credops;
38 38
39static struct rpc_auth * 39static struct rpc_auth *
40unx_create(struct rpc_clnt *clnt, rpc_authflavor_t flavor) 40unx_create(struct rpc_clnt *clnt, rpc_authflavor_t flavor)
@@ -205,7 +205,7 @@ unx_validate(struct rpc_task *task, __be32 *p)
205 return p; 205 return p;
206} 206}
207 207
208struct rpc_authops authunix_ops = { 208const struct rpc_authops authunix_ops = {
209 .owner = THIS_MODULE, 209 .owner = THIS_MODULE,
210 .au_flavor = RPC_AUTH_UNIX, 210 .au_flavor = RPC_AUTH_UNIX,
211#ifdef RPC_DEBUG 211#ifdef RPC_DEBUG
@@ -233,7 +233,7 @@ struct rpc_auth unix_auth = {
233}; 233};
234 234
235static 235static
236struct rpc_credops unix_credops = { 236const struct rpc_credops unix_credops = {
237 .cr_name = "AUTH_UNIX", 237 .cr_name = "AUTH_UNIX",
238 .crdestroy = unx_destroy_cred, 238 .crdestroy = unx_destroy_cred,
239 .crmatch = unx_match, 239 .crmatch = unx_match,