mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Fix "mount -u -o ro".
Requested by: maxim
This commit is contained in:
parent
51e37c7f37
commit
19996233cc
1 changed files with 24 additions and 1 deletions
|
|
@ -184,6 +184,26 @@ exec_mountprog(const char *name, const char *execname,
|
|||
return (0);
|
||||
}
|
||||
|
||||
static
|
||||
int specified_ro(const char *arg)
|
||||
{
|
||||
char *optbuf, *opt;
|
||||
int ret = 0;
|
||||
|
||||
optbuf = strdup(arg);
|
||||
if (optbuf == NULL)
|
||||
err(1, NULL);
|
||||
|
||||
for (opt = optbuf; (opt = strtok(opt, ",")) != NULL; opt = NULL) {
|
||||
if (strcmp(opt, "ro") == 0) {
|
||||
ret = 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
free(optbuf);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
|
|
@ -215,8 +235,11 @@ main(int argc, char *argv[])
|
|||
init_flags |= MNT_FORCE;
|
||||
break;
|
||||
case 'o':
|
||||
if (*optarg)
|
||||
if (*optarg) {
|
||||
options = catopt(options, optarg);
|
||||
if (specified_ro(optarg))
|
||||
ro = 1;
|
||||
}
|
||||
break;
|
||||
case 'p':
|
||||
fstab_style = 1;
|
||||
|
|
|
|||
Loading…
Reference in a new issue