summaryrefslogtreecommitdiffstats
path: root/bin/cp/cp.c
diff options
context:
space:
mode:
authorcsjp <csjp@FreeBSD.org>2005-09-05 04:36:08 +0000
committercsjp <csjp@FreeBSD.org>2005-09-05 04:36:08 +0000
commit549c6812a94339302b34e899ce15d452ed69ef23 (patch)
tree4d654ae429b6264f02e5490e9c9b223e74cd7b60 /bin/cp/cp.c
parent57d500e0a77c3bb556a8303725a9195b630c5771 (diff)
downloadFreeBSD-src-549c6812a94339302b34e899ce15d452ed69ef23.zip
FreeBSD-src-549c6812a94339302b34e899ce15d452ed69ef23.tar.gz
Attempt to complete the userspace integration of POSIX.1e extended ACLs.
This includes adding support for ACLs into cp(1) and mv(1) userspace utilities. For mv(1), if _PC_ACL_EXTENDED is in effect for the source AND destination operands, the destination file's ACLs shall reflect the source. For cp(1), if _PC_ACL_EXTENDED is in effect for both source and destination operands, and -p has been specified, the ACLs from the source shall be preserved on the destination. MFC after: 1 month
Diffstat (limited to 'bin/cp/cp.c')
-rw-r--r--bin/cp/cp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/bin/cp/cp.c b/bin/cp/cp.c
index bbf73cd..0d0040a 100644
--- a/bin/cp/cp.c
+++ b/bin/cp/cp.c
@@ -363,7 +363,10 @@ copy(char *argv[], enum op type, int fts_options)
*/
if (pflag) {
if (setfile(curr->fts_statp, -1))
- rval = 1;
+ rval = 1;
+ if (preserve_dir_acls(curr->fts_statp,
+ curr->fts_accpath, to.p_path) != 0)
+ rval = 1;
} else {
mode = curr->fts_statp->st_mode;
if ((mode & (S_ISUID | S_ISGID | S_ISTXT)) ||
OpenPOWER on IntegriCloud