Make do_chmod() report an error with -E.
authorWayne Davison <wayned@samba.org>
Sat, 26 Jan 2008 00:51:10 +0000 (16:51 -0800)
committerWayne Davison <wayned@samba.org>
Sat, 26 Jan 2008 00:57:02 +0000 (16:57 -0800)
syscall.c
t_unsafe.c
tls.c
trimslash.c

index 4369c6e391dcfecfda2e053c43d890ffda70e8ce..39554e95844fb799834f50451195d367d8d467dd 100644 (file)
--- a/syscall.c
+++ b/syscall.c
@@ -34,6 +34,7 @@ extern int am_root;
 extern int read_only;
 extern int list_only;
 extern int preserve_perms;
+extern int preserve_executability;
 
 #define RETURN_ERROR_IF(x,e) \
        do { \
@@ -167,7 +168,7 @@ int do_chmod(const char *path, mode_t mode)
 #endif
        } else
                code = chmod(path, mode & CHMOD_BITS);
-       if (code != 0 && preserve_perms)
+       if (code != 0 && (preserve_perms || preserve_executability))
            return code;
        return 0;
 }
index 5c989ed2df77055b9be7d7b64061dd766e4fae7b..9b5389687f36625ef197cd9174759fc8916eef1f 100644 (file)
@@ -29,6 +29,7 @@ int read_only = 0;
 int list_only = 0;
 int verbose = 0;
 int preserve_perms = 0;
+int preserve_executability = 0;
 
 int
 main(int argc, char **argv)
diff --git a/tls.c b/tls.c
index 97b713be06ef33f7e99a38fb10a569dacf19573d..7628d688113e5c886bd392cda01e529381638fdc 100644 (file)
--- a/tls.c
+++ b/tls.c
@@ -46,6 +46,7 @@ int am_root = 0;
 int read_only = 1;
 int list_only = 0;
 int preserve_perms = 0;
+int preserve_executability = 0;
 
 #ifdef SUPPORT_XATTRS
 
index 2188dc33dda62cd6ecc9c960690e1325cf9e0dda..e5cf2f4c8d5c6baeae71020893f6c591cf97d22a 100644 (file)
@@ -26,6 +26,7 @@ int am_root = 0;
 int read_only = 1;
 int list_only = 0;
 int preserve_perms = 0;
+int preserve_executability = 0;
 
 int
 main(int argc, char **argv)