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
..
2015-02-14 00:56:46 +08:00
2014-11-19 10:39:05 -08:00
2013-12-03 18:42:41 -08:00
2013-12-03 18:42:41 -08:00
2014-11-06 11:16:55 -08:00
2015-04-09 14:56:26 -07:00
2015-01-26 11:57:11 -08:00
2014-09-11 08:45:46 -07:00
2013-02-01 14:51:19 -08:00
2014-08-22 10:23:12 -07:00
2015-02-14 00:56:46 +08:00
2015-02-14 00:56:46 +08:00
2014-12-03 15:55:34 -08:00
2014-04-10 20:44:27 -07:00
2014-02-21 16:27:21 +00:00
2015-01-21 10:33:30 -08:00
2014-11-06 14:14:37 -08:00
2014-12-04 11:01:28 -08:00
2014-01-03 14:49:37 -08:00
2015-04-06 19:05:58 -07:00
2014-12-03 15:55:34 -08:00