acl_set.c (75526) | acl_set.c (75928) |
---|---|
1/*- 2 * Copyright (c) 1999, 2000, 2001 Robert N. M. Watson 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 --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 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 * | 1/*- 2 * Copyright (c) 1999, 2000, 2001 Robert N. M. Watson 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 --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 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 * $FreeBSD: head/lib/libc/posix1e/acl_set.c 75526 2001-04-15 15:21:15Z jedgar $ | 26 * $FreeBSD: head/lib/libc/posix1e/acl_set.c 75928 2001-04-24 22:45:41Z jedgar $ |
27 */ 28/* 29 * acl_set_file -- set a file/directory ACL by name 30 */ 31 32#include <sys/types.h> 33#include "namespace.h" 34#include <sys/acl.h> --- 19 unchanged lines hidden (view full) --- 54 if (_posix1e_acl(acl, type)) { 55 error = _posix1e_acl_sort(acl); 56 if (error) { 57 errno = error; 58 return (-1); 59 } 60 } 61 | 27 */ 28/* 29 * acl_set_file -- set a file/directory ACL by name 30 */ 31 32#include <sys/types.h> 33#include "namespace.h" 34#include <sys/acl.h> --- 19 unchanged lines hidden (view full) --- 54 if (_posix1e_acl(acl, type)) { 55 error = _posix1e_acl_sort(acl); 56 if (error) { 57 errno = error; 58 return (-1); 59 } 60 } 61 |
62 return (__acl_set_file(path_p, type, acl)); | 62 acl->ats_cur_entry = 0; 63 64 return (__acl_set_file(path_p, type, &acl->ats_acl)); |
63} 64 65int 66acl_set_fd(int fd, acl_t acl) 67{ 68 int error; 69 70 error = _posix1e_acl_sort(acl); 71 if (error) { 72 errno = error; 73 return(-1); 74 } 75 | 65} 66 67int 68acl_set_fd(int fd, acl_t acl) 69{ 70 int error; 71 72 error = _posix1e_acl_sort(acl); 73 if (error) { 74 errno = error; 75 return(-1); 76 } 77 |
76 return (___acl_set_fd(fd, ACL_TYPE_ACCESS, acl)); | 78 acl->ats_cur_entry = 0; 79 80 return (___acl_set_fd(fd, ACL_TYPE_ACCESS, &acl->ats_acl)); |
77} 78 79int 80acl_set_fd_np(int fd, acl_t acl, acl_type_t type) 81{ 82 int error; 83 84 if (_posix1e_acl(acl, type)) { 85 error = _posix1e_acl_sort(acl); 86 if (error) { 87 errno = error; 88 return (-1); 89 } 90 } 91 | 81} 82 83int 84acl_set_fd_np(int fd, acl_t acl, acl_type_t type) 85{ 86 int error; 87 88 if (_posix1e_acl(acl, type)) { 89 error = _posix1e_acl_sort(acl); 90 if (error) { 91 errno = error; 92 return (-1); 93 } 94 } 95 |
92 return (___acl_set_fd(fd, type, acl)); | 96 acl->ats_cur_entry = 0; 97 98 return (___acl_set_fd(fd, type, &acl->ats_acl)); |
93} 94 95/* | 99} 100 101/* |
96 * acl_set_permset() sets the permissions of ACL entry entry_d | 102 * acl_set_permset() (23.4.23): sets the permissions of ACL entry entry_d |
97 * with the permissions in permset_d 98 */ 99int 100acl_set_permset(acl_entry_t entry_d, acl_permset_t permset_d) 101{ 102 103 if (!entry_d) { 104 errno = EINVAL; --- 60 unchanged lines hidden --- | 103 * with the permissions in permset_d 104 */ 105int 106acl_set_permset(acl_entry_t entry_d, acl_permset_t permset_d) 107{ 108 109 if (!entry_d) { 110 errno = EINVAL; --- 60 unchanged lines hidden --- |