freebsd32_misc.c (227502) | freebsd32_misc.c (230249) |
---|---|
1/*- 2 * Copyright (c) 2002 Doug Rabson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2002 Doug Rabson 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/compat/freebsd32/freebsd32_misc.c 227502 2011-11-14 18:00:15Z jhb $"); | 28__FBSDID("$FreeBSD: head/sys/compat/freebsd32/freebsd32_misc.c 230249 2012-01-17 01:08:01Z mckusick $"); |
29 30#include "opt_compat.h" 31#include "opt_inet.h" 32#include "opt_inet6.h" 33 34#define __ELF_WORD_SIZE 32 35 36#include <sys/param.h> --- 2443 unchanged lines hidden (view full) --- 2480freebsd32_nmount(struct thread *td, 2481 struct freebsd32_nmount_args /* { 2482 struct iovec *iovp; 2483 unsigned int iovcnt; 2484 int flags; 2485 } */ *uap) 2486{ 2487 struct uio *auio; | 29 30#include "opt_compat.h" 31#include "opt_inet.h" 32#include "opt_inet6.h" 33 34#define __ELF_WORD_SIZE 32 35 36#include <sys/param.h> --- 2443 unchanged lines hidden (view full) --- 2480freebsd32_nmount(struct thread *td, 2481 struct freebsd32_nmount_args /* { 2482 struct iovec *iovp; 2483 unsigned int iovcnt; 2484 int flags; 2485 } */ *uap) 2486{ 2487 struct uio *auio; |
2488 uint64_t flags; |
|
2488 int error; 2489 | 2489 int error; 2490 |
2490 AUDIT_ARG_FFLAGS(uap->flags); | 2491 /* 2492 * Mount flags are now 64-bits. On 32-bit archtectures only 2493 * 32-bits are passed in, but from here on everything handles 2494 * 64-bit flags correctly. 2495 */ 2496 flags = uap->flags; |
2491 | 2497 |
2498 AUDIT_ARG_FFLAGS(flags); 2499 |
|
2492 /* 2493 * Filter out MNT_ROOTFS. We do not want clients of nmount() in 2494 * userspace to set this flag, but we must filter it out if we want 2495 * MNT_UPDATE on the root file system to work. 2496 * MNT_ROOTFS should only be set by the kernel when mounting its 2497 * root file system. 2498 */ | 2500 /* 2501 * Filter out MNT_ROOTFS. We do not want clients of nmount() in 2502 * userspace to set this flag, but we must filter it out if we want 2503 * MNT_UPDATE on the root file system to work. 2504 * MNT_ROOTFS should only be set by the kernel when mounting its 2505 * root file system. 2506 */ |
2499 uap->flags &= ~MNT_ROOTFS; | 2507 flags &= ~MNT_ROOTFS; |
2500 2501 /* 2502 * check that we have an even number of iovec's 2503 * and that we have at least two options. 2504 */ 2505 if ((uap->iovcnt & 1) || (uap->iovcnt < 4)) 2506 return (EINVAL); 2507 2508 error = freebsd32_copyinuio(uap->iovp, uap->iovcnt, &auio); 2509 if (error) 2510 return (error); | 2508 2509 /* 2510 * check that we have an even number of iovec's 2511 * and that we have at least two options. 2512 */ 2513 if ((uap->iovcnt & 1) || (uap->iovcnt < 4)) 2514 return (EINVAL); 2515 2516 error = freebsd32_copyinuio(uap->iovp, uap->iovcnt, &auio); 2517 if (error) 2518 return (error); |
2511 error = vfs_donmount(td, uap->flags, auio); | 2519 error = vfs_donmount(td, flags, auio); |
2512 2513 free(auio, M_IOV); 2514 return error; 2515} 2516 2517#if 0 2518int 2519freebsd32_xxx(struct thread *td, struct freebsd32_xxx_args *uap) --- 324 unchanged lines hidden --- | 2520 2521 free(auio, M_IOV); 2522 return error; 2523} 2524 2525#if 0 2526int 2527freebsd32_xxx(struct thread *td, struct freebsd32_xxx_args *uap) --- 324 unchanged lines hidden --- |