]> git.pld-linux.org Git - packages/nfs-utils.git/blame - nfs-utils-CITI_NFS4.patch
- updated to latest patchset
[packages/nfs-utils.git] / nfs-utils-CITI_NFS4.patch
CommitLineData
97cc26d8
JB
1
2
14bcaf3a 3The complete set of CITI nfs-utils patches rolled into one patch.
97cc26d8 4
14bcaf3a 5Changes since 1.0.11-CITI_NFS4_ALL-1:
97cc26d8 6
14bcaf3a 7 * Update to nfs-utils-1.1.0
71f23813 8
14bcaf3a
JR
9 * Include patches from git not yet in a release:
10 - Fix mount error messages
71f23813 11
14bcaf3a 12 * Update gssd usage message to include new -n option.
97cc26d8 13
14bcaf3a
JR
14 * Patches from Bruce Fields to clean up compile warning, and
15 move pseudoflavor code to a common location
97cc26d8 16
14bcaf3a
JR
17 * Patch from Bruce Fields and Fred Isaman that adds support
18 to exportfs for reading a sec= option and sending server
19 security data through cache via
20 "... secinfo n flavor1 flag1 ... flavorN flagN".
97cc26d8
JB
21
22
23---
24
14bcaf3a
JR
25 nfs-utils-1.1.0-kwc/support/include/nfslib.h | 10 +
26 nfs-utils-1.1.0-kwc/support/include/pseudoflavors.h | 17 ++
27 nfs-utils-1.1.0-kwc/support/nfs/exports.c | 158 ++++++++++++++++++--
28 nfs-utils-1.1.0-kwc/utils/exportfs/exportfs.c | 1
29 nfs-utils-1.1.0-kwc/utils/gssd/gssd.c | 2
30 nfs-utils-1.1.0-kwc/utils/mount/mount.c | 40 ++++-
31 nfs-utils-1.1.0-kwc/utils/mount/nfs4_mount.h | 12 -
32 nfs-utils-1.1.0-kwc/utils/mount/nfs4mount.c | 27 ---
33 nfs-utils-1.1.0-kwc/utils/mountd/cache.c | 21 ++
34 10 files changed, 240 insertions(+), 49 deletions(-)
97cc26d8 35
14bcaf3a
JR
36diff -puN utils/mount/mount.c~CITI_NFS4_ALL utils/mount/mount.c
37--- nfs-utils-1.1.0/utils/mount/mount.c~CITI_NFS4_ALL 2007-06-22 10:51:38.885022000 -0400
38+++ nfs-utils-1.1.0-kwc/utils/mount/mount.c 2007-06-22 10:52:04.954241000 -0400
39@@ -285,22 +285,49 @@ static void parse_opts (const char *opti
40 }
41 }
97cc26d8 42
14bcaf3a
JR
43-static void mount_error(char *node)
44+static void mount_error(char *mntpnt, char *node)
45 {
46 switch(errno) {
47 case ENOTDIR:
48- fprintf(stderr, "%s: mount point %s is not a directory\n", progname, node);
49+ fprintf(stderr, "%s: mount point %s is not a directory\n",
50+ progname, mntpnt);
51 break;
52 case EBUSY:
53- fprintf(stderr, "%s: %s is already mounted or busy\n", progname, node);
54+ fprintf(stderr, "%s: %s is already mounted or busy\n",
55+ progname, mntpnt);
56 break;
57 case ENOENT:
58- fprintf(stderr, "%s: mount point %s does not exist\n", progname, node);
59+ if (node) {
60+ fprintf(stderr, "%s: %s failed, reason given by server: %s\n",
61+ progname, node, strerror(errno));
62+ } else
63+ fprintf(stderr, "%s: mount point %s does not exist\n",
64+ progname, mntpnt);
65 break;
66 default:
67 fprintf(stderr, "%s: %s\n", progname, strerror(errno));
68 }
69 }
70+static int chk_mountpoint(char *mount_point)
71+{
72+ struct stat sb;
97cc26d8 73+
14bcaf3a
JR
74+ if (stat(mount_point, &sb) < 0){
75+ mount_error(mount_point, NULL);
76+ return 1;
77+ }
78+ if (S_ISDIR(sb.st_mode) == 0){
79+ errno = ENOTDIR;
80+ mount_error(mount_point, NULL);
81+ return 1;
82+ }
83+ if (access(mount_point, X_OK) < 0) {
84+ mount_error(mount_point, NULL);
85+ return 1;
86+ }
87+
88+ return 0;
89+}
71f23813 90
14bcaf3a
JR
91 extern u_short getport(
92 struct sockaddr_in *saddr,
93@@ -508,6 +535,9 @@ int main(int argc, char *argv[])
94 }
95 }
97cc26d8 96
14bcaf3a
JR
97+ if (chk_mountpoint(mount_point))
98+ exit(EX_FAIL);
99+
100 if (nfs_mount_vers == 4)
101 mnt_err = nfs4mount(spec, mount_point, &flags, &extra_opts, &mount_opts, 0);
102 else {
103@@ -538,7 +568,7 @@ int main(int argc, char *argv[])
104 mount_opts);
105
106 if (mnt_err) {
107- mount_error(mount_point);
108+ mount_error(mount_point, spec);
109 exit(EX_FAIL);
110 }
111 }
112diff -puN utils/gssd/gssd.c~CITI_NFS4_ALL utils/gssd/gssd.c
113--- nfs-utils-1.1.0/utils/gssd/gssd.c~CITI_NFS4_ALL 2007-06-22 10:51:53.782368000 -0400
114+++ nfs-utils-1.1.0-kwc/utils/gssd/gssd.c 2007-06-22 10:51:56.521019000 -0400
115@@ -81,7 +81,7 @@ sig_hup(int signal)
116 static void
117 usage(char *progname)
118 {
119- fprintf(stderr, "usage: %s [-f] [-n] [-v] [-r] [-p pipefsdir] [-k keytab] [-d ccachedir]\n",
120+ fprintf(stderr, "usage: %s [-f] [-M] [-n] [-v] [-r] [-p pipefsdir] [-k keytab] [-d ccachedir]\n",
121 progname);
122 exit(1);
123 }
124diff -puN /dev/null support/include/pseudoflavors.h
125--- /dev/null 2007-06-21 19:03:53.875366737 -0400
126+++ nfs-utils-1.1.0-kwc/support/include/pseudoflavors.h 2007-06-22 10:52:22.335293000 -0400
127@@ -0,0 +1,17 @@
128+#define RPC_AUTH_GSS_KRB5 390003
129+#define RPC_AUTH_GSS_KRB5I 390004
130+#define RPC_AUTH_GSS_KRB5P 390005
131+#define RPC_AUTH_GSS_LKEY 390006
132+#define RPC_AUTH_GSS_LKEYI 390007
133+#define RPC_AUTH_GSS_LKEYP 390008
134+#define RPC_AUTH_GSS_SPKM 390009
135+#define RPC_AUTH_GSS_SPKMI 390010
136+#define RPC_AUTH_GSS_SPKMP 390011
137+
138+struct flav_info {
139+ char *flavour;
140+ int fnum;
141+};
142+
143+extern struct flav_info flav_map[];
144+extern const int flav_map_size;
145diff -puN support/nfs/exports.c~CITI_NFS4_ALL support/nfs/exports.c
146--- nfs-utils-1.1.0/support/nfs/exports.c~CITI_NFS4_ALL 2007-06-22 10:52:16.682999000 -0400
147+++ nfs-utils-1.1.0-kwc/support/nfs/exports.c 2007-06-22 10:52:40.578175000 -0400
148@@ -30,10 +30,29 @@
149 #include "xmalloc.h"
150 #include "xlog.h"
151 #include "xio.h"
152+#include "pseudoflavors.h"
153
154 #define EXPORT_DEFAULT_FLAGS \
155 (NFSEXP_READONLY|NFSEXP_ROOTSQUASH|NFSEXP_GATHERED_WRITES|NFSEXP_NOSUBTREECHECK)
156
157+struct flav_info flav_map[] = {
158+ { "krb5", RPC_AUTH_GSS_KRB5 },
159+ { "krb5i", RPC_AUTH_GSS_KRB5I },
160+ { "krb5p", RPC_AUTH_GSS_KRB5P },
161+ { "lipkey", RPC_AUTH_GSS_LKEY },
162+ { "lipkey-i", RPC_AUTH_GSS_LKEYI },
163+ { "lipkey-p", RPC_AUTH_GSS_LKEYP },
164+ { "spkm3", RPC_AUTH_GSS_SPKM },
165+ { "spkm3i", RPC_AUTH_GSS_SPKMI },
166+ { "spkm3p", RPC_AUTH_GSS_SPKMP },
167+ { "unix", AUTH_UNIX },
168+ { "sys", AUTH_SYS },
169+ { "null", AUTH_NULL },
170+ { "none", AUTH_NONE },
171+};
172+
173+const int flav_map_size = sizeof(flav_map)/sizeof(flav_map[0]);
174+
175 int export_errno;
176
177 static char *efname = NULL;
178@@ -100,6 +119,7 @@ getexportent(int fromkernel, int fromexp
97cc26d8
JB
179 def_ee.e_mountpoint = NULL;
180 def_ee.e_fslocmethod = FSLOC_NONE;
181 def_ee.e_fslocdata = NULL;
14bcaf3a 182+ def_ee.e_secinfo[0].flav = NULL;
97cc26d8
JB
183 def_ee.e_nsquids = 0;
184 def_ee.e_nsqgids = 0;
185
14bcaf3a
JR
186@@ -179,6 +199,27 @@ getexportent(int fromkernel, int fromexp
187 return &ee;
97cc26d8
JB
188 }
189
14bcaf3a 190+void secinfo_show(FILE *fp, struct exportent *ep)
97cc26d8 191+{
14bcaf3a
JR
192+ struct sec_entry *p1, *p2;
193+ int flags;
194+
195+ for (p1=ep->e_secinfo; p1->flav; p1=p2) {
196+
197+ fprintf(fp, ",sec=%s", p1->flav->flavour);
198+ for (p2=p1+1; (p2->flav != NULL) && (p1->flags == p2->flags);
199+ p2++) {
200+ fprintf(fp, ":%s", p2->flav->flavour);
97cc26d8 201+ }
14bcaf3a
JR
202+ flags = p1->flags;
203+ fprintf(fp, ",%s", (flags & NFSEXP_READONLY) ? "ro" : "rw");
204+ fprintf(fp, ",%sroot_squash", (flags & NFSEXP_ROOTSQUASH)?
205+ "" : "no_");
206+ fprintf(fp, ",%sall_squash", (flags & NFSEXP_ALLSQUASH)?
207+ "" : "no_");
97cc26d8
JB
208+ }
209+}
210+
14bcaf3a 211 void
97cc26d8
JB
212 putexportent(struct exportent *ep)
213 {
14bcaf3a 214@@ -259,7 +300,9 @@ putexportent(struct exportent *ep)
97cc26d8
JB
215 else
216 fprintf(fp, "%d,", id[i]);
217 }
218- fprintf(fp, "anonuid=%d,anongid=%d)\n", ep->e_anonuid, ep->e_anongid);
219+ fprintf(fp, "anonuid=%d,anongid=%d", ep->e_anonuid, ep->e_anongid);
220+ secinfo_show(fp, ep);
221+ fprintf(fp, ")\n");
222 }
223
224 void
14bcaf3a 225@@ -307,6 +350,7 @@ mkexportent(char *hname, char *path, cha
97cc26d8
JB
226 ee.e_mountpoint = NULL;
227 ee.e_fslocmethod = FSLOC_NONE;
228 ee.e_fslocdata = NULL;
14bcaf3a 229+ ee.e_secinfo[0].flav = NULL;
97cc26d8
JB
230 ee.e_nsquids = 0;
231 ee.e_nsqgids = 0;
232 ee.e_uuid = NULL;
14bcaf3a 233@@ -350,18 +394,110 @@ static int valid_uuid(char *uuid)
97cc26d8
JB
234 }
235
14bcaf3a
JR
236 /*
237+ * Append the given flavor to the exportent's e_secinfo array, or
238+ * do nothing if it's already there. Returns the index of flavor
239+ * in the resulting array in any case.
240+ */
241+static int secinfo_addflavor(struct flav_info *flav, struct exportent *ep)
97cc26d8 242+{
14bcaf3a
JR
243+ struct sec_entry *p;
244+
245+ for (p=ep->e_secinfo; p->flav; p++) {
246+ if (p->flav == flav)
247+ return p - ep->e_secinfo;
97cc26d8 248+ }
14bcaf3a
JR
249+ if (p - ep->e_secinfo >= SECFLAVOR_COUNT) {
250+ xlog(L_ERROR, "more than %d security flavors on an export\n",
251+ SECFLAVOR_COUNT);
252+ return -1;
253+ }
254+ p->flav = flav;
255+ p->flags = ep->e_flags;
256+ (p+1)->flav = NULL;
257+ return p - ep->e_secinfo;
97cc26d8
JB
258+}
259+
14bcaf3a 260+static struct flav_info *find_flavor(char *name)
97cc26d8 261+{
14bcaf3a
JR
262+ struct flav_info *flav;
263+ for (flav = flav_map; flav < flav_map + flav_map_size; flav++)
264+ if (strcmp(flav->flavour, name) == 0)
265+ return flav;
266+ return NULL;
97cc26d8
JB
267+}
268+
269+/* @str is a colon seperated list of security flavors. Their order
270+ * is recorded in @ep, and a bitmap corresponding to the list is returned.
271+ * A zero return indicates an error.
272+ */
14bcaf3a 273+static unsigned int parse_flavors(char *str, struct exportent *ep)
97cc26d8
JB
274+{
275+ unsigned int out=0;
276+ char *flavor;
14bcaf3a 277+ int bit;
97cc26d8
JB
278+
279+ while ( (flavor=strsep(&str, ":")) ) {
14bcaf3a
JR
280+ struct flav_info *flav = find_flavor(flavor);
281+ if (flav == NULL) {
97cc26d8
JB
282+ xlog(L_ERROR, "unknown flavor %s\n", flavor);
283+ return 0;
284+ }
14bcaf3a
JR
285+ bit = secinfo_addflavor(flav, ep);
286+ if (bit < 0)
287+ return 0;
97cc26d8 288+ out |= 1<<bit;
97cc26d8
JB
289+ }
290+ return out;
291+}
292+
97cc26d8 293+/* Sets the bits in @mask for the appropriate security flavor flags. */
14bcaf3a 294+static void setflags(int mask, unsigned int active, struct exportent *ep)
97cc26d8 295+{
14bcaf3a
JR
296+ int bit=0;
297+
298+ ep->e_flags |= mask;
299+
97cc26d8
JB
300+ while (active) {
301+ if (active & 1)
14bcaf3a
JR
302+ ep->e_secinfo[bit].flags |= mask;
303+ bit++;
97cc26d8
JB
304+ active >>= 1;
305+ }
306+}
307+
308+/* Clears the bits in @mask for the appropriate security flavor flags. */
14bcaf3a 309+static void clearflags(int mask, unsigned int active, struct exportent *ep)
97cc26d8 310+{
14bcaf3a
JR
311+ int bit=0;
312+
313+ ep->e_flags &= ~mask;
314+
97cc26d8
JB
315+ while (active) {
316+ if (active & 1)
14bcaf3a
JR
317+ ep->e_secinfo[bit].flags &= ~mask;
318+ bit++;
97cc26d8
JB
319+ active >>= 1;
320+ }
321+}
97cc26d8 322+
14bcaf3a
JR
323+/* options that can vary per flavor: */
324+#define NFSEXP_SECINFO_FLAGS (NFSEXP_READONLY | NFSEXP_ROOTSQUASH \
325+ | NFSEXP_ALLSQUASH)
326+
327+/*
328 * Parse option string pointed to by cp and set mount options accordingly.
329 */
330 static int
331 parseopts(char *cp, struct exportent *ep, int warn, int *had_subtree_opt_ptr)
97cc26d8 332 {
14bcaf3a
JR
333+ struct sec_entry *p;
334 int had_subtree_opt = 0;
335 char *flname = efname?efname:"command line";
336 int flline = efp?efp->x_line:0;
337+ unsigned int active = 0;
97cc26d8 338
14bcaf3a
JR
339 squids = ep->e_squids; nsquids = ep->e_nsquids;
340 sqgids = ep->e_sqgids; nsqgids = ep->e_nsqgids;
341-
342 if (!cp)
343 goto out;
97cc26d8 344
14bcaf3a 345@@ -380,9 +516,9 @@ parseopts(char *cp, struct exportent *ep
97cc26d8 346
14bcaf3a
JR
347 /* process keyword */
348 if (strcmp(opt, "ro") == 0)
349- ep->e_flags |= NFSEXP_READONLY;
350+ setflags(NFSEXP_READONLY, active, ep);
351 else if (strcmp(opt, "rw") == 0)
352- ep->e_flags &= ~NFSEXP_READONLY;
353+ clearflags(NFSEXP_READONLY, active, ep);
354 else if (!strcmp(opt, "secure"))
355 ep->e_flags &= ~NFSEXP_INSECURE_PORT;
356 else if (!strcmp(opt, "insecure"))
357@@ -404,13 +540,13 @@ parseopts(char *cp, struct exportent *ep
358 else if (!strcmp(opt, "no_wdelay"))
359 ep->e_flags &= ~NFSEXP_GATHERED_WRITES;
360 else if (strcmp(opt, "root_squash") == 0)
361- ep->e_flags |= NFSEXP_ROOTSQUASH;
362+ setflags(NFSEXP_ROOTSQUASH, active, ep);
363 else if (!strcmp(opt, "no_root_squash"))
364- ep->e_flags &= ~NFSEXP_ROOTSQUASH;
365+ clearflags(NFSEXP_ROOTSQUASH, active, ep);
366 else if (strcmp(opt, "all_squash") == 0)
367- ep->e_flags |= NFSEXP_ALLSQUASH;
368+ setflags(NFSEXP_ALLSQUASH, active, ep);
369 else if (strcmp(opt, "no_all_squash") == 0)
370- ep->e_flags &= ~NFSEXP_ALLSQUASH;
371+ clearflags(NFSEXP_ALLSQUASH, active, ep);
372 else if (strcmp(opt, "subtree_check") == 0) {
373 had_subtree_opt = 1;
374 ep->e_flags &= ~NFSEXP_NOSUBTREECHECK;
375@@ -498,6 +634,10 @@ bad_option:
376 } else if (strncmp(opt, "replicas=", 9) == 0) {
377 ep->e_fslocmethod = FSLOC_REPLICA;
378 ep->e_fslocdata = strdup(opt+9);
379+ } else if (strncmp(opt, "sec=", 4) == 0) {
380+ active = parse_flavors(opt+4, ep);
381+ if (!active)
382+ goto bad_option;
383 } else {
384 xlog(L_ERROR, "%s:%d: unknown keyword \"%s\"\n",
385 flname, flline, opt);
386@@ -509,6 +649,8 @@ bad_option:
387 cp++;
388 }
97cc26d8 389
14bcaf3a
JR
390+ for (p = ep->e_secinfo; p->flav; p++)
391+ p->flags |= ep->e_flags & ~NFSEXP_SECINFO_FLAGS;
392 ep->e_squids = squids;
393 ep->e_sqgids = sqgids;
394 ep->e_nsquids = nsquids;
395diff -puN utils/mount/nfs4mount.c~CITI_NFS4_ALL utils/mount/nfs4mount.c
396--- nfs-utils-1.1.0/utils/mount/nfs4mount.c~CITI_NFS4_ALL 2007-06-22 10:52:18.413097000 -0400
397+++ nfs-utils-1.1.0-kwc/utils/mount/nfs4mount.c 2007-06-22 10:52:25.846889000 -0400
398@@ -36,6 +36,7 @@
399 #define nfsstat nfs_stat
97cc26d8 400 #endif
97cc26d8 401
14bcaf3a
JR
402+#include "pseudoflavors.h"
403 #include "nls.h"
404 #include "conn.h"
405 #include "xcommon.h"
406@@ -71,26 +72,6 @@ char *GSSDLCK = DEFAULT_DIR "/rpcgssd";
407 #define NFS_PORT 2049
408 #endif
97cc26d8 409
14bcaf3a
JR
410-struct {
411- char *flavour;
412- int fnum;
413-} flav_map[] = {
414- { "krb5", RPC_AUTH_GSS_KRB5 },
415- { "krb5i", RPC_AUTH_GSS_KRB5I },
416- { "krb5p", RPC_AUTH_GSS_KRB5P },
417- { "lipkey", RPC_AUTH_GSS_LKEY },
418- { "lipkey-i", RPC_AUTH_GSS_LKEYI },
419- { "lipkey-p", RPC_AUTH_GSS_LKEYP },
420- { "spkm3", RPC_AUTH_GSS_SPKM },
421- { "spkm3i", RPC_AUTH_GSS_SPKMI },
422- { "spkm3p", RPC_AUTH_GSS_SPKMP },
423- { "unix", AUTH_UNIX },
424- { "sys", AUTH_SYS },
425- { "null", AUTH_NULL },
426- { "none", AUTH_NONE },
427-};
428-
429-#define FMAPSIZE (sizeof(flav_map)/sizeof(flav_map[0]))
430 #define MAX_USER_FLAVOUR 16
97cc26d8 431
14bcaf3a
JR
432 static int parse_sec(char *sec, int *pseudoflavour)
433@@ -104,13 +85,13 @@ static int parse_sec(char *sec, int *pse
434 "exceeded\n"));
435 return 0;
436 }
437- for (i = 0; i < FMAPSIZE; i++) {
438+ for (i = 0; i < flav_map_size; i++) {
439 if (strcmp(sec, flav_map[i].flavour) == 0) {
440 pseudoflavour[num_flavour++] = flav_map[i].fnum;
441 break;
442 }
443 }
444- if (i == FMAPSIZE) {
445+ if (i == flav_map_size) {
446 fprintf(stderr,
447 _("mount: unknown security type %s\n"), sec);
448 return 0;
449@@ -399,7 +380,7 @@ int nfs4mount(const char *spec, const ch
450
451 printf("sec = ");
452 for (pf_cnt = 0; pf_cnt < num_flavour; pf_cnt++) {
453- for (i = 0; i < FMAPSIZE; i++) {
454+ for (i = 0; i < flav_map_size; i++) {
455 if (flav_map[i].fnum == pseudoflavour[pf_cnt]) {
456 printf("%s", flav_map[i].flavour);
457 break;
458diff -puN utils/mount/nfs4_mount.h~CITI_NFS4_ALL utils/mount/nfs4_mount.h
459--- nfs-utils-1.1.0/utils/mount/nfs4_mount.h~CITI_NFS4_ALL 2007-06-22 10:52:21.626744000 -0400
460+++ nfs-utils-1.1.0-kwc/utils/mount/nfs4_mount.h 2007-06-22 10:52:24.715391000 -0400
461@@ -67,18 +67,6 @@ struct nfs4_mount_data {
462 #define NFS4_MOUNT_STRICTLOCK 0x1000 /* 1 */
463 #define NFS4_MOUNT_FLAGMASK 0xFFFF
464
465-/* pseudoflavors: */
466-
467-#define RPC_AUTH_GSS_KRB5 390003
468-#define RPC_AUTH_GSS_KRB5I 390004
469-#define RPC_AUTH_GSS_KRB5P 390005
470-#define RPC_AUTH_GSS_LKEY 390006
471-#define RPC_AUTH_GSS_LKEYI 390007
472-#define RPC_AUTH_GSS_LKEYP 390008
473-#define RPC_AUTH_GSS_SPKM 390009
474-#define RPC_AUTH_GSS_SPKMI 390010
475-#define RPC_AUTH_GSS_SPKMP 390011
476-
477 int nfs4mount(const char *, const char *, int *, char **,
478 char **, int);
97cc26d8 479
14bcaf3a
JR
480diff -puN support/include/nfslib.h~CITI_NFS4_ALL support/include/nfslib.h
481--- nfs-utils-1.1.0/support/include/nfslib.h~CITI_NFS4_ALL 2007-06-22 10:52:31.311234000 -0400
482+++ nfs-utils-1.1.0-kwc/support/include/nfslib.h 2007-06-22 10:52:39.718626000 -0400
483@@ -51,6 +51,14 @@
484 #define _PATH_PROC_EXPORTS_ALT "/proc/fs/nfsd/exports"
97cc26d8 485 #endif
97cc26d8 486
14bcaf3a
JR
487+/* Maximum number of security flavors on an export: */
488+#define SECFLAVOR_COUNT 8
97cc26d8 489+
14bcaf3a
JR
490+struct sec_entry {
491+ struct flav_info *flav;
492+ int flags;
97cc26d8
JB
493+};
494+
97cc26d8 495 /*
14bcaf3a
JR
496 * Data related to a single exports entry as returned by getexportent.
497 * FIXME: export options should probably be parsed at a later time to
498@@ -76,6 +84,7 @@ struct exportent {
499 int e_fslocmethod;
500 char * e_fslocdata;
501 char * e_uuid;
502+ struct sec_entry e_secinfo[SECFLAVOR_COUNT+1];
503 };
97cc26d8 504
14bcaf3a
JR
505 struct rmtabent {
506@@ -89,6 +98,7 @@ struct rmtabent {
507 */
508 void setexportent(char *fname, char *type);
509 struct exportent * getexportent(int,int);
510+void secinfo_show(FILE *fp, struct exportent *ep);
511 void putexportent(struct exportent *xep);
512 void endexportent(void);
513 struct exportent * mkexportent(char *hname, char *path, char *opts);
514diff -puN utils/exportfs/exportfs.c~CITI_NFS4_ALL utils/exportfs/exportfs.c
515--- nfs-utils-1.1.0/utils/exportfs/exportfs.c~CITI_NFS4_ALL 2007-06-22 10:52:33.386332000 -0400
516+++ nfs-utils-1.1.0-kwc/utils/exportfs/exportfs.c 2007-06-22 10:52:40.698175000 -0400
517@@ -515,6 +515,7 @@ dump(int verbose)
518 break;
519 #endif
520 }
521+ secinfo_show(stdout, ep);
522 printf("%c\n", (c != '(')? ')' : ' ');
523 }
524 }
525diff -puN utils/mountd/cache.c~CITI_NFS4_ALL utils/mountd/cache.c
526--- nfs-utils-1.1.0/utils/mountd/cache.c~CITI_NFS4_ALL 2007-06-22 10:52:38.862018000 -0400
527+++ nfs-utils-1.1.0-kwc/utils/mountd/cache.c 2007-06-22 10:52:40.837142000 -0400
528@@ -30,6 +30,7 @@
529 #include "mountd.h"
530 #include "xmalloc.h"
531 #include "fsloc.h"
532+#include "pseudoflavors.h"
533
534 #ifdef USE_BLKID
535 #include "blkid/blkid.h"
536@@ -518,6 +519,25 @@ static void write_fsloc(FILE *f, struct
537 release_replicas(servers);
97cc26d8
JB
538 }
539
14bcaf3a 540+static void write_secinfo(FILE *f, struct exportent *ep)
97cc26d8 541+{
14bcaf3a 542+ struct sec_entry *p;
97cc26d8 543+
14bcaf3a
JR
544+ for (p = ep->e_secinfo; p->flav; p++)
545+ ; /* Do nothing */
546+ if (p == ep->e_secinfo) {
547+ /* There was no sec= option */
548+ return;
97cc26d8 549+ }
14bcaf3a
JR
550+ qword_print(f, "secinfo");
551+ qword_printint(f, p - ep->e_secinfo);
552+ for (p = ep->e_secinfo; p->flav; p++) {
553+ qword_printint(f, p->flav->fnum);
554+ qword_printint(f, p->flags);
97cc26d8
JB
555+ }
556+
97cc26d8
JB
557+}
558+
14bcaf3a 559 static int dump_to_cache(FILE *f, char *domain, char *path, struct exportent *exp)
97cc26d8 560 {
14bcaf3a
JR
561 qword_print(f, domain);
562@@ -529,6 +549,7 @@ static int dump_to_cache(FILE *f, char *
563 qword_printint(f, exp->e_anongid);
564 qword_printint(f, exp->e_fsid);
565 write_fsloc(f, exp, path);
566+ write_secinfo(f, exp);
567 #if USE_BLKID
568 if (exp->e_uuid == NULL) {
569 char u[16];
570
571_
This page took 0.172793 seconds and 4 git commands to generate.