aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2006-06-09 09:34:34 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2006-06-09 09:34:34 -0400
commit81039f1f204a0fd2952112a240284e114f1a25e6 (patch)
tree511625e9ea5361dc240ef0540aff7e5cde1551cb
parentf7b422b17ee5ee4920e8ae24a6ad04bf3481ce72 (diff)
NFS: Display the chosen RPCSEC_GSS security flavour in /proc/mounts
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r--fs/nfs/super.c29
-rw-r--r--net/sunrpc/auth_null.c2
-rw-r--r--net/sunrpc/auth_unix.c1
3 files changed, 32 insertions, 0 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 4acd3ee96427..30f939bcb724 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -318,6 +318,34 @@ static int nfs_statfs(struct super_block *sb, struct kstatfs *buf)
318 318
319} 319}
320 320
321static const char *nfs_pseudoflavour_to_name(rpc_authflavor_t flavour)
322{
323 static struct {
324 rpc_authflavor_t flavour;
325 const char *str;
326 } sec_flavours[] = {
327 { RPC_AUTH_NULL, "null" },
328 { RPC_AUTH_UNIX, "sys" },
329 { RPC_AUTH_GSS_KRB5, "krb5" },
330 { RPC_AUTH_GSS_KRB5I, "krb5i" },
331 { RPC_AUTH_GSS_KRB5P, "krb5p" },
332 { RPC_AUTH_GSS_LKEY, "lkey" },
333 { RPC_AUTH_GSS_LKEYI, "lkeyi" },
334 { RPC_AUTH_GSS_LKEYP, "lkeyp" },
335 { RPC_AUTH_GSS_SPKM, "spkm" },
336 { RPC_AUTH_GSS_SPKMI, "spkmi" },
337 { RPC_AUTH_GSS_SPKMP, "spkmp" },
338 { -1, "unknown" }
339 };
340 int i;
341
342 for (i=0; sec_flavours[i].flavour != -1; i++) {
343 if (sec_flavours[i].flavour == flavour)
344 break;
345 }
346 return sec_flavours[i].str;
347}
348
321/* 349/*
322 * Describe the mount options in force on this server representation 350 * Describe the mount options in force on this server representation
323 */ 351 */
@@ -371,6 +399,7 @@ static void nfs_show_mount_options(struct seq_file *m, struct nfs_server *nfss,
371 seq_printf(m, ",proto=%s", proto); 399 seq_printf(m, ",proto=%s", proto);
372 seq_printf(m, ",timeo=%lu", 10U * nfss->retrans_timeo / HZ); 400 seq_printf(m, ",timeo=%lu", 10U * nfss->retrans_timeo / HZ);
373 seq_printf(m, ",retrans=%u", nfss->retrans_count); 401 seq_printf(m, ",retrans=%u", nfss->retrans_count);
402 seq_printf(m, ",sec=%s", nfs_pseudoflavour_to_name(nfss->client->cl_auth->au_flavor));
374} 403}
375 404
376/* 405/*
diff --git a/net/sunrpc/auth_null.c b/net/sunrpc/auth_null.c
index f56767aaa927..2eccffa96ba1 100644
--- a/net/sunrpc/auth_null.c
+++ b/net/sunrpc/auth_null.c
@@ -118,6 +118,8 @@ struct rpc_auth null_auth = {
118 .au_cslack = 4, 118 .au_cslack = 4,
119 .au_rslack = 2, 119 .au_rslack = 2,
120 .au_ops = &authnull_ops, 120 .au_ops = &authnull_ops,
121 .au_flavor = RPC_AUTH_NULL,
122 .au_count = ATOMIC_INIT(0),
121}; 123};
122 124
123static 125static
diff --git a/net/sunrpc/auth_unix.c b/net/sunrpc/auth_unix.c
index df14b6bfbf10..74c7406a1054 100644
--- a/net/sunrpc/auth_unix.c
+++ b/net/sunrpc/auth_unix.c
@@ -225,6 +225,7 @@ struct rpc_auth unix_auth = {
225 .au_cslack = UNX_WRITESLACK, 225 .au_cslack = UNX_WRITESLACK,
226 .au_rslack = 2, /* assume AUTH_NULL verf */ 226 .au_rslack = 2, /* assume AUTH_NULL verf */
227 .au_ops = &authunix_ops, 227 .au_ops = &authunix_ops,
228 .au_flavor = RPC_AUTH_UNIX,
228 .au_count = ATOMIC_INIT(0), 229 .au_count = ATOMIC_INIT(0),
229 .au_credcache = &unix_cred_cache, 230 .au_credcache = &unix_cred_cache,
230}; 231};