diff options
authorPeter Seebach <peter.seebach@windriver.com>2014-05-15 18:49:12 -0500
committerPeter Seebach <peter.seebach@windriver.com>2014-05-15 18:49:12 -0500
commit87c53ea58befef48677846693aab445df1850e16 (patch)
parent36689a76e79bf6e6231f6f03cbfad297d4411588 (diff)
fchmodat: don't pass AT_SYMLINK_NOFOLLOWseebs/xattr
underlying fchmodat() will just fail, but GNU tar calls it that way anyway, figuring it'll just retry on failure, but we don't report the failure. Nor do we want to, because that's expensive and slow and will result in additional database round trips. But I don't want to fail out right away, so for now, just strip the flag.
2 files changed, 12 insertions, 1 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt
index d4fdeec..27a6fcf 100644
--- a/ChangeLog.txt
+++ b/ChangeLog.txt
@@ -1,3 +1,9 @@
+ * (seebs) drop flags when calling fchmodat() to appease GNU tar.
+ * (seebs) extended attribute support
* (seebs) mknod wasn't calling mknodat.
* (seebs) mkdirat wasn't recording the logical DB mode for directories
diff --git a/ports/unix/guts/fchmodat.c b/ports/unix/guts/fchmodat.c
index 36a8490..c18fd4c 100644
--- a/ports/unix/guts/fchmodat.c
+++ b/ports/unix/guts/fchmodat.c
@@ -54,7 +54,12 @@
* specified, we already bailed previously. */
real_chmod(path, PSEUDO_FS_MODE(mode, S_ISDIR(buf.st_mode)));
- real_fchmodat(dirfd, path, PSEUDO_FS_MODE(mode, S_ISDIR(buf.st_mode)), flags);
+ /* AT_SYMLINK_NOFOLLOW isn't supported by fchmodat. GNU tar
+ * tries to use it anyway, figuring it can just retry if that
+ * fails. But we never fail, so they don't retry. So we drop
+ * the flag here.
+ */
+ real_fchmodat(dirfd, path, PSEUDO_FS_MODE(mode, S_ISDIR(buf.st_mode)), 0);
/* we ignore a failure from underlying fchmod, because pseudo
* may believe you are permitted to change modes that the filesystem