Permalink
Browse files

(loopback) setxattr: pass XATTR_NOFOLLOW instead of flags

When a Finder copy creates a link and tries to set extended attributes on the
link before the linked file exists the copy process is aborted. Passing
XATTR_NOFOLLOW to setxattr prevents this.

Fix by Anatol Pomozov
  • Loading branch information...
1 parent abd8bca commit 2f819f15dc1d70330f6ccf3454f513c0fbb32462 @bfleischer bfleischer committed Feb 24, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 filesystems-c/loopback/loopback.c
@@ -597,10 +597,10 @@ loopback_setxattr(const char *path, const char *name, const char *value,
memcpy(new_name, A_KAUTH_FILESEC_XATTR, sizeof(A_KAUTH_FILESEC_XATTR));
memcpy(new_name, G_PREFIX, sizeof(G_PREFIX) - 1);
- res = setxattr(path, new_name, value, size, position, flags);
+ res = setxattr(path, new_name, value, size, position, XATTR_NOFOLLOW);
} else {
- res = setxattr(path, name, value, size, position, flags);
+ res = setxattr(path, name, value, size, position, XATTR_NOFOLLOW);
}
if (res == -1) {

0 comments on commit 2f819f1

Please sign in to comment.