acl_to_text.c (70841) | acl_to_text.c (71142) |
---|---|
1/*- 2 * Copyright (c) 1999 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 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_to_text.c 70841 2001-01-09 05:45:03Z rwatson $ | 26 * $FreeBSD: head/lib/libc/posix1e/acl_to_text.c 71142 2001-01-17 02:40:39Z rwatson $ |
27 */ 28/* 29 * acl_to_text - return a text string with a text representation of the acl 30 * in it. 31 */ 32 33#include <sys/types.h> 34#include <sys/acl.h> --- 21 unchanged lines hidden (view full) --- 56 effective_perm_buf[ACL_STRING_PERM_MAXSIZE+1]; 57 int i, error, len; 58 uid_t ae_id; 59 acl_tag_t ae_tag; 60 acl_perm_t ae_perm, effective_perm, mask_perm; 61 62 buf = strdup(""); 63 if (!buf) | 27 */ 28/* 29 * acl_to_text - return a text string with a text representation of the acl 30 * in it. 31 */ 32 33#include <sys/types.h> 34#include <sys/acl.h> --- 21 unchanged lines hidden (view full) --- 56 effective_perm_buf[ACL_STRING_PERM_MAXSIZE+1]; 57 int i, error, len; 58 uid_t ae_id; 59 acl_tag_t ae_tag; 60 acl_perm_t ae_perm, effective_perm, mask_perm; 61 62 buf = strdup(""); 63 if (!buf) |
64 return(0); | 64 return(NULL); |
65 66 mask_perm = ACL_PERM_BITS; /* effective is regular if no mask */ 67 for (i = 0; i < acl->acl_cnt; i++) 68 if (acl->acl_entry[i].ae_tag == ACL_MASK) 69 mask_perm = acl->acl_entry[i].ae_perm; 70 71 for (i = 0; i < acl->acl_cnt; i++) { 72 ae_tag = acl->acl_entry[i].ae_tag; --- 140 unchanged lines hidden (view full) --- 213 if (len_p) { 214 *len_p = strlen(buf); 215 } 216 return (buf); 217 218error_label: 219 /* jump to here sets errno already, we just clean up */ 220 if (buf) free(buf); | 65 66 mask_perm = ACL_PERM_BITS; /* effective is regular if no mask */ 67 for (i = 0; i < acl->acl_cnt; i++) 68 if (acl->acl_entry[i].ae_tag == ACL_MASK) 69 mask_perm = acl->acl_entry[i].ae_perm; 70 71 for (i = 0; i < acl->acl_cnt; i++) { 72 ae_tag = acl->acl_entry[i].ae_tag; --- 140 unchanged lines hidden (view full) --- 213 if (len_p) { 214 *len_p = strlen(buf); 215 } 216 return (buf); 217 218error_label: 219 /* jump to here sets errno already, we just clean up */ 220 if (buf) free(buf); |
221 return (0); | 221 return (NULL); |
222} | 222} |