Support negated fstab options
We would ignore options like "fail" and "auto", and for any option which takes a value the first assignment would win. Repeated and options equivalent to the default are rarely used, but they have been documented forever, and people might use them. Especially on the kernel command line it is easier to append a repeated or negated option at the end.
This commit is contained in:
@@ -67,8 +67,8 @@ static int create_disk(
|
||||
assert(name);
|
||||
assert(device);
|
||||
|
||||
noauto = fstab_test_option(options, "noauto\0");
|
||||
nofail = fstab_test_option(options, "nofail\0");
|
||||
noauto = fstab_test_yes_no_option(options, "noauto\0" "auto\0");
|
||||
nofail = fstab_test_yes_no_option(options, "nofail\0" "fail\0");
|
||||
tmp = fstab_test_option(options, "tmp\0");
|
||||
swap = fstab_test_option(options, "swap\0");
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ static int parse_one_option(const char *option) {
|
||||
assert(option);
|
||||
|
||||
/* Handled outside of this tool */
|
||||
if (streq(option, "noauto") || streq(option, "nofail"))
|
||||
if (STR_IN_SET(option, "noauto", "auto", "nofail", "fail"))
|
||||
return 0;
|
||||
|
||||
if (startswith(option, "cipher=")) {
|
||||
|
||||
Reference in New Issue
Block a user