[Toybox] fgetxattr with O_PATH
enh
enh at google.com
Tue Jun 2 22:08:25 PDT 2015
https://android-review.googlesource.com/#/c/152663/
libc: Add O_PATH support for fgetxattr / fsetxattr Support O_PATH file
descriptors when handling fgetxattr and fsetxattr. This avoids requiring
file read access to pull extended attributes. This is needed to support
O_PATH file descriptors when calling SELinux's fgetfilecon() call. In
particular, this allows the querying and setting of SELinux file context by
using something like the following code: int dirfd = open("/path/to/dir",
O_DIRECTORY); int fd = openat(dirfd, "file", O_PATH | O_NOFOLLOW); char
*context; fgetfilecon(fd, &context); This change was motivated by a comment
in https://android-review.googlesource.com/#/c/152680/1/toys/posix/ls.c
--
Elliott Hughes - http://who/enh - http://jessies.org/~enh/
Android native code/tools questions? Mail me/drop by/add me as a reviewer.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.landley.net/pipermail/toybox-landley.net/attachments/20150602/4878bae5/attachment-0003.htm>
More information about the Toybox
mailing list