11558Srgrimes/*- 21558Srgrimes * Copyright (c) 1994 31558Srgrimes * The Regents of the University of California. All rights reserved. 41558Srgrimes * 51558Srgrimes * Redistribution and use in source and binary forms, with or without 61558Srgrimes * modification, are permitted provided that the following conditions 71558Srgrimes * are met: 81558Srgrimes * 1. Redistributions of source code must retain the above copyright 91558Srgrimes * notice, this list of conditions and the following disclaimer. 101558Srgrimes * 2. Redistributions in binary form must reproduce the above copyright 111558Srgrimes * notice, this list of conditions and the following disclaimer in the 121558Srgrimes * documentation and/or other materials provided with the distribution. 131558Srgrimes * 4. Neither the name of the University nor the names of its contributors 141558Srgrimes * may be used to endorse or promote products derived from this software 151558Srgrimes * without specific prior written permission. 161558Srgrimes * 171558Srgrimes * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 181558Srgrimes * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 191558Srgrimes * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 201558Srgrimes * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 211558Srgrimes * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 221558Srgrimes * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 231558Srgrimes * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 241558Srgrimes * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 251558Srgrimes * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 261558Srgrimes * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 271558Srgrimes * SUCH DAMAGE. 281558Srgrimes * 2923678Speter * @(#)mntopts.h 8.7 (Berkeley) 3/29/95 3050476Speter * $FreeBSD: releng/11.0/sbin/mount/mntopts.h 270096 2014-08-17 09:44:42Z trasz $ 311558Srgrimes */ 321558Srgrimes 331558Srgrimesstruct mntopt { 341558Srgrimes const char *m_option; /* option name */ 35153007Srodrigc int m_inverse; /* if a negative option, e.g. "atime" */ 36270096Strasz long long m_flag; /* bit to set, e.g. MNT_RDONLY */ 3723678Speter int m_altloc; /* 1 => set bit in altflags */ 381558Srgrimes}; 391558Srgrimes 401558Srgrimes/* User-visible MNT_ flags. */ 414065Swollman#define MOPT_ASYNC { "async", 0, MNT_ASYNC, 0 } 4218007Sdg#define MOPT_NOATIME { "atime", 1, MNT_NOATIME, 0 } 434065Swollman#define MOPT_NOEXEC { "exec", 1, MNT_NOEXEC, 0 } 444065Swollman#define MOPT_NOSUID { "suid", 1, MNT_NOSUID, 0 } 4535105Swosch#define MOPT_NOSYMFOLLOW { "symfollow", 1, MNT_NOSYMFOLLOW, 0 } 464065Swollman#define MOPT_RDONLY { "rdonly", 0, MNT_RDONLY, 0 } 474065Swollman#define MOPT_SYNC { "sync", 0, MNT_SYNCHRONOUS, 0 } 484065Swollman#define MOPT_UNION { "union", 0, MNT_UNION, 0 } 4923678Speter#define MOPT_USERQUOTA { "userquota", 0, 0, 0 } 5023678Speter#define MOPT_GROUPQUOTA { "groupquota", 0, 0, 0 } 5129890Skato#define MOPT_NOCLUSTERR { "clusterr", 1, MNT_NOCLUSTERR, 0 } 5229890Skato#define MOPT_NOCLUSTERW { "clusterw", 1, MNT_NOCLUSTERW, 0 } 5331144Sjulian#define MOPT_SUIDDIR { "suiddir", 0, MNT_SUIDDIR, 0 } 5462664Smckusick#define MOPT_SNAPSHOT { "snapshot", 0, MNT_SNAPSHOT, 0 } 55101205Srwatson#define MOPT_MULTILABEL { "multilabel", 0, MNT_MULTILABEL, 0 } 56105118Srwatson#define MOPT_ACLS { "acls", 0, MNT_ACLS, 0 } 57200796Strasz#define MOPT_NFS4ACLS { "nfsv4acls", 0, MNT_NFS4ACLS, 0 } 58270096Strasz#define MOPT_AUTOMOUNTED { "automounted",0, MNT_AUTOMOUNTED, 0 } 591558Srgrimes 601558Srgrimes/* Control flags. */ 618487Sdg#define MOPT_FORCE { "force", 0, MNT_FORCE, 0 } 624065Swollman#define MOPT_UPDATE { "update", 0, MNT_UPDATE, 0 } 634065Swollman#define MOPT_RO { "ro", 0, MNT_RDONLY, 0 } 644065Swollman#define MOPT_RW { "rw", 1, MNT_RDONLY, 0 } 651558Srgrimes 6623678Speter/* This is parsed by mount(8), but is ignored by specific mount_*(8)s. */ 6723678Speter#define MOPT_AUTO { "auto", 0, 0, 0 } 6823678Speter 69147242Sdelphij/* A handy macro as terminator of MNT_ array. */ 70147242Sdelphij#define MOPT_END { NULL, 0, 0, 0 } 71146853Sdelphij 721558Srgrimes#define MOPT_FSTAB_COMPAT \ 731558Srgrimes MOPT_RO, \ 7423678Speter MOPT_RW, \ 7523678Speter MOPT_AUTO 761558Srgrimes 771558Srgrimes/* Standard options which all mounts can understand. */ 781558Srgrimes#define MOPT_STDOPTS \ 7923678Speter MOPT_USERQUOTA, \ 8023678Speter MOPT_GROUPQUOTA, \ 811558Srgrimes MOPT_FSTAB_COMPAT, \ 8218007Sdg MOPT_NOATIME, \ 831558Srgrimes MOPT_NOEXEC, \ 8431144Sjulian MOPT_SUIDDIR, /* must be before MOPT_NOSUID */ \ 851558Srgrimes MOPT_NOSUID, \ 8635105Swosch MOPT_NOSYMFOLLOW, \ 871558Srgrimes MOPT_RDONLY, \ 8829890Skato MOPT_UNION, \ 8929890Skato MOPT_NOCLUSTERR, \ 90101205Srwatson MOPT_NOCLUSTERW, \ 91105118Srwatson MOPT_MULTILABEL, \ 92200796Strasz MOPT_ACLS, \ 93270096Strasz MOPT_NFS4ACLS, \ 94270096Strasz MOPT_AUTOMOUNTED 9528735Sbde 9692882Simpvoid getmntopts(const char *, const struct mntopt *, int *, int *); 9792882Simpvoid rmslashes(char *, char *); 98230226Sjhint checkpath(const char *, char resolved_path[]); 9928735Sbdeextern int getmnt_silent; 100152354Srodrigcvoid build_iovec(struct iovec **iov, int *iovlen, const char *name, void *val, size_t len); 101152354Srodrigcvoid build_iovec_argf(struct iovec **iov, int *iovlen, const char *name, const char *fmt, ...); 102