Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
fa5a06a
)
Always use lchmod() if it is available.
author
Wayne Davison
<wayned@samba.org>
Thu, 31 Dec 2009 22:10:38 +0000
(14:10 -0800)
committer
Wayne Davison
<wayned@samba.org>
Thu, 31 Dec 2009 22:10:38 +0000
(14:10 -0800)
syscall.c
patch
|
blob
|
blame
|
history
diff --git
a/syscall.c
b/syscall.c
index
945a11d
..
aba0009
100644
(file)
--- a/
syscall.c
+++ b/
syscall.c
@@
-195,10
+195,11
@@
int do_chmod(const char *path, mode_t mode)
int code;
if (dry_run) return 0;
RETURN_ERROR_IF_RO_OR_LO;
int code;
if (dry_run) return 0;
RETURN_ERROR_IF_RO_OR_LO;
- if (S_ISLNK(mode)) {
#ifdef HAVE_LCHMOD
#ifdef HAVE_LCHMOD
- code = lchmod(path, mode & CHMOD_BITS);
-#elif defined HAVE_SETATTRLIST
+ code = lchmod(path, mode & CHMOD_BITS);
+#else
+ if (S_ISLNK(mode)) {
+# if defined HAVE_SETATTRLIST
struct attrlist attrList;
uint32_t m = mode & CHMOD_BITS; /* manpage is wrong: not mode_t! */
struct attrlist attrList;
uint32_t m = mode & CHMOD_BITS; /* manpage is wrong: not mode_t! */
@@
-206,11
+207,12
@@
int do_chmod(const char *path, mode_t mode)
attrList.bitmapcount = ATTR_BIT_MAP_COUNT;
attrList.commonattr = ATTR_CMN_ACCESSMASK;
code = setattrlist(path, &attrList, &m, sizeof m, FSOPT_NOFOLLOW);
attrList.bitmapcount = ATTR_BIT_MAP_COUNT;
attrList.commonattr = ATTR_CMN_ACCESSMASK;
code = setattrlist(path, &attrList, &m, sizeof m, FSOPT_NOFOLLOW);
-#else
+#
else
code = 1;
code = 1;
-#endif
+#
endif
} else
code = chmod(path, mode & CHMOD_BITS); /* DISCOURAGED FUNCTION */
} else
code = chmod(path, mode & CHMOD_BITS); /* DISCOURAGED FUNCTION */
+#endif /* !HAVE_LCHMOD */
if (code != 0 && (preserve_perms || preserve_executability))
return code;
return 0;
if (code != 0 && (preserve_perms || preserve_executability))
return code;
return 0;