--- cpio-2.9.90/src/copyin.c.bak 2008-10-03 19:41:08.420456873 +0300 +++ cpio-2.9.90/src/copyin.c 2008-10-03 19:59:11.634455457 +0300 @@ -373,12 +373,12 @@ create_final_defers () continue; } out_file_des = open (d->header.c_name, - O_CREAT | O_WRONLY | O_BINARY, 0600); + O_EXCL | O_CREAT | O_WRONLY | O_BINARY, 0600); if (out_file_des < 0 && create_dir_flag) { create_all_directories (d->header.c_name); out_file_des = open (d->header.c_name, - O_CREAT | O_WRONLY | O_BINARY, + O_EXCL | O_CREAT | O_WRONLY | O_BINARY, 0600); } if (out_file_des < 0) @@ -481,13 +481,13 @@ copyin_regular_file (struct cpio_file_st /* If not linked, copy the contents of the file. */ out_file_des = open (file_hdr->c_name, - O_CREAT | O_WRONLY | O_BINARY, 0600); + O_EXCL | O_CREAT | O_WRONLY | O_BINARY, 0600); if (out_file_des < 0 && create_dir_flag) { create_all_directories (file_hdr->c_name); out_file_des = open (file_hdr->c_name, - O_CREAT | O_WRONLY | O_BINARY, + O_EXCL | O_CREAT | O_WRONLY | O_BINARY, 0600); } --- cpio-2.9.90/src/copypass.c.bak 2008-10-03 19:41:08.416455708 +0300 +++ cpio-2.9.90/src/copypass.c 2008-10-03 19:56:35.097455882 +0300 @@ -168,12 +168,12 @@ process_copy_pass () continue; } out_file_des = open (output_name.ds_string, - O_CREAT | O_WRONLY | O_BINARY, 0600); + O_EXCL | O_CREAT | O_WRONLY | O_BINARY, 0600); if (out_file_des < 0 && create_dir_flag) { create_all_directories (output_name.ds_string); out_file_des = open (output_name.ds_string, - O_CREAT | O_WRONLY | O_BINARY, 0600); + O_EXCL | O_CREAT | O_WRONLY | O_BINARY, 0600); } if (out_file_des < 0) {