subr_acl_posix1e.c (85872) | subr_acl_posix1e.c (89306) |
---|---|
1/*- 2 * Copyright (c) 1999-2001 Robert N. M. Watson 3 * All rights reserved. 4 * 5 * This software was developed by Robert Watson for the TrustedBSD Project. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * | 1/*- 2 * Copyright (c) 1999-2001 Robert N. M. Watson 3 * All rights reserved. 4 * 5 * This software was developed by Robert Watson for the TrustedBSD Project. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 11 unchanged lines hidden (view full) --- 20 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 26 * SUCH DAMAGE. 27 * |
28 * $FreeBSD: head/sys/kern/subr_acl_posix1e.c 85872 2001-11-02 14:53:04Z rwatson $ | 28 * $FreeBSD: head/sys/kern/subr_acl_posix1e.c 89306 2002-01-13 11:58:06Z alfred $ |
29 */ 30/* 31 * Developed by the TrustedBSD Project. 32 * Support for POSIX.1e access control lists. 33 */ 34 35#include "opt_cap.h" 36 --- 661 unchanged lines hidden (view full) --- 698 struct file *fp; 699 int error; 700 701 mtx_lock(&Giant); 702 error = getvnode(td->td_proc->p_fd, SCARG(uap, filedes), &fp); 703 if (error == 0) { 704 error = vacl_get_acl(td, (struct vnode *)fp->f_data, 705 SCARG(uap, type), SCARG(uap, aclp)); | 29 */ 30/* 31 * Developed by the TrustedBSD Project. 32 * Support for POSIX.1e access control lists. 33 */ 34 35#include "opt_cap.h" 36 --- 661 unchanged lines hidden (view full) --- 698 struct file *fp; 699 int error; 700 701 mtx_lock(&Giant); 702 error = getvnode(td->td_proc->p_fd, SCARG(uap, filedes), &fp); 703 if (error == 0) { 704 error = vacl_get_acl(td, (struct vnode *)fp->f_data, 705 SCARG(uap, type), SCARG(uap, aclp)); |
706 fdrop(fp, td); |
|
706 } 707 mtx_unlock(&Giant); 708 return (error); 709} 710 711/* 712 * Given a file descriptor, set an ACL for it 713 * --- 5 unchanged lines hidden (view full) --- 719 struct file *fp; 720 int error; 721 722 mtx_lock(&Giant); 723 error = getvnode(td->td_proc->p_fd, SCARG(uap, filedes), &fp); 724 if (error == 0) { 725 error = vacl_set_acl(td, (struct vnode *)fp->f_data, 726 SCARG(uap, type), SCARG(uap, aclp)); | 707 } 708 mtx_unlock(&Giant); 709 return (error); 710} 711 712/* 713 * Given a file descriptor, set an ACL for it 714 * --- 5 unchanged lines hidden (view full) --- 720 struct file *fp; 721 int error; 722 723 mtx_lock(&Giant); 724 error = getvnode(td->td_proc->p_fd, SCARG(uap, filedes), &fp); 725 if (error == 0) { 726 error = vacl_set_acl(td, (struct vnode *)fp->f_data, 727 SCARG(uap, type), SCARG(uap, aclp)); |
728 fdrop(fp, td); |
|
727 } 728 mtx_unlock(&Giant); 729 return (error); 730} 731 732/* 733 * Given a file path, delete an ACL from it. 734 * --- 27 unchanged lines hidden (view full) --- 762 struct file *fp; 763 int error; 764 765 mtx_lock(&Giant); 766 error = getvnode(td->td_proc->p_fd, SCARG(uap, filedes), &fp); 767 if (error == 0) { 768 error = vacl_delete(td, (struct vnode *)fp->f_data, 769 SCARG(uap, type)); | 729 } 730 mtx_unlock(&Giant); 731 return (error); 732} 733 734/* 735 * Given a file path, delete an ACL from it. 736 * --- 27 unchanged lines hidden (view full) --- 764 struct file *fp; 765 int error; 766 767 mtx_lock(&Giant); 768 error = getvnode(td->td_proc->p_fd, SCARG(uap, filedes), &fp); 769 if (error == 0) { 770 error = vacl_delete(td, (struct vnode *)fp->f_data, 771 SCARG(uap, type)); |
772 fdrop(fp, td); |
|
770 } 771 mtx_unlock(&Giant); 772 return (error); 773} 774 775/* 776 * Given a file path, check an ACL for it 777 * --- 28 unchanged lines hidden (view full) --- 806 struct file *fp; 807 int error; 808 809 mtx_lock(&Giant); 810 error = getvnode(td->td_proc->p_fd, SCARG(uap, filedes), &fp); 811 if (error == 0) { 812 error = vacl_aclcheck(td, (struct vnode *)fp->f_data, 813 SCARG(uap, type), SCARG(uap, aclp)); | 773 } 774 mtx_unlock(&Giant); 775 return (error); 776} 777 778/* 779 * Given a file path, check an ACL for it 780 * --- 28 unchanged lines hidden (view full) --- 809 struct file *fp; 810 int error; 811 812 mtx_lock(&Giant); 813 error = getvnode(td->td_proc->p_fd, SCARG(uap, filedes), &fp); 814 if (error == 0) { 815 error = vacl_aclcheck(td, (struct vnode *)fp->f_data, 816 SCARG(uap, type), SCARG(uap, aclp)); |
817 fdrop(fp, td); |
|
814 } 815 mtx_unlock(&Giant); 816 return (error); 817} | 818 } 819 mtx_unlock(&Giant); 820 return (error); 821} |