|
a/excludefile |
|
b/excludefile |
|
... |
|
... |
16 |
config.cache
|
16 |
config.cache
|
17 |
config.log
|
17 |
config.log
|
18 |
config.status
|
18 |
config.status
|
19 |
excludefile
|
19 |
excludefile
|
20 |
makesrcdist.sh
|
20 |
makesrcdist.sh
|
21 |
Sur linux, il faut explicitement enabler les xattr:
|
21 |
notes.txt
|
22 |
mount -o remount,user_xattr /home
|
|
|
23 |
ou
|
|
|
24 |
/dev/sda7 /home reiserfs acl,user_xattr 1 2
|
|
|
25 |
|
|
|
26 |
|
|
|
27 |
FreeBSD
|
|
|
28 |
|
|
|
29 |
#include <sys/types.h>
|
|
|
30 |
#include <sys/extattr.h>
|
|
|
31 |
#include <sys/uio.h>
|
|
|
32 |
|
|
|
33 |
ssize_t extattr_get_fd(int fd, int attrnamespace, const char *attrname,
|
|
|
34 |
void *data, size_t nbytes);
|
|
|
35 |
int extattr_set_fd(int fd, int attrnamespace, const char *attrname,
|
|
|
36 |
const void *data, size_t nbytes);
|
|
|
37 |
int extattr_delete_fd(int fd, int attrnamespace, const char *attrname);
|
|
|
38 |
ssize_t extattr_list_fd(int fd, int attrnamespace, void *data, size_t nbytes);
|
|
|
39 |
|
|
|
40 |
ssize_t extattr_get_file(const char *path, int attrnamespace,
|
|
|
41 |
const char *attrname, void *data, size_t nbytes);
|
|
|
42 |
etc.
|
|
|
43 |
ssize_t extattr_get_link(const char *path, int attrnamespace,
|
|
|
44 |
const char *attrname, void *data, size_t nbytes);
|
|
|
45 |
etc.
|
|
|
46 |
Namespaces are separate, not part of the name. 2 defined by default:
|
|
|
47 |
EXTATTR_NAMESPACE_USER, EXTATTR_NAMESPACE_SYSTEM
|
|
|
48 |
_get_() can get size by passing null buffer. Can also apparently read in
|
|
|
49 |
multiple chunks ?? to be checked.
|
|
|
50 |
|
|
|
51 |
Linux
|
|
|
52 |
|
|
|
53 |
#include <sys/types.h>
|
|
|
54 |
#include <attr/xattr.h>
|
|
|
55 |
|
|
|
56 |
ssize_t fgetxattr(int fd, const char *name, void *value, size_t size);
|
|
|
57 |
ssize_t flistxattr(int fd, char *list, size_t size);
|
|
|
58 |
int fsetxattr(int fd, const char *name, const void *value, size_t size,
|
|
|
59 |
int flags);
|
|
|
60 |
int fremovexattr(int fd, const char *name);
|
|
|
61 |
|
|
|
62 |
ssize_t getxattr(const char *path, const char *name, void *value, size_t size);
|
|
|
63 |
etc.
|
|
|
64 |
int lsetxattr(const char *path, const char *name, const void *value,
|
|
|
65 |
size_t size, int flags);
|
|
|
66 |
etc.
|
|
|
67 |
|
|
|
68 |
The namespace is part of the name "user.xxx.yy". Four predefined spaces:
|
|
|
69 |
security, system, trusted, user. So permissions depend on the name prefix.
|
|
|
70 |
The system namespace is used for implementing acls
|
|
|
71 |
|
|
|
72 |
get() can get size by passing buffer of size 0
|
|
|
73 |
|
|
|
74 |
The flags to "set" are XATTR_CREATE or XATTR_REPLACE. Default 0 means
|
|
|
75 |
create or replace as appropriate.
|
|
|
76 |
|
|
|
77 |
|
|
|
78 |
MacOSX
|
|
|
79 |
|
|
|
80 |
#include <sys/xattr.h>
|
|
|
81 |
|
|
|
82 |
ssize_t fgetxattr(int fd, const char *name, void *value, size_t size,
|
|
|
83 |
u_int32_t position, int options);
|
|
|
84 |
int fsetxattr(int fd, const char *name, void *value, size_t size,
|
|
|
85 |
u_int32_t position, int options);
|
|
|
86 |
int fremovexattr(int fd, const char *name, int options);
|
|
|
87 |
ssize_t flistxattr(int fd, char *namebuf, size_t size, int options);
|
|
|
88 |
|
|
|
89 |
ssize_t getxattr(const char *path, const char *name, void *value, size_t size,
|
|
|
90 |
u_int32_t position, int options);
|
|
|
91 |
etc.
|
|
|
92 |
|
|
|
93 |
- position is only used with the resource fork, else set to 0
|
|
|
94 |
- names are UTF-8. Max size
|
|
|
95 |
- get with size 0 returns actual size.
|
|
|
96 |
- options: XATTR_NOFOLLOW (all), XATTR_CREATE/XATTR_REPLACE (setxattr()
|
|
|
97 |
not set->either)
|
|
|
98 |
|
|
|
99 |
http://arstechnica.com/reviews/os/macosx-10-4.ars/7:
|
|
|
100 |
Apple recommends the use of a reverse-DNS naming scheme (e.g.,
|
|
|
101 |
com.apple.itunes.artist), but with the dots replaced with underscores
|
|
|
102 |
in order to avoid conflicting with the namespace convention used by
|
|
|
103 |
Cocoa's key/value coding system.
|
|
|
104 |
- Max name size 128 ?
|
|
|
105 |
|
|
|
106 |
There are apparently no predefined namespaces and no restrictions on names
|
|
|
107 |
|
|
|
108 |
Solaris
|
|
|
109 |
|
|
|