From 0fd4e043f4dac8d72a9e5460ba8e852535ae7421 Mon Sep 17 00:00:00 2001 From: "Andrey A. Chernov" Date: Thu, 29 Sep 1994 16:39:26 +0000 Subject: [PATCH] Add code to skip "userquota"/"groupquota" options needed for quotaon/quotacheck --- sbin/mount/getmntopts.c | 11 ++++++++--- sbin/mount/mntopts.h | 4 ++++ sbin/mount/mount_ufs.c | 2 ++ sbin/mount_ifs/getmntopts.c | 11 ++++++++--- sbin/mount_ifs/mntopts.h | 4 ++++ sbin/mount_ifs/mount_ufs.c | 2 ++ 6 files changed, 28 insertions(+), 6 deletions(-) diff --git a/sbin/mount/getmntopts.c b/sbin/mount/getmntopts.c index 2c84ae56e3d5..1af5e0f0d460 100644 --- a/sbin/mount/getmntopts.c +++ b/sbin/mount/getmntopts.c @@ -53,7 +53,7 @@ getmntopts(options, m0, flagp) int *flagp; { const struct mntopt *m; - int negative; + int negative, len; char *opt, *optbuf; /* Copy option string, since it is about to be torn asunder... */ @@ -69,9 +69,14 @@ getmntopts(options, m0, flagp) negative = 0; /* Scan option table. */ - for (m = m0; m->m_option != NULL; ++m) - if (strcasecmp(opt, m->m_option) == 0) + for (m = m0; m->m_option != NULL; ++m) { + len = strlen(m->m_option); + if (strncasecmp(opt, m->m_option, len) == 0) + if ( m->m_option[len] == '\0' + || m->m_option[len] == '=' + ) break; + } /* Save flag, or fail if option is not recognised. */ if (m->m_option) { diff --git a/sbin/mount/mntopts.h b/sbin/mount/mntopts.h index a89f63dc19ff..ec2c6d0ce40f 100644 --- a/sbin/mount/mntopts.h +++ b/sbin/mount/mntopts.h @@ -48,6 +48,10 @@ struct mntopt { #define MOPT_SYNC { "sync", 0, MNT_SYNCHRONOUS } #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. */ #define MOPT_FORCE { "force", 1, MNT_FORCE } #define MOPT_UPDATE { "update", 0, MNT_UPDATE } diff --git a/sbin/mount/mount_ufs.c b/sbin/mount/mount_ufs.c index 43dfb055e198..37d4756f6857 100644 --- a/sbin/mount/mount_ufs.c +++ b/sbin/mount/mount_ufs.c @@ -60,6 +60,8 @@ static struct mntopt mopts[] = { MOPT_ASYNC, MOPT_SYNC, MOPT_UPDATE, + MOPT_UQUOTA, + MOPT_GQUOTA, { NULL } }; diff --git a/sbin/mount_ifs/getmntopts.c b/sbin/mount_ifs/getmntopts.c index 2c84ae56e3d5..1af5e0f0d460 100644 --- a/sbin/mount_ifs/getmntopts.c +++ b/sbin/mount_ifs/getmntopts.c @@ -53,7 +53,7 @@ getmntopts(options, m0, flagp) int *flagp; { const struct mntopt *m; - int negative; + int negative, len; char *opt, *optbuf; /* Copy option string, since it is about to be torn asunder... */ @@ -69,9 +69,14 @@ getmntopts(options, m0, flagp) negative = 0; /* Scan option table. */ - for (m = m0; m->m_option != NULL; ++m) - if (strcasecmp(opt, m->m_option) == 0) + for (m = m0; m->m_option != NULL; ++m) { + len = strlen(m->m_option); + if (strncasecmp(opt, m->m_option, len) == 0) + if ( m->m_option[len] == '\0' + || m->m_option[len] == '=' + ) break; + } /* Save flag, or fail if option is not recognised. */ if (m->m_option) { diff --git a/sbin/mount_ifs/mntopts.h b/sbin/mount_ifs/mntopts.h index a89f63dc19ff..ec2c6d0ce40f 100644 --- a/sbin/mount_ifs/mntopts.h +++ b/sbin/mount_ifs/mntopts.h @@ -48,6 +48,10 @@ struct mntopt { #define MOPT_SYNC { "sync", 0, MNT_SYNCHRONOUS } #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. */ #define MOPT_FORCE { "force", 1, MNT_FORCE } #define MOPT_UPDATE { "update", 0, MNT_UPDATE } diff --git a/sbin/mount_ifs/mount_ufs.c b/sbin/mount_ifs/mount_ufs.c index 43dfb055e198..37d4756f6857 100644 --- a/sbin/mount_ifs/mount_ufs.c +++ b/sbin/mount_ifs/mount_ufs.c @@ -60,6 +60,8 @@ static struct mntopt mopts[] = { MOPT_ASYNC, MOPT_SYNC, MOPT_UPDATE, + MOPT_UQUOTA, + MOPT_GQUOTA, { NULL } };