1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21: #include <config.h>
22:
23: #include "acl.h"
24:
25: #include <stdbool.h>
26: #include <stdlib.h>
27:
28: #ifdef HAVE_ACL_LIBACL_H
29: # include <acl/libacl.h>
30: #endif
31:
32: #include "error.h"
33: #include "quote.h"
34:
35: #include <errno.h>
36: #ifndef ENOSYS
37: # define ENOSYS (-1)
38: #endif
39: #ifndef ENOTSUP
40: # define ENOTSUP (-1)
41: #endif
42:
43: #include "gettext.h"
44: #define _(msgid) gettext (msgid)
45:
46: #ifndef HAVE_FCHMOD
47: # define HAVE_FCHMOD false
48: # define fchmod(fd, mode) (-1)
49: #endif
50:
51: #ifndef MIN_ACL_ENTRIES
52: # define MIN_ACL_ENTRIES 4
53: #endif
54:
55:
56: #ifndef HAVE_ACL_GET_FD
57: # define HAVE_ACL_GET_FD false
58: # define acl_get_fd(fd) (NULL)
59: #endif
60:
61:
62: #ifndef HAVE_ACL_SET_FD
63: # define HAVE_ACL_SET_FD false
64: # define acl_set_fd(fd, acl) (-1)
65: #endif
66:
67:
68: #ifndef HAVE_ACL_EXTENDED_FILE
69: # define HAVE_ACL_EXTENDED_FILE false
70: # define acl_extended_file(name) (-1)
71: #endif
72:
73:
74: #ifndef HAVE_ACL_FROM_MODE
75: # define HAVE_ACL_FROM_MODE false
76: # define acl_from_mode(mode) (NULL)
77: #endif
78:
79: #define ACL_NOT_WELL_SUPPORTED(Errno) \
80: ((Errno) == ENOTSUP || (Errno) == ENOSYS || (Errno) == EINVAL)
81:
82:
83: #if USE_ACL && HAVE_ACL_GET_FILE && HAVE_ACL_FREE && !HAVE_ACL_ENTRIES
84: # define acl_entries rpl_acl_entries
85: int acl_entries (acl_t);
86: #endif