svn commit: trunk/busybox/archival/libunarchive
landley at busybox.net
landley at busybox.net
Fri Aug 4 17:26:59 UTC 2006
Author: landley
Date: 2006-08-04 10:26:58 -0700 (Fri, 04 Aug 2006)
New Revision: 15775
Log:
Use xopen3() instead of an after-the-fact chown.
Modified:
trunk/busybox/archival/libunarchive/data_extract_all.c
Changeset:
Modified: trunk/busybox/archival/libunarchive/data_extract_all.c
===================================================================
--- trunk/busybox/archival/libunarchive/data_extract_all.c 2006-08-04 05:24:58 UTC (rev 15774)
+++ trunk/busybox/archival/libunarchive/data_extract_all.c 2006-08-04 17:26:58 UTC (rev 15775)
@@ -58,7 +58,8 @@
switch(file_header->mode & S_IFMT) {
case S_IFREG: {
/* Regular file */
- dst_fd = xopen(file_header->name, O_WRONLY | O_CREAT | O_EXCL);
+ dst_fd = xopen3(file_header->name, O_WRONLY | O_CREAT | O_EXCL,
+ file_header->mode);
bb_copyfd_size(archive_handle->src_fd, dst_fd, file_header->size);
close(dst_fd);
break;
@@ -93,11 +94,6 @@
if (!(archive_handle->flags & ARCHIVE_NOPRESERVE_OWN)) {
lchown(file_header->name, file_header->uid, file_header->gid);
}
- if (!(archive_handle->flags & ARCHIVE_NOPRESERVE_PERM) &&
- (file_header->mode & S_IFMT) != S_IFLNK)
- {
- chmod(file_header->name, file_header->mode);
- }
if (archive_handle->flags & ARCHIVE_PRESERVE_DATE) {
struct utimbuf t;
More information about the busybox-cvs
mailing list