From 24ebca61a3a0f10d6cd2800b188b3c034d1c4755 Mon Sep 17 00:00:00 2001 From: Ondrej Oprala Date: Tue, 7 Aug 2012 16:56:52 +0200 Subject: cp: fix the --no-preserve=mode option The --no-preserve=mode option did not do what its name implies: it would mistakenly preserve permission mode bits. * NEWS: Mention the fix. * TODO: Remove an entry. * src/copy.c (copy_reg): Add a condition to properly handle the --no-preserve=mode option for files (copy_internal): Add a condition to properly handle the --no-preserve=mode option for directories. * src/copy.h (struct cp_options): Add a new boolean. * src/cp.c (cp_option_init,decode_preserve_arg): Set the new boolean value according to specified options. * src/install.c (struct cp_options): Initialize the new boolean. * src/mv.c (struct cp_options): Initialize the new boolean. * tests/cp/preserve-mode.sh: Add a new test. * tests/cp/link-preserve.sh (-a --no-preserve=mode): Adjust the expected perms: now, --no-preserve=mode overrides the --preserve=mode that is inherent in -a, as it should. * tests/local.mk: Add the new test to the list. --- tests/local.mk | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/local.mk') diff --git a/tests/local.mk b/tests/local.mk index 55700b532..0b6d576f8 100644 --- a/tests/local.mk +++ b/tests/local.mk @@ -434,6 +434,7 @@ all_tests = \ tests/cp/perm.sh \ tests/cp/preserve-2.sh \ tests/cp/preserve-link.sh \ + tests/cp/preserve-mode.sh \ tests/cp/preserve-slink-time.sh \ tests/cp/proc-short-read.sh \ tests/cp/proc-zero-len.sh \ -- cgit v1.2.3-54-g00ecf