summaryrefslogtreecommitdiffstats
path: root/libmount/src/optstr.c
diff options
context:
space:
mode:
Diffstat (limited to 'libmount/src/optstr.c')
-rw-r--r--libmount/src/optstr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/libmount/src/optstr.c b/libmount/src/optstr.c
index 9e98798af..7b1034e5d 100644
--- a/libmount/src/optstr.c
+++ b/libmount/src/optstr.c
@@ -722,7 +722,9 @@ int mnt_optstr_apply_flags(char **optstr, unsigned long flags,
char *p;
for (ent = map; ent && ent->name; ent++) {
- if ((ent->mask & MNT_INVERT) || (fl & ent->id) != ent->id)
+ if ((ent->mask & MNT_INVERT)
+ || ent->id == 0
+ || (fl & ent->id) != ent->id)
continue;
/* don't add options which require values (e.g. offset=%d) */