bionic/libc
Nick Kralevich 2825f10b7f 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

Change-Id: Ic0cdf9f9dd0e35a63b44a4c4a08400020041eddf
2015-06-01 15:51:56 -07:00
..
arch-arm libc: Add O_PATH support for fgetxattr / fsetxattr 2015-06-01 15:51:56 -07:00
arch-arm64 libc: Add O_PATH support for fgetxattr / fsetxattr 2015-06-01 15:51:56 -07:00
arch-common/bionic Properly align init/fini_arrays for crtend.o 2015-05-07 11:57:53 -07:00
arch-mips libc: Add O_PATH support for fgetxattr / fsetxattr 2015-06-01 15:51:56 -07:00
arch-mips64 libc: Add O_PATH support for fgetxattr / fsetxattr 2015-06-01 15:51:56 -07:00
arch-x86 libc: Add O_PATH support for fgetxattr / fsetxattr 2015-06-01 15:51:56 -07:00
arch-x86_64 libc: Add O_PATH support for fgetxattr / fsetxattr 2015-06-01 15:51:56 -07:00
bionic libc: Add O_PATH support for fgetxattr / fsetxattr 2015-06-01 15:51:56 -07:00
dns Make ThreadLocalBuffer a class rather than a macro. 2015-03-31 10:56:58 -07:00
include remove rootdir build.prop 2015-05-08 22:13:15 +00:00
kernel Update the search path for libclang.so 2015-04-22 10:47:01 -07:00
private ScopedFd: Don't use TEMP_FAILURE_RETRY() with close() 2015-05-13 13:27:11 -07:00
stdio Don't use TEMP_FAILURE_RETRY on close in bionic. 2015-05-15 16:20:07 -07:00
stdlib Unregister pthread_atfork handlers on dlclose() 2015-04-24 17:57:37 -07:00
tools Fix various bugs in the check-symbols script. 2015-05-11 12:10:40 -07:00
tzcode Changes to re-enable overrides for tz data 2015-03-25 16:08:37 +00:00
upstream-dlmalloc Return total footprint, not high water mark. 2014-10-13 12:45:35 -07:00
upstream-freebsd Clean up <stdlib.h> slightly. 2015-01-26 14:28:41 -08:00
upstream-netbsd Remove bogus transitive includes. 2014-12-29 13:29:50 -08:00
upstream-openbsd Unregister pthread_atfork handlers on dlclose() 2015-04-24 17:57:37 -07:00
zoneinfo Update to tzdata 2015d 2015-04-28 17:11:03 +01:00
Android.mk libc: Add O_PATH support for fgetxattr / fsetxattr 2015-06-01 15:51:56 -07:00
crt.mk Make .note.android.ident section type SH_NOTE 2015-02-12 21:37:20 -08:00
MODULE_LICENSE_BSD
NOTICE Update NOTICE files (the second time today). 2015-05-12 10:44:37 -07:00
SYSCALLS.TXT libc: Add O_PATH support for fgetxattr / fsetxattr 2015-06-01 15:51:56 -07:00
version_script.txt Revert "Fix volantis boot." 2015-05-07 15:12:24 -07:00