|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef _GL_ACL_H |
|
|
#define _GL_ACL_H 1 |
|
|
|
|
|
|
|
|
#if !_GL_CONFIG_H_INCLUDED |
|
|
#error "Please include config.h first." |
|
|
#endif |
|
|
|
|
|
#include <sys/types.h> |
|
|
#include <sys/stat.h> |
|
|
|
|
|
#ifdef __cplusplus |
|
|
extern "C" { |
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
enum |
|
|
{ |
|
|
|
|
|
ACL_GET_SCONTEXT = 0x10000, |
|
|
|
|
|
|
|
|
ACL_SYMLINK_FOLLOW = 0x20000, |
|
|
}; |
|
|
|
|
|
|
|
|
struct aclinfo |
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
char *buf; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ssize_t size; |
|
|
|
|
|
|
|
|
char *scontext; |
|
|
|
|
|
|
|
|
int scontext_err; |
|
|
|
|
|
union |
|
|
{ |
|
|
|
|
|
int err; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
char __gl_acl_ch[152]; |
|
|
} u; |
|
|
}; |
|
|
|
|
|
bool acl_errno_valid (int) _GL_ATTRIBUTE_CONST; |
|
|
int file_has_acl (char const *, struct stat const *); |
|
|
int file_has_aclinfo (char const *restrict, struct aclinfo *restrict, int); |
|
|
int fdfile_has_aclinfo (int, char const *restrict, |
|
|
struct aclinfo *restrict, int); |
|
|
|
|
|
#if HAVE_LINUX_XATTR_H && HAVE_LISTXATTR |
|
|
bool aclinfo_has_xattr (struct aclinfo const *, char const *) |
|
|
_GL_ATTRIBUTE_PURE; |
|
|
void aclinfo_free (struct aclinfo *); |
|
|
#else |
|
|
# define aclinfo_has_xattr(ai, xattr) false |
|
|
# define aclinfo_free(ai) ((void) 0) |
|
|
#endif |
|
|
#if (HAVE_LINUX_XATTR_H && HAVE_LISTXATTR \ |
|
|
&& (HAVE_SMACK || USE_SELINUX_SELINUX_H)) |
|
|
void aclinfo_scontext_free (char *); |
|
|
#else |
|
|
# define aclinfo_scontext_free(s) ((void) 0) |
|
|
#endif |
|
|
|
|
|
int qset_acl (char const *, int, mode_t); |
|
|
int xset_acl (char const *, int, mode_t); |
|
|
|
|
|
_GL_ATTRIBUTE_DEPRECATED int set_acl (char const *, int, mode_t); |
|
|
|
|
|
int qcopy_acl (char const *, int, char const *, int, mode_t); |
|
|
int xcopy_acl (char const *, int, char const *, int, mode_t); |
|
|
|
|
|
_GL_ATTRIBUTE_DEPRECATED int copy_acl (char const *, int, char const *, int, |
|
|
mode_t); |
|
|
|
|
|
int chmod_or_fchmod (char const *, int, mode_t); |
|
|
|
|
|
|
|
|
#ifdef __cplusplus |
|
|
} |
|
|
#endif |
|
|
|
|
|
#endif |
|
|
|