Deleted Added
full compact
acl_init.c (92986) acl_init.c (192586)
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

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

24 * SUCH DAMAGE.
25 */
26/*
27 * acl_init -- return a fresh acl structure
28 * acl_dup -- duplicate an acl and return the new copy
29 */
30
31#include <sys/cdefs.h>
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

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

24 * SUCH DAMAGE.
25 */
26/*
27 * acl_init -- return a fresh acl structure
28 * acl_dup -- duplicate an acl and return the new copy
29 */
30
31#include <sys/cdefs.h>
32__FBSDID("$FreeBSD: head/lib/libc/posix1e/acl_init.c 92986 2002-03-22 21:53:29Z obrien $");
32__FBSDID("$FreeBSD: head/lib/libc/posix1e/acl_init.c 192586 2009-05-22 15:56:43Z trasz $");
33
34#include <sys/types.h>
35#include "namespace.h"
36#include <sys/acl.h>
37#include "un-namespace.h"
38#include <errno.h>
39#include <stdlib.h>
40#include <string.h>

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

49 return (NULL);
50 }
51 if (count < 0) {
52 errno = EINVAL;
53 return (NULL);
54 }
55
56 acl = malloc(sizeof(struct acl_t_struct));
33
34#include <sys/types.h>
35#include "namespace.h"
36#include <sys/acl.h>
37#include "un-namespace.h"
38#include <errno.h>
39#include <stdlib.h>
40#include <string.h>

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

49 return (NULL);
50 }
51 if (count < 0) {
52 errno = EINVAL;
53 return (NULL);
54 }
55
56 acl = malloc(sizeof(struct acl_t_struct));
57 if (acl != NULL)
57 if (acl != NULL) {
58 bzero(acl, sizeof(struct acl_t_struct));
58 bzero(acl, sizeof(struct acl_t_struct));
59 acl->ats_acl.acl_maxcnt = ACL_MAX_ENTRIES;
60 }
59
60 return (acl);
61}
62
63acl_t
64acl_dup(acl_t acl)
65{
66 acl_t acl_new;
67
68 acl_new = acl_init(ACL_MAX_ENTRIES);
69 if (acl_new != NULL) {
70 *acl_new = *acl;
71 acl->ats_cur_entry = 0;
72 acl_new->ats_cur_entry = 0;
73 }
74
75 return (acl_new);
76}
61
62 return (acl);
63}
64
65acl_t
66acl_dup(acl_t acl)
67{
68 acl_t acl_new;
69
70 acl_new = acl_init(ACL_MAX_ENTRIES);
71 if (acl_new != NULL) {
72 *acl_new = *acl;
73 acl->ats_cur_entry = 0;
74 acl_new->ats_cur_entry = 0;
75 }
76
77 return (acl_new);
78}