1/*- 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 21 unchanged lines hidden (view full) --- 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 * 34 * @(#)vfs_subr.c 8.31 (Berkeley) 5/26/95 35 */ 36 37#include <sys/cdefs.h> |
38__FBSDID("$FreeBSD: head/sys/kern/vfs_export.c 194498 2009-06-19 17:10:35Z brooks $"); |
39 40#include <sys/param.h> 41#include <sys/dirent.h> 42#include <sys/domain.h> 43#include <sys/kernel.h> 44#include <sys/lock.h> 45#include <sys/malloc.h> 46#include <sys/mbuf.h> --- 68 unchanged lines hidden (view full) --- 115 vfs_mount_error(mp, 116 "MNT_DEFEXPORTED already set for mount %p", mp); 117 return (EPERM); 118 } 119 np = &nep->ne_defexported; 120 np->netc_exflags = argp->ex_flags; 121 np->netc_anon = crget(); 122 np->netc_anon->cr_uid = argp->ex_anon.cr_uid; |
123 crsetgroups(np->netc_anon, argp->ex_anon.cr_ngroups, 124 argp->ex_anon.cr_groups); |
125 np->netc_numsecflavors = argp->ex_numsecflavors; 126 bcopy(argp->ex_secflavors, np->netc_secflavors, 127 sizeof(np->netc_secflavors)); 128 MNT_ILOCK(mp); 129 mp->mnt_flag |= MNT_DEFEXPORTED; 130 MNT_IUNLOCK(mp); 131 return (0); 132 } --- 66 unchanged lines hidden (view full) --- 199 error = EPERM; 200 vfs_mount_error(mp, "Invalid radix node head, rn: %p %p", 201 rn, np); 202 goto out; 203 } 204 np->netc_exflags = argp->ex_flags; 205 np->netc_anon = crget(); 206 np->netc_anon->cr_uid = argp->ex_anon.cr_uid; |
207 crsetgroups(np->netc_anon, argp->ex_anon.cr_ngroups, 208 np->netc_anon->cr_groups); |
209 np->netc_numsecflavors = argp->ex_numsecflavors; 210 bcopy(argp->ex_secflavors, np->netc_secflavors, 211 sizeof(np->netc_secflavors)); 212 return (0); 213out: 214 free(np, M_NETADDR); 215 return (error); 216} --- 261 unchanged lines hidden --- |