Add code to skip "userquota"/"groupquota" options needed for
quotaon/quotacheck
This commit is contained in:
parent
e4b1dc5b1e
commit
0fd4e043f4
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=3202
@ -53,7 +53,7 @@ getmntopts(options, m0, flagp)
|
|||||||
int *flagp;
|
int *flagp;
|
||||||
{
|
{
|
||||||
const struct mntopt *m;
|
const struct mntopt *m;
|
||||||
int negative;
|
int negative, len;
|
||||||
char *opt, *optbuf;
|
char *opt, *optbuf;
|
||||||
|
|
||||||
/* Copy option string, since it is about to be torn asunder... */
|
/* Copy option string, since it is about to be torn asunder... */
|
||||||
@ -69,9 +69,14 @@ getmntopts(options, m0, flagp)
|
|||||||
negative = 0;
|
negative = 0;
|
||||||
|
|
||||||
/* Scan option table. */
|
/* Scan option table. */
|
||||||
for (m = m0; m->m_option != NULL; ++m)
|
for (m = m0; m->m_option != NULL; ++m) {
|
||||||
if (strcasecmp(opt, m->m_option) == 0)
|
len = strlen(m->m_option);
|
||||||
|
if (strncasecmp(opt, m->m_option, len) == 0)
|
||||||
|
if ( m->m_option[len] == '\0'
|
||||||
|
|| m->m_option[len] == '='
|
||||||
|
)
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* Save flag, or fail if option is not recognised. */
|
/* Save flag, or fail if option is not recognised. */
|
||||||
if (m->m_option) {
|
if (m->m_option) {
|
||||||
|
@ -48,6 +48,10 @@ struct mntopt {
|
|||||||
#define MOPT_SYNC { "sync", 0, MNT_SYNCHRONOUS }
|
#define MOPT_SYNC { "sync", 0, MNT_SYNCHRONOUS }
|
||||||
#define MOPT_UNION { "union", 0, MNT_UNION }
|
#define MOPT_UNION { "union", 0, MNT_UNION }
|
||||||
|
|
||||||
|
/* Skip this options without any action (needed for checkquota/quotaon) */
|
||||||
|
#define MOPT_UQUOTA { "userquota", 0, 0 }
|
||||||
|
#define MOPT_GQUOTA { "groupquota", 0, 0 }
|
||||||
|
|
||||||
/* Control flags. */
|
/* Control flags. */
|
||||||
#define MOPT_FORCE { "force", 1, MNT_FORCE }
|
#define MOPT_FORCE { "force", 1, MNT_FORCE }
|
||||||
#define MOPT_UPDATE { "update", 0, MNT_UPDATE }
|
#define MOPT_UPDATE { "update", 0, MNT_UPDATE }
|
||||||
|
@ -60,6 +60,8 @@ static struct mntopt mopts[] = {
|
|||||||
MOPT_ASYNC,
|
MOPT_ASYNC,
|
||||||
MOPT_SYNC,
|
MOPT_SYNC,
|
||||||
MOPT_UPDATE,
|
MOPT_UPDATE,
|
||||||
|
MOPT_UQUOTA,
|
||||||
|
MOPT_GQUOTA,
|
||||||
{ NULL }
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -53,7 +53,7 @@ getmntopts(options, m0, flagp)
|
|||||||
int *flagp;
|
int *flagp;
|
||||||
{
|
{
|
||||||
const struct mntopt *m;
|
const struct mntopt *m;
|
||||||
int negative;
|
int negative, len;
|
||||||
char *opt, *optbuf;
|
char *opt, *optbuf;
|
||||||
|
|
||||||
/* Copy option string, since it is about to be torn asunder... */
|
/* Copy option string, since it is about to be torn asunder... */
|
||||||
@ -69,9 +69,14 @@ getmntopts(options, m0, flagp)
|
|||||||
negative = 0;
|
negative = 0;
|
||||||
|
|
||||||
/* Scan option table. */
|
/* Scan option table. */
|
||||||
for (m = m0; m->m_option != NULL; ++m)
|
for (m = m0; m->m_option != NULL; ++m) {
|
||||||
if (strcasecmp(opt, m->m_option) == 0)
|
len = strlen(m->m_option);
|
||||||
|
if (strncasecmp(opt, m->m_option, len) == 0)
|
||||||
|
if ( m->m_option[len] == '\0'
|
||||||
|
|| m->m_option[len] == '='
|
||||||
|
)
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* Save flag, or fail if option is not recognised. */
|
/* Save flag, or fail if option is not recognised. */
|
||||||
if (m->m_option) {
|
if (m->m_option) {
|
||||||
|
@ -48,6 +48,10 @@ struct mntopt {
|
|||||||
#define MOPT_SYNC { "sync", 0, MNT_SYNCHRONOUS }
|
#define MOPT_SYNC { "sync", 0, MNT_SYNCHRONOUS }
|
||||||
#define MOPT_UNION { "union", 0, MNT_UNION }
|
#define MOPT_UNION { "union", 0, MNT_UNION }
|
||||||
|
|
||||||
|
/* Skip this options without any action (needed for checkquota/quotaon) */
|
||||||
|
#define MOPT_UQUOTA { "userquota", 0, 0 }
|
||||||
|
#define MOPT_GQUOTA { "groupquota", 0, 0 }
|
||||||
|
|
||||||
/* Control flags. */
|
/* Control flags. */
|
||||||
#define MOPT_FORCE { "force", 1, MNT_FORCE }
|
#define MOPT_FORCE { "force", 1, MNT_FORCE }
|
||||||
#define MOPT_UPDATE { "update", 0, MNT_UPDATE }
|
#define MOPT_UPDATE { "update", 0, MNT_UPDATE }
|
||||||
|
@ -60,6 +60,8 @@ static struct mntopt mopts[] = {
|
|||||||
MOPT_ASYNC,
|
MOPT_ASYNC,
|
||||||
MOPT_SYNC,
|
MOPT_SYNC,
|
||||||
MOPT_UPDATE,
|
MOPT_UPDATE,
|
||||||
|
MOPT_UQUOTA,
|
||||||
|
MOPT_GQUOTA,
|
||||||
{ NULL }
|
{ NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user