diff options
author | Jeff Layton <jlayton@samba.org> | 2012-03-06 10:54:28 -0500 |
---|---|---|
committer | Jeff Layton <jlayton@samba.org> | 2012-03-06 10:54:28 -0500 |
commit | b0bc3861bfc7b258045d1d456cf2ef4a43ea9562 (patch) | |
tree | 04e4822fbfb64e4306f2bb535b8076abc462a7a8 | |
parent | f6384b4fe1ffdeebee3e9d73dd533a4fbf83b6d8 (diff) | |
download | cifs-utils-b0bc3861bfc7b258045d1d456cf2ef4a43ea9562.tar.gz cifs-utils-b0bc3861bfc7b258045d1d456cf2ef4a43ea9562.tar.bz2 cifs-utils-b0bc3861bfc7b258045d1d456cf2ef4a43ea9562.zip |
mount.cifs: add support for -s option
autofs generally calls mount helpers with '-s'. Handle that the same
way we do for NFS -- append ",sloppy" option to the mount options.
The kernel can look for that option to decide whether to ignore
unknown mount options, warn, or error out.
Signed-off-by: Jeff Layton <jlayton@samba.org>
-rw-r--r-- | mount.cifs.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/mount.cifs.c b/mount.cifs.c index 824cd3a..c0aea35 100644 --- a/mount.cifs.c +++ b/mount.cifs.c @@ -1438,6 +1438,7 @@ static struct option longopts[] = { {"pass", 1, NULL, 'p'}, {"credentials", 1, NULL, 'c'}, {"port", 1, NULL, 'P'}, + {"sloppy", 0, NULL, 's'}, {NULL, 0, NULL, 0} }; @@ -1863,6 +1864,7 @@ int main(int argc, char **argv) char *currentaddress, *nextaddress; int rc = 0; int already_uppercased = 0; + int sloppy = 0; size_t options_size = MAX_OPTIONS_LEN; struct parsed_mount_info *parsed_info = NULL; pid_t pid; @@ -1900,7 +1902,7 @@ int main(int argc, char **argv) } /* add sharename in opts string as unc= parm */ - while ((c = getopt_long(argc, argv, "?fhno:rvVw", + while ((c = getopt_long(argc, argv, "?fhno:rsvVw", longopts, NULL)) != -1) { switch (c) { case '?': @@ -1932,6 +1934,9 @@ int main(int argc, char **argv) case 'f': ++parsed_info->fakemnt; break; + case 's': + ++sloppy; + break; default: fprintf(stderr, "unknown command-line option: %c\n", c); rc = mount_usage(stderr); @@ -2037,6 +2042,9 @@ mount_retry: strlcat(options, parsed_info->prefix, options_size); } + if (sloppy) + strlcat(options, ",sloppy", options_size); + if (parsed_info->verboseflag) fprintf(stderr, "%s kernel mount options: %s", thisprogram, options); |