fix quotas

This commit is contained in:
deraadt 1994-06-24 07:32:01 +00:00
parent 932345acae
commit e19b07b366
2 changed files with 23 additions and 4 deletions

View File

@ -32,7 +32,8 @@
*/ */
#ifndef lint #ifndef lint
static char sccsid[] = "@(#)getmntopts.c 8.1 (Berkeley) 3/27/94"; /*static char sccsid[] = "from: @(#)getmntopts.c 8.1 (Berkeley) 3/27/94";*/
static char *rcsid = "$Id: getmntopts.c,v 1.2 1994/06/24 07:32:01 deraadt Exp $";
#endif /* not lint */ #endif /* not lint */
#include <sys/param.h> #include <sys/param.h>
@ -54,7 +55,7 @@ getmntopts(options, m0, flagp)
{ {
const struct mntopt *m; const struct mntopt *m;
int negative; int negative;
char *opt, *optbuf; char *opt, *optbuf, *p;
/* Copy option string, since it is about to be torn asunder... */ /* Copy option string, since it is about to be torn asunder... */
if ((optbuf = strdup(options)) == NULL) if ((optbuf = strdup(options)) == NULL)
@ -68,6 +69,14 @@ getmntopts(options, m0, flagp)
} else } else
negative = 0; negative = 0;
/*
* for options with assignments in them (ie. quotas)
* ignore the assignment as it's handled elsewhere
*/
p = strchr(opt, '=');
if (p)
*p = '\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) if (strcasecmp(opt, m->m_option) == 0)

View File

@ -30,7 +30,8 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE. * SUCH DAMAGE.
* *
* @(#)mntopts.h 8.3 (Berkeley) 3/27/94 * from: @(#)mntopts.h 8.3 (Berkeley) 3/27/94
* $Id: mntopts.h,v 1.2 1994/06/24 07:32:05 deraadt Exp $
*/ */
struct mntopt { struct mntopt {
@ -47,21 +48,30 @@ struct mntopt {
#define MOPT_RDONLY { "rdonly", 0, MNT_RDONLY } #define MOPT_RDONLY { "rdonly", 0, MNT_RDONLY }
#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 }
#define MOPT_USERQUOTA { "userquota", 0, 0 }
#define MOPT_GROUPQUOTA { "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 }
#define MOPT_RELOAD { "reload", 0, MNT_RELOAD }
/* Support for old-style "ro", "rw" flags. */ /* Support for old-style "ro", "rw" flags. */
#define MOPT_RO { "ro", 0, MNT_RDONLY } #define MOPT_RO { "ro", 0, MNT_RDONLY }
#define MOPT_RW { "rw", 1, MNT_RDONLY } #define MOPT_RW { "rw", 1, MNT_RDONLY }
/* This is parse by mount(8), but is ignored by specific mount_*(8)s. */
#define MOPT_AUTO { "auto", 0, 0 }
#define MOPT_FSTAB_COMPAT \ #define MOPT_FSTAB_COMPAT \
MOPT_RO, \ MOPT_RO, \
MOPT_RW MOPT_RW, \
MOPT_AUTO
/* Standard options which all mounts can understand. */ /* Standard options which all mounts can understand. */
#define MOPT_STDOPTS \ #define MOPT_STDOPTS \
MOPT_USERQUOTA, \
MOPT_GROUPQUOTA, \
MOPT_FSTAB_COMPAT, \ MOPT_FSTAB_COMPAT, \
MOPT_NODEV, \ MOPT_NODEV, \
MOPT_NOEXEC, \ MOPT_NOEXEC, \