aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2014-05-07 07:49:44 -0400
committerJ. Bruce Fields <bfields@redhat.com>2014-05-08 12:43:03 -0400
commit5409e46f1bcf960c651f3fff35f2f25e539655cf (patch)
tree2ed81c5a35f0adafcf63347b0407c8b6c2ea6156 /include/uapi
parentecc7455d8eb1860f5aa6b9ad82a9a81f93eb11d1 (diff)
nfsd: clean up fh_auth usage
Use fh_fsid when reffering to the fsid part of the filehandle. The variable length auth field envisioned in nfsfh wasn't ever implemented. Also clean up some lose ends around this and document the file handle format better. Btw, why do we even export nfsfh.h to userspace? The file handle very much is kernel private, and nothing in nfs-utils include the header either. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'include/uapi')
-rw-r--r--include/uapi/linux/nfsd/nfsfh.h32
1 files changed, 7 insertions, 25 deletions
diff --git a/include/uapi/linux/nfsd/nfsfh.h b/include/uapi/linux/nfsd/nfsfh.h
index 616e3b396476..20391235d088 100644
--- a/include/uapi/linux/nfsd/nfsfh.h
+++ b/include/uapi/linux/nfsd/nfsfh.h
@@ -1,13 +1,7 @@
1/* 1/*
2 * include/linux/nfsd/nfsfh.h
3 *
4 * This file describes the layout of the file handles as passed 2 * This file describes the layout of the file handles as passed
5 * over the wire. 3 * over the wire.
6 * 4 *
7 * Earlier versions of knfsd used to sign file handles using keyed MD5
8 * or SHA. I've removed this code, because it doesn't give you more
9 * security than blocking external access to port 2049 on your firewall.
10 *
11 * Copyright (C) 1995, 1996, 1997 Olaf Kirch <okir@monad.swb.de> 5 * Copyright (C) 1995, 1996, 1997 Olaf Kirch <okir@monad.swb.de>
12 */ 6 */
13 7
@@ -37,7 +31,7 @@ struct nfs_fhbase_old {
37}; 31};
38 32
39/* 33/*
40 * This is the new flexible, extensible style NFSv2/v3 file handle. 34 * This is the new flexible, extensible style NFSv2/v3/v4 file handle.
41 * by Neil Brown <neilb@cse.unsw.edu.au> - March 2000 35 * by Neil Brown <neilb@cse.unsw.edu.au> - March 2000
42 * 36 *
43 * The file handle starts with a sequence of four-byte words. 37 * The file handle starts with a sequence of four-byte words.
@@ -47,14 +41,7 @@ struct nfs_fhbase_old {
47 * 41 *
48 * All four-byte values are in host-byte-order. 42 * All four-byte values are in host-byte-order.
49 * 43 *
50 * The auth_type field specifies how the filehandle can be authenticated 44 * The auth_type field is deprecated and must be set to 0.
51 * This might allow a file to be confirmed to be in a writable part of a
52 * filetree without checking the path from it up to the root.
53 * Current values:
54 * 0 - No authentication. fb_auth is 0 bytes long
55 * Possible future values:
56 * 1 - 4 bytes taken from MD5 hash of the remainer of the file handle
57 * prefixed by a secret and with the important export flags.
58 * 45 *
59 * The fsid_type identifies how the filesystem (or export point) is 46 * The fsid_type identifies how the filesystem (or export point) is
60 * encoded. 47 * encoded.
@@ -71,14 +58,9 @@ struct nfs_fhbase_old {
71 * 7 - 8 byte inode number and 16 byte uuid 58 * 7 - 8 byte inode number and 16 byte uuid
72 * 59 *
73 * The fileid_type identified how the file within the filesystem is encoded. 60 * The fileid_type identified how the file within the filesystem is encoded.
74 * This is (will be) passed to, and set by, the underlying filesystem if it supports 61 * The values for this field are filesystem specific, exccept that
75 * filehandle operations. The filesystem must not use the value '0' or '0xff' and may 62 * filesystems must not use the values '0' or '0xff'. 'See enum fid_type'
76 * only use the values 1 and 2 as defined below: 63 * in include/linux/exportfs.h for currently registered values.
77 * Current values:
78 * 0 - The root, or export point, of the filesystem. fb_fileid is 0 bytes.
79 * 1 - 32bit inode number, 32 bit generation number.
80 * 2 - 32bit inode number, 32 bit generation number, 32 bit parent directory inode number.
81 *
82 */ 64 */
83struct nfs_fhbase_new { 65struct nfs_fhbase_new {
84 __u8 fb_version; /* == 1, even => nfs_fhbase_old */ 66 __u8 fb_version; /* == 1, even => nfs_fhbase_old */
@@ -114,9 +96,9 @@ struct knfsd_fh {
114#define fh_fsid_type fh_base.fh_new.fb_fsid_type 96#define fh_fsid_type fh_base.fh_new.fb_fsid_type
115#define fh_auth_type fh_base.fh_new.fb_auth_type 97#define fh_auth_type fh_base.fh_new.fb_auth_type
116#define fh_fileid_type fh_base.fh_new.fb_fileid_type 98#define fh_fileid_type fh_base.fh_new.fb_fileid_type
117#define fh_auth fh_base.fh_new.fb_auth
118#define fh_fsid fh_base.fh_new.fb_auth 99#define fh_fsid fh_base.fh_new.fb_auth
119 100
120 101/* Do not use, provided for userspace compatiblity. */
102#define fh_auth fh_base.fh_new.fb_auth
121 103
122#endif /* _UAPI_LINUX_NFSD_FH_H */ 104#endif /* _UAPI_LINUX_NFSD_FH_H */