Unverified Commit 6b3dccea by Christian Brauner Committed by GitHub

Merge pull request #3213 from blenk92/fix-mount-parsing

config: Fix parsing of mount options
parents 75001299 85c2de39
...@@ -1853,16 +1853,21 @@ static void parse_mntopt(char *opt, unsigned long *flags, char **data, size_t si ...@@ -1853,16 +1853,21 @@ static void parse_mntopt(char *opt, unsigned long *flags, char **data, size_t si
{ {
struct mount_opt *mo; struct mount_opt *mo;
/* If opt is found in mount_opt, set or clear flags. /* If '=' is contained in opt, the option must go into data. */
* Otherwise append it to data. */ if (!strchr(opt, '=')) {
for (mo = &mount_opt[0]; mo->name != NULL; mo++) { /* If opt is found in mount_opt, set or clear flags.
if (strncmp(opt, mo->name, strlen(mo->name)) == 0) { * Otherwise append it to data. */
if (mo->clear) size_t opt_len = strlen(opt);
*flags &= ~mo->flag; for (mo = &mount_opt[0]; mo->name != NULL; mo++) {
else size_t mo_name_len = strlen(mo->name);
*flags |= mo->flag; if (opt_len == mo_name_len && strncmp(opt, mo->name, mo_name_len) == 0) {
return; if (mo->clear)
*flags &= ~mo->flag;
else
*flags |= mo->flag;
return;
}
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment