|
Last change
on this file was
2,
checked in by jglee, 11 years ago
|
|
first commit
|
-
Property svn:executable set to
*
|
|
File size:
1.1 KB
|
| Line | |
|---|
| 1 | /* |
|---|
| 2 | File: linux/xattr_acl.h |
|---|
| 3 | |
|---|
| 4 | (extended attribute representation of access control lists) |
|---|
| 5 | |
|---|
| 6 | (C) 2000 Andreas Gruenbacher, <a.gruenbacher@computer.org> |
|---|
| 7 | */ |
|---|
| 8 | |
|---|
| 9 | #ifndef _LINUX_XATTR_ACL_H |
|---|
| 10 | #define _LINUX_XATTR_ACL_H |
|---|
| 11 | |
|---|
| 12 | #include <asm/types.h> |
|---|
| 13 | |
|---|
| 14 | #include <linux/posix_acl.h> |
|---|
| 15 | |
|---|
| 16 | #define XATTR_NAME_ACL_ACCESS "system.posix_acl_access" |
|---|
| 17 | #define XATTR_NAME_ACL_DEFAULT "system.posix_acl_default" |
|---|
| 18 | |
|---|
| 19 | #define XATTR_ACL_VERSION 0x0002 |
|---|
| 20 | |
|---|
| 21 | typedef struct { |
|---|
| 22 | __u16 e_tag; |
|---|
| 23 | __u16 e_perm; |
|---|
| 24 | __u32 e_id; |
|---|
| 25 | } xattr_acl_entry; |
|---|
| 26 | |
|---|
| 27 | typedef struct { |
|---|
| 28 | __u32 a_version; |
|---|
| 29 | xattr_acl_entry a_entries[0]; |
|---|
| 30 | } xattr_acl_header; |
|---|
| 31 | |
|---|
| 32 | static inline size_t xattr_acl_size(int count) |
|---|
| 33 | { |
|---|
| 34 | return sizeof(xattr_acl_header) + count * sizeof(xattr_acl_entry); |
|---|
| 35 | } |
|---|
| 36 | |
|---|
| 37 | static inline int xattr_acl_count(size_t size) |
|---|
| 38 | { |
|---|
| 39 | if (size < sizeof(xattr_acl_header)) |
|---|
| 40 | return -1; |
|---|
| 41 | size -= sizeof(xattr_acl_header); |
|---|
| 42 | if (size % sizeof(xattr_acl_entry)) |
|---|
| 43 | return -1; |
|---|
| 44 | return size / sizeof(xattr_acl_entry); |
|---|
| 45 | } |
|---|
| 46 | |
|---|
| 47 | struct posix_acl * posix_acl_from_xattr(const void *value, size_t size); |
|---|
| 48 | int posix_acl_to_xattr(const struct posix_acl *acl, void *buffer, size_t size); |
|---|
| 49 | |
|---|
| 50 | |
|---|
| 51 | |
|---|
| 52 | #endif /* _LINUX_XATTR_ACL_H */ |
|---|
Note: See
TracBrowser
for help on using the repository browser.