summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgfxmonk <tim@gfxmonk.net>2012-01-22 15:10:42 +1100
committergfxmonk <tim@gfxmonk.net>2012-01-23 20:08:47 +1100
commitd9a4ab87aca1d9484fe89085bf310591171412d8 (patch)
treee83f8a27fe716b91468707942aebe6225acfdc11
parent559d249aa98d41993b5fb7f37afaa1ce57a3523a (diff)
downloadxattr-d9a4ab87aca1d9484fe89085bf310591171412d8.tar.gz
fixed logic error that prevented XATTR_NOFOLLOW flag from being respected when setting attributes
-rw-r--r--xattr/_xattr.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/xattr/_xattr.c b/xattr/_xattr.c
index 630ec1d..ca794ee 100644
--- a/xattr/_xattr.c
+++ b/xattr/_xattr.c
@@ -80,7 +80,7 @@ static ssize_t xattr_setxattr(const char *path, const char *name,
return -1;
}
- if (options & XATTR_XATTR_NOFOLLOW) {
+ if (nofollow) {
rv = extattr_set_link(path, EXTATTR_NAMESPACE_USER,
name, value, size);
}
@@ -175,7 +175,7 @@ static ssize_t xattr_fsetxattr(int fd, const char *name, void *value,
return -1;
}
- if (options & XATTR_XATTR_NOFOLLOW) {
+ if (nofollow) {
return -1;
}
else {
@@ -447,7 +447,7 @@ static ssize_t xattr_setxattr(const char *path, const char *name, void *value, s
} else if (options != 0) {
return -1;
}
- if (options & XATTR_XATTR_NOFOLLOW) {
+ if (nofollow) {
return lsetxattr(path, name, value, size, options);
} else {
return setxattr(path, name, value, size, options);