- From 882cfbf5ce78c7a5dac7ba967ee9fd39d615a134 Mon Sep 17 00:00:00 2001
- From: Roland Mainz <roland.mainz@nrubsig.org>
- Date: Fri, 22 Sep 2023 12:26:54 +0200
- Subject: [PATCH] nfs_mount should support the -t/-F filesystem type options
- nfs_mount.exe should support the Linux -t / SystemV/Solaris/Illumos -F
- filesystem type options.
- Right now this is intended for compatibility with Solaris/Illumos
- $ mount -F nfs ... # or Linux $ mount -t nfs # options and as a
- placeholder to avoid admin confusion, but can later be used to
- enable/disable other things.
- In the future nfs_mount.exe can then also be used as "mount helper",
- i.e. /sbin/mount -t foo calls /sbin/mount.foo to handle filesystems
- of type "foo" (in our case "nfs4").
- Signed-off-by: Cedric Blancher <cedric.blancher@gmail.com>
- ---
- mount/mount.c | 31 +++++++++++++++++++++++++++++++
- 1 file changed, 31 insertions(+)
- diff --git a/mount/mount.c b/mount/mount.c
- index 6d8c8ee..0e57e64 100644
- --- a/mount/mount.c
- +++ b/mount/mount.c
- @@ -57,6 +57,10 @@ static VOID PrintUsage(LPTSTR pProcess)
- TEXT("\t-h\thelp\n")
- TEXT("\t-d\tunmount\n")
- TEXT("\t-f\tforce unmount if the drive is in use\n")
- + TEXT("\t-F <type>\tFilesystem type to use (only 'nfs' supported)"
- + " (Solaris/Illumos compat)\n")
- + TEXT("\t-t <type>\tFilesystem type to use (only 'nfs' supported)"
- + " (Linux compat)\n")
- TEXT("\t-p\tmake the mount persist over reboots\n")
- TEXT("\t-o <comma-separated mount options>\n")
- TEXT("Mount options:\n")
- @@ -136,6 +140,33 @@ DWORD __cdecl _tmain(DWORD argc, LPTSTR argv[])
- goto out_free;
- }
- }
- + /*
- + * Filesystem type, we use this for Solaris
- + * $ mount(1M) -F nfs ... # and Linux
- + * $ mount.nfs4 -t nfs ... # compatiblity
- + */
- + else if ((_tcscmp(argv[i], TEXT("-F")) == 0) ||
- + (_tcscmp(argv[i], TEXT("-t")) == 0))
- + {
- + ++i;
- + if (i >= argc)
- + {
- + result = ERROR_BAD_ARGUMENTS;
- + _ftprintf(stderr, TEXT("Filesystem type missing ")
- + TEXT("after '-t'/'-F'.\n\n"));
- + PrintUsage(argv[0]);
- + goto out_free;
- + }
- +
- + if (_tcscmp(argv[i], TEXT("nfs")) != 0)
- + {
- + result = ERROR_BAD_ARGUMENTS;
- + _ftprintf(stderr, TEXT("Filesystem type '%s' ")
- + TEXT("not supported.\n\n"), argv[i]);
- + PrintUsage(argv[0]);
- + goto out_free;
- + }
- + }
- else
- _ftprintf(stderr, TEXT("Unrecognized option ")
- TEXT("'%s', disregarding.\n"), argv[i]);
- --
- 2.39.0
msnfs41client: nfs_mount -t/-F patch
Posted by Anonymous on Fri 22nd Sep 2023 12:06
raw | new post
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.