# toybox mount -a -t nomsdos,smbfs
returns error "bad typelist". Toybox seems to expect
# toybox mount -a -t nomsdos,nosmbfs
as commented in lib/portability.c:134
// If one -t starts with "no", the rest must too
Most manuals and implementations of mount have, quote:
More than one type may be specified in a comma-separated list,
for the -t option as well as in an /etc/fstab entry. The list
of filesystem types for the -t option can be prefixed with no
to specify the filesystem types on which no action should be
taken. The prefix no has no effect when specified in an
/etc/fstab entry.
The prefix no can be meaningful with the -a option. For
example, the command
mount -a -t nomsdos,smbfs
mounts all filesystems except those of type msdos and smbfs.
------ end quote ------
I couldn't find specifications on how prefixing no with each type, or some
types should be handled. Suggest making a patch for the time being:
1. leading "no" in whole string negates all types
2. skip prefix "no" if leading "no" (in case there are people using the
syntax mount -a -t nomsdos,nosmbfs).
From cd1f2fb53ab91b93a113a0372b9a9296014bcfed Mon Sep 17 00:00:00 2001
From: andyhu <[email protected]>
Date: Tue, 15 Dec 2020 12:02:42 -0800
Subject: [PATCH] mount -a -t "no" negates all listed types
---
lib/portability.c | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/lib/portability.c b/lib/portability.c
index 91c01900..50f17c2c 100644
--- a/lib/portability.c
+++ b/lib/portability.c
@@ -130,16 +130,12 @@ int mountlist_istype(struct mtab_list *ml, char *typelist)
for (;;) {
if (!(t = comma_iterate(&typelist, &len))) break;
+ // If first item starts with "no", ignore no for the rest
if (!skip) {
- // If one -t starts with "no", the rest must too
- if (strncmp(t, "no", 2)) error_exit("bad typelist");
- if (!strncmp(t+2, ml->type, len-2)) {
- skip = 1;
- break;
- }
- } else if (!strncmp(t, ml->type, len) && !ml->type[len]) {
- skip = 0;
- break;
+ if (strncmp(t, "no", 2)) t+=2;
+ }
+ if (!strncmp(t, ml->type, len) && !ml->type[len]){
+ skip = (!skip);
}
}
--
2.29.2.684.gfbc64c5ab5-goog
_______________________________________________
Toybox mailing list
[email protected]
http://lists.landley.net/listinfo.cgi/toybox-landley.net