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 4369c6e..39554e9 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 5c989ed..9b53896 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 97b713b..7628d68 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 2188dc3..e5cf2f4 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)