Age | Commit message (Collapse) | Author | Files |
|
|
|
modes.
* gnulib.modules: Replace utimens with fdutimensat.
* paxutils: Upgrade.
* src/copyin.c: Update calls to set_file_times.
(copyin_link,replace_symlink_placeholders): Call set_file_times if needed.
* src/copyout.c: Update calls to set_file_times.
* src/copypass.c (process_copy_pass): Update calls to set_file_times.
Call set_file_times to restore times of extracted symlinks.
* src/extern.h (set_file_times): Take additional argument.
* src/util.c
(set_file_times): Take additional argument. Use fdutimensat to do the
job.
* tests/linktime.at: New file.
* tests/linktime01.at: New file.
* tests/Makefile.am: Add new files.
* tests/testsuite.at: Include new tests.
|
|
|
|
In copy-out mode, when appending, change_dir() would be called twice,
because process_copy_in() calls change_dir(). If --directory=DIR was
used with a relative path, this would result in incorrectly trying to
change to DIR/DIR. To fix this, change_dir() is only called
explicitly when not appending.
Patch by Alyssa Ross <hi@alyssa.is>
* src/copyout.c (process_copy_out): Don't call change_dir if
append_flag is set: it is going to be called by process_copy_in.
|
|
Thus option is valid in copy-out mode. It instructs cpio to always
assume link count for directories to be 2. It is implied by
--reproducible.
* NEWS: Document changes.
* doc/cpio.1: Likewise.
* doc/cpio.texi: Likewise.
* src/copyout.c (process_copy_out): If ignore_dirnlink_option is set,
assume c_nlink is 2.
* src/extern.h (ignore_dirnlink_option): New extern.
* src/global.c (ignore_dirnlink_option): New global.
* src/main.c: New option --ignore-dirnlink.
The option --reproducible implies --ignore-dirnlink.
|
|
* src/copyout.c (read_for_checksum): Fix type of the file_size argument.
Rewrite the reading loop.
Original patch by Stefano Babic <sbabic@denx.de>
|
|
|
|
|
|
* src/dstring.c (ds_init): Take a single argument.
(ds_free): New function.
(ds_resize): Take a single argument. Use x2nrealloc to expand
the storage.
(ds_reset,ds_append,ds_concat,ds_endswith): New function.
(ds_fgetstr): Rewrite. In particular, this fixes integer overflow.
* src/dstring.h (dynamic_string): Keep both the allocated length
(ds_size) and index of the next free byte in the string (ds_idx).
(ds_init,ds_resize): Change signature.
(ds_len): New macro.
(ds_free,ds_reset,ds_append,ds_concat,ds_endswith): New protos.
* src/copyin.c: Use new ds_ functions.
* src/copyout.c: Likewise.
* src/copypass.c: Likewise.
* src/util.c: Likewise.
|
|
|
|
|
|
* src/copyout.c (to_ascii): Additional argument nul controls whether
to add the terminating nul character.
(field_width_error): Improve diagnostics: print the actual and the
maximum allowed field value.
* src/extern.h (to_ascii, field_width_error): New prototypes.
* src/tar.c (to_oct): Remove.
(to_oct_or_error): New function.
(TO_OCT): New macro.
(write_out_tar_header): Use TO_OCT and to_ascii. Return 0 on
success, 1 on error.
|
|
* src/copyin.c (long_format): Mark unchangeable argument as const.
(read_name_from_file): Use cpio_realloc_c_name.
(process_copy_in): Use CPIO_FILE_STAT_INITIALIZER.
Call cpio_file_stat_free before return.
* src/copyout.c (process_copy_out): Likewise.
* src/copypass.c (link_to_name): Mark unchangeable argument as const.
* src/cpiohdr.h (cpio_file_stat) <c_name_buflen>: New member,
<c_tar_linkname>: Mark as const.
(CPIO_FILE_STAT_INITIALIZER): New define.
(cpio_file_stat_init,cpio_file_stat_free)
(cpio_realloc_c_name): New protos.
* src/extern.h: Fix prototypes.
* src/makepath.c (make_path): Mark unchangeable argument as const.
* src/util.c (create_all_directories): Mark unchangeable argument
as const.
(cpio_realloc_c_name): New function.
(cpio_set_c_name): Use cpio_realloc_c_name.
(cpio_file_stat_init,cpio_file_stat_free): New functions.
|
|
|
|
Ensure that cpio_safer_name_suffix always works with dynamically
allocated buffer, and that it has size of at least 32 bytes.
Then, any call to cpio_safer_name_suffix is safe (it requires at
least 2 bytes in the buffer).
Also ensure that c_namesize is always correctly initialized (by
cpio_set_c_name) to avoid undefined behavior when reading
file_hdr.c_namesize (previously happened for tar archives).
References:
http://www.mail-archive.com/bug-cpio@gnu.org/msg00545.html
* src/copyin.c (query_rename): Drop the hack, as we now work with
dynamically allocated buffer. Use cpio_set_c_name.
(create_defered_links_to_skipped): Use cpio_set_c_name rather than
manual assignment.
(read_name_from_file): New function to avoid C&P.
(read_in_old_ascii, read_in_new_ascii, read_in_binary): Use
read_name_from_file.
(process_copy_in): Initialize file_hdr.c_namesize.
* src/copyout.c (process_copy_out): Use cpio_set_c_name.
* src/cpiohdr.h (cpio_set_c_name): New prototype.
* src/tar.c (read_in_tar_header): Use cpio_set_c_name.
* src/util.c (cpio_set_c_name): New function to set
file_hdr->c_name and c_namesize from arbitrary string.
(cpio_safer_name_suffix): Some docs fixes.
* tests/inout.at: Also test copy-in, and try various formats.
|
|
|
|
|
|
|
|
|
|
* src/cpiohdr.h (cpio_file_stat) <c_chksum>: Change type to
uint32_t.
* src/extern.h (crc): Change type to uint32_t.
* src/global.c: Likewise.
* src/copyout.c (read_for_checksum): Return uint32_t.
* src/copyin.c: Fix printf formats.
|
|
* src/copyout.c (count_defered_links_to_dev_ino): Return size_t.
(last_link): Do not use superfluous local variable.
* src/util.c (copy_files_disk_to_tape)
(copy_files_disk_to_disk): Shut down gcc warnings.
|
|
* src/copyin.c (process_copy_in): Call change_dir.
* src/copyout.c (process_copy_out): Likewise.
* src/copypass.c (process_copy_pass): Likewise.
* src/extern.h (change_directory_option): New extern.
(change_dir): New proto.
* src/global.c (change_directory_option): New global.
* src/main.c (options): New option --directory.
(parse_opt): Handle the --directory option.
* src/util.c (change_dir): New proto.
* doc/cpio.texi: Document the --directory option.
|
|
* src/copyin.c (create_defered_links): Use ino_t for
inode numbers.
(create_defered_links_to_skipped): Likewise.
(process_copy_in): Add typecast to inode fprintf argument.
* src/copyout.c (count_defered_links_to_dev_ino)
(writeout_other_defers): Use ino_t for inode numbers.
* src/copypass.c (link_to_maj_min_ino): Likewise.
* src/util.c (struct inode_val): Likewise.
(find_inode_file, add_inode): Likewise.
* src/extern.h (link_to_maj_min_ino)
(find_inode_file, add_inode): Change signature.
|
|
|
|
Minor fixes in cpio.
* Makefile.am (AM_DISTCHECK_CONFIGURE_FLAGS): New variable.
Ensure that distcheck builds mt.
* bootstrap: Patch Makefile.in to honor AM_DISTCHECK_CONFIGURE_FLAGS.
* gnulib.modules: add argp-version-etc and progname.
* src/Makefile.am: Remove useless dependency.
* src/copyin.c (long_format): Fix printf arguments.
* src/copyout.c (read_for_checksum): Return unsigned long.
(process_copy_out): Remove unused variable.
* src/extern.h (crc): Change type to unsigned long.
(program_name): Remove.
* src/global.c: Likewise.
* src/main.c: Include argp-version-etc.h and progname.h
(argp_program_version): Remove.
(program_authors): New global.
(options): Remove the 'Informative options' group. These are
handled automatically by argp.
(parse_opt): Likewise.
(licence): Remove. This info is output by --version.
(process_args): Remove useless test.
(main): Use set_program_name and argp_version_setup.
* src/mt.c: Remove superfluous includes.
Include argp-version-etc.h and progname.h
Use argp to parse arguments.
Supply the fatal_exit function.
* tests/version.at: Update for the new --version output.
* THANKS: Add Peter Breitenlohner.
* AUTHORS: Update Sergey's email.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
representation. Among other things this fixes bug reported by
Peter Vrabec on Mar 2, 2006
(http://lists.gnu.org/archive/html/bug-cpio/2006-03/msg00000.html)
|
|
|
|
functions for each file format. Use to_ascii to convert numbers to
ascii representation. Check for overflows and report them if
appropriate. Return 0 if it is OK to proceed with archiving this
file, 1 otherwise. All callers updated.
|
|
proposed by Jim Castleberry and Peter Vrabec to fix Debian bug 335580
|
|
(eventually fixed) file name (in tar terminology, `file name'
vs. `member name'.
|
|
|
|
hardcoding the trailer file name.
|
|
|
|
|
|
new_cpio_header.
|
|
|
|
|
|
(or memcpy, if appropriate), instead of bcopy, and
strchr/strrchr instead of index/rindex.
Use write_nuls_to_file instead of explicitely accessing zeros_512.
|
|
|
|
wishes it.
|
|
|
|
|
|
|