X-Git-Url: https://mattmccutchen.net/rsync/rsync.git/blobdiff_plain/17cc4c383b7548ea75e6f615659943b49e941cdf..4403b1332f3264e357a46c1c96853a809dcfcaf8:/lib/sysxattrs.c diff --git a/lib/sysxattrs.c b/lib/sysxattrs.c index 76b6802d..d55ee0c2 100644 --- a/lib/sysxattrs.c +++ b/lib/sysxattrs.c @@ -193,7 +193,7 @@ int sys_lsetxattr(const char *path, const char *name, const void *value, size_t size_t bufpos; mode_t mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP; - if ((attrfd = attropen(path, name, O_CREAT|O_WRONLY|O_NOFOLLOW, mode)) < 0) + if ((attrfd = attropen(path, name, O_CREAT|O_TRUNC|O_WRONLY, mode)) < 0) return -1; for (bufpos = 0; bufpos < size; ) { @@ -217,7 +217,7 @@ int sys_lremovexattr(const char *path, const char *name) int attrdirfd; int ret; - if ((attrdirfd = attropen(path, ".", O_RDWR)) < 0) + if ((attrdirfd = attropen(path, ".", O_RDONLY)) < 0) return -1; ret = unlinkat(attrdirfd, name, 0);