diff options
author | Rob Landley <rob@landley.net> | 2006-06-13 14:54:42 +0000 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2006-06-13 14:54:42 +0000 |
commit | 9a202c9daaac25296129d1b2d63fedd28efe4a0d (patch) | |
tree | 906c371755ccc1abb19955b43cf91f318bf2c891 /archival/gunzip.c | |
parent | 1dea55d577641540bfc85f1d969667d89539ef6d (diff) | |
download | busybox-w32-9a202c9daaac25296129d1b2d63fedd28efe4a0d.tar.gz busybox-w32-9a202c9daaac25296129d1b2d63fedd28efe4a0d.tar.bz2 busybox-w32-9a202c9daaac25296129d1b2d63fedd28efe4a0d.zip |
Patch from Denis Vlasenko: unlzma was make files with mode 777. Tweak
everything to do stat() and use xopen3().
Diffstat (limited to 'archival/gunzip.c')
-rw-r--r-- | archival/gunzip.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/archival/gunzip.c b/archival/gunzip.c index 7b939290b..35449b04d 100644 --- a/archival/gunzip.c +++ b/archival/gunzip.c | |||
@@ -137,11 +137,8 @@ int gunzip_main(int argc, char **argv) | |||
137 | bb_error_msg_and_die("Invalid extension"); | 137 | bb_error_msg_and_die("Invalid extension"); |
138 | } | 138 | } |
139 | 139 | ||
140 | /* Open output file */ | 140 | /* Open output file (with correct permissions) */ |
141 | dst_fd = bb_xopen(new_path, O_WRONLY | O_CREAT); | 141 | dst_fd = bb_xopen3(new_path, O_WRONLY | O_CREAT, stat_buf.st_mode); |
142 | |||
143 | /* Set permissions on the file */ | ||
144 | chmod(new_path, stat_buf.st_mode); | ||
145 | 142 | ||
146 | /* If unzip succeeds remove the old file */ | 143 | /* If unzip succeeds remove the old file */ |
147 | delete_path = old_path; | 144 | delete_path = old_path; |