]> arthur.barton.de Git - netatalk.git/blob - include/atalk/acl.h
e639cfa6ac12b27053ba96901bcb3429b6d86e30
[netatalk.git] / include / atalk / acl.h
1 /*
2    Copyright (c) 2009 Frank Lahm <franklahm@gmail.com>
3
4    This program is free software; you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation; either version 2 of the License, or
7    (at your option) any later version.
8  
9    This program is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU General Public License for more details.
13 */
14
15 #ifndef ATALK_ACL_H
16 #define ATALK_ACL_H
17
18 #ifdef HAVE_CONFIG_H
19 #include "config.h"
20 #endif /* HAVE_CONFIG_H */
21
22 #ifdef HAVE_ACLS
23
24 #define O_NETATALK_ACL (O_NOFOLLOW << 1)
25
26 #ifdef HAVE_SOLARIS_ACLS
27 #include <sys/acl.h>
28 #endif
29 #ifdef HAVE_FREEBSD_SUNACL
30 #include <sunacl.h>
31 #endif
32
33 #ifdef HAVE_NFSV4_ACLS
34
35 #define chmod_acl nfsv4_chmod
36
37 extern int get_nfsv4_acl(const char *name, ace_t **retAces);
38 extern int strip_trivial_aces(ace_t **saces, int sacecount);
39 extern int strip_nontrivial_aces(ace_t **saces, int sacecount);
40 extern ace_t *concat_aces(ace_t *aces1, int ace1count, ace_t *aces2, int ace2count);
41 extern int nfsv4_chmod(char *name, mode_t mode);
42
43 #endif  /* HAVE_NFSV4_ACLS */
44
45 #ifdef HAVE_POSIX_ACLS
46 #include <sys/types.h>
47 #include <sys/stat.h>
48 #include <sys/acl.h>
49
50 #define chmod_acl posix_chmod
51 #define fchmod_acl posix_fchmod
52
53 extern int posix_chmod(const char *name, mode_t mode);
54 extern int posix_fchmod(int fd, mode_t mode);
55
56 #endif /* HAVE_POSIX_ACLS */
57
58 extern int remove_acl_vfs(const char *name);
59
60 #else /* HAVE_ACLS=no */
61
62 #define O_NETATALK_ACL 0
63 #define chmod_acl chmod
64
65 #endif /* HAVE_ACLS */
66
67 #endif /* ATALK_ACL_H */