From c3be7d69f3f2aa930d23fa7ff7e59b356c375fed Mon Sep 17 00:00:00 2001 From: wbaumann Date: Thu, 8 Apr 2021 09:48:56 +0000 Subject: [PATCH] Ignore alle unknown options --- ChangeLog | 4 ++++ src/mount_davfs.c | 27 ++------------------------- 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9516790..5e0293a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,10 @@ ChangeLog for davfs2 -------------------- +2021-04-08 Werner Baumann (werner.baumann@onlinehome.de) + * mount.davfs.c, get_options: + Ignore all unknown options. + 2021-01-28 Werner Baumann (werner.baumann@onlinehome.de) * mount_davfs.c, write_mtab_entry: Add option _netdev to utab-entry. diff --git a/src/mount_davfs.c b/src/mount_davfs.c index 2a52b96..ff26a44 100644 --- a/src/mount_davfs.c +++ b/src/mount_davfs.c @@ -1518,7 +1518,7 @@ expand_home(char **dir, const dav_args *args) } /* Parses the string option and stores the values in the appropriate fields of - args. If an unknown option is found exit(EXIT_FAILURE) is called. + args. All strings returned in args are newly allocated, and the calling function is responsible to free them. option : a comma separated list of options (like the options in fstab and @@ -1550,12 +1550,6 @@ get_options(dav_args *args, char *option) NOEXEC, DEV, NODEV, - ASYNC, - AUTO, - NOAUTO, - COMMENT, - NOFAIL, - DEFAULTS, END }; char *suboptions[] = { @@ -1580,12 +1574,6 @@ get_options(dav_args *args, char *option) [NOEXEC] = "noexec", [DEV] = "dev", [NODEV] = "nodev", - [ASYNC] = "async", - [AUTO] = "auto", - [NOAUTO] = "noauto", - [COMMENT] = "comment", - [NOFAIL] = "nofail", - [DEFAULTS] = "defaults", [END] = NULL }; @@ -1681,19 +1669,8 @@ get_options(dav_args *args, char *option) case NODEV: args->mopts |= MS_NODEV; break; - case ASYNC: - case AUTO: - case NOAUTO: - case COMMENT: - case NOFAIL: - case DEFAULTS: - break; default: - if (so == -1) { - printf(_("Unknown option %s.\n"), argument); - usage(); - exit(EXIT_FAILURE); - } + break; } } args->mopts |= DAV_MOPTS;