acl_entry.c (192586) | acl_entry.c (192966) |
---|---|
1/* 2 * Copyright (c) 2001-2002 Chris D. Faulhaber 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) 2001-2002 Chris D. Faulhaber 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/lib/libc/posix1e/acl_entry.c 192586 2009-05-22 15:56:43Z trasz $"); | 28__FBSDID("$FreeBSD: head/lib/libc/posix1e/acl_entry.c 192966 2009-05-28 07:20:52Z trasz $"); |
29 30#include <sys/types.h> 31#include "namespace.h" 32#include <sys/acl.h> 33#include "un-namespace.h" 34 35#include <errno.h> 36#include <stdlib.h> --- 9 unchanged lines hidden (view full) --- 46 47 if (acl_p == NULL) { 48 errno = EINVAL; 49 return (-1); 50 } 51 52 acl_int = &(*acl_p)->ats_acl; 53 | 29 30#include <sys/types.h> 31#include "namespace.h" 32#include <sys/acl.h> 33#include "un-namespace.h" 34 35#include <errno.h> 36#include <stdlib.h> --- 9 unchanged lines hidden (view full) --- 46 47 if (acl_p == NULL) { 48 errno = EINVAL; 49 return (-1); 50 } 51 52 acl_int = &(*acl_p)->ats_acl; 53 |
54 if ((acl_int->acl_cnt >= ACL_MAX_ENTRIES) || (acl_int->acl_cnt < 0)) { | 54 /* 55 * +1, because we are checking if there is space left for one more 56 * entry. 57 */ 58 if ((acl_int->acl_cnt + 1 >= ACL_MAX_ENTRIES) || 59 (acl_int->acl_cnt < 0)) { |
55 errno = EINVAL; 56 return (-1); 57 } 58 59 *entry_p = &acl_int->acl_entry[acl_int->acl_cnt++]; 60 61 (**entry_p).ae_tag = ACL_UNDEFINED_TAG; 62 (**entry_p).ae_id = ACL_UNDEFINED_ID; --- 38 unchanged lines hidden --- | 60 errno = EINVAL; 61 return (-1); 62 } 63 64 *entry_p = &acl_int->acl_entry[acl_int->acl_cnt++]; 65 66 (**entry_p).ae_tag = ACL_UNDEFINED_TAG; 67 (**entry_p).ae_id = ACL_UNDEFINED_ID; --- 38 unchanged lines hidden --- |