diff options
| author | Kevin Coffman <kwc@citi.umich.edu> | 2011-03-02 19:51:42 -0500 |
|---|---|---|
| committer | J. Bruce Fields <bfields@redhat.com> | 2011-03-07 12:06:48 -0500 |
| commit | b0b0c0a26e846ae6646af9f59a3d2ea06b49cbc7 (patch) | |
| tree | 4fd43c06c0e63b6004fd2b6808ac8d0677921cc6 | |
| parent | 540c8cb6a576f34a9a0b04467f46bb6e67a1f852 (diff) | |
nfsd: add proc file listing kernel's gss_krb5 enctypes
Add a new proc file which lists the encryption types supported
by the kernel's gss_krb5 code.
Newer MIT Kerberos libraries support the assertion of acceptor
subkeys. This enctype information allows user-land (svcgssd)
to request that the Kerberos libraries limit the encryption
types that it uses when generating the subkeys.
Signed-off-by: Kevin Coffman <kwc@citi.umich.edu>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
| -rw-r--r-- | fs/nfsd/nfsctl.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c index 33b3e2b0677..35dcfa8eba2 100644 --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c | |||
| @@ -12,13 +12,14 @@ | |||
| 12 | #include <linux/nfsd/syscall.h> | 12 | #include <linux/nfsd/syscall.h> |
| 13 | #include <linux/lockd/lockd.h> | 13 | #include <linux/lockd/lockd.h> |
| 14 | #include <linux/sunrpc/clnt.h> | 14 | #include <linux/sunrpc/clnt.h> |
| 15 | #include <linux/sunrpc/gss_api.h> | ||
| 15 | 16 | ||
| 16 | #include "idmap.h" | 17 | #include "idmap.h" |
| 17 | #include "nfsd.h" | 18 | #include "nfsd.h" |
| 18 | #include "cache.h" | 19 | #include "cache.h" |
| 19 | 20 | ||
| 20 | /* | 21 | /* |
| 21 | * We have a single directory with 9 nodes in it. | 22 | * We have a single directory with several nodes in it. |
| 22 | */ | 23 | */ |
| 23 | enum { | 24 | enum { |
| 24 | NFSD_Root = 1, | 25 | NFSD_Root = 1, |
| @@ -42,6 +43,7 @@ enum { | |||
| 42 | NFSD_Versions, | 43 | NFSD_Versions, |
| 43 | NFSD_Ports, | 44 | NFSD_Ports, |
| 44 | NFSD_MaxBlkSize, | 45 | NFSD_MaxBlkSize, |
| 46 | NFSD_SupportedEnctypes, | ||
| 45 | /* | 47 | /* |
| 46 | * The below MUST come last. Otherwise we leave a hole in nfsd_files[] | 48 | * The below MUST come last. Otherwise we leave a hole in nfsd_files[] |
| 47 | * with !CONFIG_NFSD_V4 and simple_fill_super() goes oops | 49 | * with !CONFIG_NFSD_V4 and simple_fill_super() goes oops |
| @@ -187,6 +189,32 @@ static struct file_operations export_features_operations = { | |||
| 187 | .release = single_release, | 189 | .release = single_release, |
| 188 | }; | 190 | }; |
| 189 | 191 | ||
| 192 | static int supported_enctypes_show(struct seq_file *m, void *v) | ||
| 193 | { | ||
| 194 | struct gss_api_mech *k5mech; | ||
| 195 | |||
| 196 | k5mech = gss_mech_get_by_name("krb5"); | ||
| 197 | if (k5mech == NULL) | ||
| 198 | goto out; | ||
| 199 | if (k5mech->gm_upcall_enctypes != NULL) | ||
| 200 | seq_printf(m, k5mech->gm_upcall_enctypes); | ||
| 201 | gss_mech_put(k5mech); | ||
| 202 | out: | ||
| 203 | return 0; | ||
| 204 | } | ||
| 205 | |||
| 206 | static int supported_enctypes_open(struct inode *inode, struct file *file) | ||
| 207 | { | ||
| 208 | return single_open(file, supported_enctypes_show, NULL); | ||
| 209 | } | ||
| 210 | |||
| 211 | static struct file_operations supported_enctypes_ops = { | ||
| 212 | .open = supported_enctypes_open, | ||
| 213 | .read = seq_read, | ||
| 214 | .llseek = seq_lseek, | ||
| 215 | .release = single_release, | ||
| 216 | }; | ||
| 217 | |||
| 190 | extern int nfsd_pool_stats_open(struct inode *inode, struct file *file); | 218 | extern int nfsd_pool_stats_open(struct inode *inode, struct file *file); |
| 191 | extern int nfsd_pool_stats_release(struct inode *inode, struct file *file); | 219 | extern int nfsd_pool_stats_release(struct inode *inode, struct file *file); |
| 192 | 220 | ||
| @@ -1397,6 +1425,7 @@ static int nfsd_fill_super(struct super_block * sb, void * data, int silent) | |||
| 1397 | [NFSD_Versions] = {"versions", &transaction_ops, S_IWUSR|S_IRUSR}, | 1425 | [NFSD_Versions] = {"versions", &transaction_ops, S_IWUSR|S_IRUSR}, |
| 1398 | [NFSD_Ports] = {"portlist", &transaction_ops, S_IWUSR|S_IRUGO}, | 1426 | [NFSD_Ports] = {"portlist", &transaction_ops, S_IWUSR|S_IRUGO}, |
| 1399 | [NFSD_MaxBlkSize] = {"max_block_size", &transaction_ops, S_IWUSR|S_IRUGO}, | 1427 | [NFSD_MaxBlkSize] = {"max_block_size", &transaction_ops, S_IWUSR|S_IRUGO}, |
| 1428 | [NFSD_SupportedEnctypes] = {"supported_krb5_enctypes", &supported_enctypes_ops, S_IRUGO}, | ||
| 1400 | #ifdef CONFIG_NFSD_V4 | 1429 | #ifdef CONFIG_NFSD_V4 |
| 1401 | [NFSD_Leasetime] = {"nfsv4leasetime", &transaction_ops, S_IWUSR|S_IRUSR}, | 1430 | [NFSD_Leasetime] = {"nfsv4leasetime", &transaction_ops, S_IWUSR|S_IRUSR}, |
| 1402 | [NFSD_Gracetime] = {"nfsv4gracetime", &transaction_ops, S_IWUSR|S_IRUSR}, | 1431 | [NFSD_Gracetime] = {"nfsv4gracetime", &transaction_ops, S_IWUSR|S_IRUSR}, |
