vfs_acl.c (cd72f2180bfff020d03180e6eba1c3a0e0125468) vfs_acl.c (48e3128b34dad9618402f1f4095f7655e779843c)
1/*-
2 * Copyright (c) 1999, 2000, 2001, 2002 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

--- 766 unchanged lines hidden (view full) ---

775__acl_get_fd(struct thread *td, struct __acl_get_fd_args *uap)
776{
777 struct file *fp;
778 int error;
779
780 mtx_lock(&Giant);
781 error = getvnode(td->td_proc->p_fd, uap->filedes, &fp);
782 if (error == 0) {
1/*-
2 * Copyright (c) 1999, 2000, 2001, 2002 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

--- 766 unchanged lines hidden (view full) ---

775__acl_get_fd(struct thread *td, struct __acl_get_fd_args *uap)
776{
777 struct file *fp;
778 int error;
779
780 mtx_lock(&Giant);
781 error = getvnode(td->td_proc->p_fd, uap->filedes, &fp);
782 if (error == 0) {
783 error = vacl_get_acl(td, fp->un_data.vnode,
784 uap->type, uap->aclp);
783 error = vacl_get_acl(td, fp->f_data, uap->type, uap->aclp);
785 fdrop(fp, td);
786 }
787 mtx_unlock(&Giant);
788 return (error);
789}
790
791/*
792 * Given a file descriptor, set an ACL for it

--- 4 unchanged lines hidden (view full) ---

797__acl_set_fd(struct thread *td, struct __acl_set_fd_args *uap)
798{
799 struct file *fp;
800 int error;
801
802 mtx_lock(&Giant);
803 error = getvnode(td->td_proc->p_fd, uap->filedes, &fp);
804 if (error == 0) {
784 fdrop(fp, td);
785 }
786 mtx_unlock(&Giant);
787 return (error);
788}
789
790/*
791 * Given a file descriptor, set an ACL for it

--- 4 unchanged lines hidden (view full) ---

796__acl_set_fd(struct thread *td, struct __acl_set_fd_args *uap)
797{
798 struct file *fp;
799 int error;
800
801 mtx_lock(&Giant);
802 error = getvnode(td->td_proc->p_fd, uap->filedes, &fp);
803 if (error == 0) {
805 error = vacl_set_acl(td, fp->un_data.vnode,
806 uap->type, uap->aclp);
804 error = vacl_set_acl(td, fp->f_data, uap->type, uap->aclp);
807 fdrop(fp, td);
808 }
809 mtx_unlock(&Giant);
810 return (error);
811}
812
813/*
814 * Given a file path, delete an ACL from it.

--- 48 unchanged lines hidden (view full) ---

863__acl_delete_fd(struct thread *td, struct __acl_delete_fd_args *uap)
864{
865 struct file *fp;
866 int error;
867
868 mtx_lock(&Giant);
869 error = getvnode(td->td_proc->p_fd, uap->filedes, &fp);
870 if (error == 0) {
805 fdrop(fp, td);
806 }
807 mtx_unlock(&Giant);
808 return (error);
809}
810
811/*
812 * Given a file path, delete an ACL from it.

--- 48 unchanged lines hidden (view full) ---

861__acl_delete_fd(struct thread *td, struct __acl_delete_fd_args *uap)
862{
863 struct file *fp;
864 int error;
865
866 mtx_lock(&Giant);
867 error = getvnode(td->td_proc->p_fd, uap->filedes, &fp);
868 if (error == 0) {
871 error = vacl_delete(td, fp->un_data.vnode, uap->type);
869 error = vacl_delete(td, fp->f_data, uap->type);
872 fdrop(fp, td);
873 }
874 mtx_unlock(&Giant);
875 return (error);
876}
877
878/*
879 * Given a file path, check an ACL for it

--- 48 unchanged lines hidden (view full) ---

928__acl_aclcheck_fd(struct thread *td, struct __acl_aclcheck_fd_args *uap)
929{
930 struct file *fp;
931 int error;
932
933 mtx_lock(&Giant);
934 error = getvnode(td->td_proc->p_fd, uap->filedes, &fp);
935 if (error == 0) {
870 fdrop(fp, td);
871 }
872 mtx_unlock(&Giant);
873 return (error);
874}
875
876/*
877 * Given a file path, check an ACL for it

--- 48 unchanged lines hidden (view full) ---

926__acl_aclcheck_fd(struct thread *td, struct __acl_aclcheck_fd_args *uap)
927{
928 struct file *fp;
929 int error;
930
931 mtx_lock(&Giant);
932 error = getvnode(td->td_proc->p_fd, uap->filedes, &fp);
933 if (error == 0) {
936 error = vacl_aclcheck(td, fp->un_data.vnode,
937 uap->type, uap->aclp);
934 error = vacl_aclcheck(td, fp->f_data, uap->type, uap->aclp);
938 fdrop(fp, td);
939 }
940 mtx_unlock(&Giant);
941 return (error);
942}
935 fdrop(fp, td);
936 }
937 mtx_unlock(&Giant);
938 return (error);
939}