opensolaris_policy.c (192694) | opensolaris_policy.c (197860) |
---|---|
1/*- 2 * Copyright (c) 2007 Pawel Jakub Dawidek <pjd@FreeBSD.org> 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) 2007 Pawel Jakub Dawidek <pjd@FreeBSD.org> 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/cddl/compat/opensolaris/kern/opensolaris_policy.c 192694 2009-05-24 19:21:49Z trasz $"); | 28__FBSDID("$FreeBSD: head/sys/cddl/compat/opensolaris/kern/opensolaris_policy.c 197860 2009-10-08 16:03:19Z pjd $"); |
29 30#include <sys/param.h> 31#include <sys/priv.h> 32#include <sys/vnode.h> 33#include <sys/mntent.h> 34#include <sys/mount.h> 35#include <sys/stat.h> 36#include <sys/jail.h> --- 36 unchanged lines hidden (view full) --- 73} 74 75int 76secpolicy_fs_owner(struct mount *mp, struct ucred *cred) 77{ 78 79 if (zfs_super_owner) { 80 if (cred->cr_uid == mp->mnt_cred->cr_uid && | 29 30#include <sys/param.h> 31#include <sys/priv.h> 32#include <sys/vnode.h> 33#include <sys/mntent.h> 34#include <sys/mount.h> 35#include <sys/stat.h> 36#include <sys/jail.h> --- 36 unchanged lines hidden (view full) --- 73} 74 75int 76secpolicy_fs_owner(struct mount *mp, struct ucred *cred) 77{ 78 79 if (zfs_super_owner) { 80 if (cred->cr_uid == mp->mnt_cred->cr_uid && |
81 (!jailed(cred) || 82 cred->cr_prison == mp->mnt_cred->cr_prison)) { | 81 cred->cr_prison == mp->mnt_cred->cr_prison) { |
83 return (0); 84 } 85 } | 82 return (0); 83 } 84 } |
86 return (priv_check_cred(cred, PRIV_VFS_MOUNT_OWNER, 0)); | 85 return (EPERM); |
87} 88 89/* 90 * This check is done in kern_link(), so we could just return 0 here. 91 */ 92extern int hardlink_check_uid; 93int 94secpolicy_basic_link(struct vnode *vp, struct ucred *cred) --- 272 unchanged lines hidden --- | 86} 87 88/* 89 * This check is done in kern_link(), so we could just return 0 here. 90 */ 91extern int hardlink_check_uid; 92int 93secpolicy_basic_link(struct vnode *vp, struct ucred *cred) --- 272 unchanged lines hidden --- |