Deleted Added
full compact
acl_entry.c (208782) acl_entry.c (208783)
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 208782 2010-06-03 14:15:08Z trasz $");
28__FBSDID("$FreeBSD: head/lib/libc/posix1e/acl_entry.c 208783 2010-06-03 14:16:58Z 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>

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

50 }
51
52 acl_int = &(*acl_p)->ats_acl;
53
54 /*
55 * +1, because we are checking if there is space left for one more
56 * entry.
57 */
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>

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

50 }
51
52 acl_int = &(*acl_p)->ats_acl;
53
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)) {
58 if (acl_int->acl_cnt + 1 >= ACL_MAX_ENTRIES) {
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;

--- 80 unchanged lines hidden ---
59 errno = EINVAL;
60 return (-1);
61 }
62
63 *entry_p = &acl_int->acl_entry[acl_int->acl_cnt++];
64
65 (**entry_p).ae_tag = ACL_UNDEFINED_TAG;
66 (**entry_p).ae_id = ACL_UNDEFINED_ID;

--- 80 unchanged lines hidden ---