diff options
author | kientzle <kientzle@FreeBSD.org> | 2008-07-30 03:35:45 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2008-07-30 03:35:45 +0000 |
commit | 1e5899ea8b9164e8360d3fda61a0c134471ce14f (patch) | |
tree | 5d17ea0923ea9ff1b8e03fa360eb8506ef5c3725 /usr.bin/cpio/cpio.c | |
parent | a3f8092a7b2a46172361ff2cacba5858162a9630 (diff) | |
download | FreeBSD-src-1e5899ea8b9164e8360d3fda61a0c134471ce14f.zip FreeBSD-src-1e5899ea8b9164e8360d3fda61a0c134471ce14f.tar.gz |
MfP4: Preserve permissions by default.
In particular, this fixes the oddity that -dumpl would apply
umask to copied dirs (which are created in the target tree)
but not to "copied" files (which are only linked). After
this change:
$ ls -ld a a/b a/b/c
d--x-w-r-- 3 tim tim 512 Jul 29 20:08 a
drwxr----x 3 tim tim 512 Jul 29 20:09 a/b
dr----x-w- 2 tim tim 512 Jul 29 20:09 a/b/c
$ (echo a; echo a/b; echo a/b/c) | cpio -dumpl o
$ cd o
$ ls -ld a a/b a/b/c
d--x-w-r-- 3 tim tim 512 Jul 29 20:08 a
drwxr----x 3 tim tim 512 Jul 29 20:09 a/b
dr----x-w- 2 tim tim 512 Jul 29 20:09 a/b/c
Diffstat (limited to 'usr.bin/cpio/cpio.c')
-rw-r--r-- | usr.bin/cpio/cpio.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/usr.bin/cpio/cpio.c b/usr.bin/cpio/cpio.c index 991e871..d79003f 100644 --- a/usr.bin/cpio/cpio.c +++ b/usr.bin/cpio/cpio.c @@ -111,6 +111,7 @@ main(int argc, char *argv[]) cpio->extract_flags |= ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER; cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_SYMLINKS; cpio->extract_flags |= ARCHIVE_EXTRACT_SECURE_NODOTDOT; + cpio->extract_flags |= ARCHIVE_EXTRACT_PERM; if (geteuid() == 0) cpio->extract_flags |= ARCHIVE_EXTRACT_OWNER; cpio->bytes_per_block = 512; |