mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-11 09:50:12 +00:00
Preserve ownership if cpio is run as root.
This commit is contained in:
parent
ded2471528
commit
af03c60c06
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=180328
@ -111,7 +111,8 @@ 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;
|
||||
/* TODO: If run by root, set owner as well. */
|
||||
if (geteuid() == 0)
|
||||
cpio->extract_flags |= ARCHIVE_EXTRACT_OWNER;
|
||||
cpio->bytes_per_block = 512;
|
||||
cpio->filename = NULL;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user