nfs-utils/nfs-utils-1.0.9-mount-sloppy.patch

125 lines
3.4 KiB
Diff
Raw Normal View History

--- nfs-utils-1.0.9/utils/mount/nfs4mount.c.sloppy 2006-09-20 12:08:39.000000000 +0200
+++ nfs-utils-1.0.9/utils/mount/nfs4mount.c 2006-09-20 12:08:39.000000000 +0200
@@ -50,6 +50,7 @@
#endif
extern int verbose;
+extern int sloppy;
char *IDMAPLCK = DEFAULT_DIR "/rpcidmapd";
#define idmapd_check() do { \
@@ -338,7 +339,7 @@
nocto = !val;
else if (!strcmp(opt, "ac"))
noac = !val;
- else {
+ else if (!sloppy) {
printf(_("unknown nfs mount option: "
"%s%s\n"), val ? "" : "no", opt);
goto fail;
--- nfs-utils-1.0.9/utils/mount/mount.c.sloppy 2006-09-20 12:08:39.000000000 +0200
+++ nfs-utils-1.0.9/utils/mount/mount.c 2006-09-20 12:10:31.000000000 +0200
@@ -44,6 +44,7 @@
int nomtab;
int verbose;
int mounttype;
+int sloppy;
static struct option longopts[] = {
{ "fake", 0, 0, 'f' },
@@ -239,6 +240,7 @@
printf("\t-w\t\tMount file system read-write\n");
printf("\t-f\t\tFake mount, don't actually mount\n");
printf("\t-n\t\tDo not update /etc/mtab\n");
+ printf("\t-s\t\tTolerate sloppy mount options rather than failing.\n");
printf("\t-h\t\tPrint this help\n");
printf("\tversion\t\tnfs4 - NFS version 4, nfs - older NFS version supported\n");
printf("\tnfsoptions\tRefer mount.nfs(8) or nfs(5)\n\n");
@@ -373,7 +375,7 @@
return 0;
}
- while ((c = getopt_long (argc - 2, argv + 2, "rt:vVwfno:h",
+ while ((c = getopt_long (argc - 2, argv + 2, "rt:vVwfno:hs",
longopts, NULL)) != -1) {
switch (c) {
case 'r':
@@ -403,6 +405,9 @@
else
mount_opts = xstrdup(optarg);
break;
+ case 's':
+ ++sloppy;
+ break;
case 128: /* bind */
mounttype = MS_BIND;
break;
--- nfs-utils-1.0.9/utils/mount/nfsmount.c.sloppy 2006-09-20 12:08:39.000000000 +0200
+++ nfs-utils-1.0.9/utils/mount/nfsmount.c 2006-09-20 12:08:39.000000000 +0200
@@ -104,6 +104,7 @@
static char errbuf[BUFSIZ];
static char *erreob = &errbuf[BUFSIZ];
extern int verbose;
+extern int sloppy;
/* Convert RPC errors into strings */
int rpc_strerror(int);
@@ -606,13 +607,13 @@
} else if (!strcmp(opt, "namlen")) {
if (nfs_mount_version >= 2)
data->namlen = val;
- else
+ else if (!sloppy)
goto bad_parameter;
#endif
} else if (!strcmp(opt, "addr")) {
/* ignore */;
continue;
- } else
+ } else if (!sloppy)
goto bad_parameter;
sprintf(cbuf, "%s=%s,", opt, opteq+1);
} else if (opteq) {
@@ -629,7 +630,7 @@
mnt_pmap->pm_prot = IPPROTO_TCP;
data->flags |= NFS_MOUNT_TCP;
#endif
- } else
+ } else if (!sloppy)
goto bad_parameter;
#if NFS_MOUNT_VERSION >= 5
} else if (!strcmp(opt, "sec")) {
@@ -658,7 +659,7 @@
data->pseudoflavor = AUTH_GSS_SPKMI;
else if (!strcmp(secflavor, "spkm3p"))
data->pseudoflavor = AUTH_GSS_SPKMP;
- else {
+ else if (!sloppy) {
printf(_("Warning: Unrecognized security flavor %s.\n"),
secflavor);
goto bad_parameter;
@@ -677,7 +678,7 @@
goto bad_parameter;
}
strncpy(data->context, context, NFS_MAX_CONTEXT_LEN);
- } else
+ } else if (!sloppy)
goto bad_parameter;
sprintf(cbuf, "%s=%s,", opt, opteq+1);
} else {
@@ -768,9 +769,11 @@
#endif
} else {
bad_option:
- printf(_("Unsupported nfs mount option: "
- "%s%s\n"), val ? "" : "no", opt);
- goto out_bad;
+ if (!sloppy) {
+ printf(_("Unsupported nfs mount option: "
+ "%s%s\n"), val ? "" : "no", opt);
+ goto out_bad;
+ }
}
sprintf(cbuf, val ? "%s,":"no%s,", opt);
}