aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFiles
2024-01-14Version 2.15HEADv2.15masterSergey Poznyakoff2
2024-01-14Upgrade gnulibSergey Poznyakoff1
2024-01-14Upgrade copyright yearsSergey Poznyakoff62
2023-05-23Version 2.14.90Sergey Poznyakoff2
2023-05-18Fix operation of --no-absolute-filenames --make-directoriesSergey Poznyakoff1
* src/copyin.c (symlink_placeholder): Try to create leading directories if unable to create placeholder.
2023-05-18Upgrade paxutilsSergey Poznyakoff1
2023-05-17Restore access and modification times of symlinks in copy-in and copy-pass ↵Sergey Poznyakoff11
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.
2023-05-11configure: Include needed header for major/minor macrosSergey Poznyakoff1
This helps in avoiding the warning about implicit function declaration which is elevated as error with newer compilers e.g. clang 16 Signed-off-by: Khem Raj <raj.khem@gmail.com>
2023-05-01Version 2.14v2.14Sergey Poznyakoff3
2023-04-29Update NEWSSergey Poznyakoff1
2023-04-28Use GNU ls algorithm for deciding timestamp formatPaul Eggert2
Problem reported by Dan Jacobson (Bug#50694). * gnulib.modules: Add gettime, timespec. * src/copyin.c: Include timespec.h. (current_time): Now struct timespec, not time_t. All uses changed. (long_format): When formatting a timestamp, use the same algorithm that GNU ls does to decide whether a file is recent.
2023-04-28Fix integer overflows in timestamp outputPaul Eggert1
* src/copyin.c (long_format): Fix some unlikely integer overflow bugs. Work even if (current_time - when) overflows, which is possible if time_t is unsigned. Do not assume that system integer types fit into unsigned long. Simplify by using %ju. No need for local tbuf array.
2023-04-28Whitespace cleanupSergey Poznyakoff12
2023-04-28Update version of gnulibSergey Poznyakoff1
2023-04-28Fix appending to archives bigger than 2GSergey Poznyakoff3
* src/extern.h (last_header_start): Change type to off_t. * src/global.c: Likewise. * src/util.c (prepare_append): Use off_t for file offsets.
2023-04-28Fix combination of --create, --append, --directorySergey Poznyakoff2
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.
2023-04-28New option --ignore-dirnlinkSergey Poznyakoff7
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.
2023-04-28Fix 45b0ee2b407913c533f7ded8d6f8cbeec16ff6ca.Sergey Poznyakoff2
The commit in question brought in more problems than solutions. To properly fix the issue, use symlink placeholders, modelled after delayed symlinks in tar. * src/copyin.c (symlink_placeholder) (replace_symlink_placeholders): New functions. (copyin_link): Create symlink placeholder if --no-absolute-filenames was given. (process_copy_in): Replace placeholders after extraction. * tests/CVE-2015-1197.at: Update. Don't use /tmp.
2023-04-27Require automake 1.16.5Sergey Poznyakoff1
2023-04-27Update for newer autotoolsSergey Poznyakoff7
* am/pack.m4: Don't use obsolete macros. * configure.ac: Likewise. Require autoconf 2.71 * paxutils: Upgrade. * src/extern.h (STRINGIFY_BIGINT, UINTMAX_STRSIZE_BOUND): New definitions. (parse_user_spec): Change signature. * src/main.c: Update call to parse_user_spec. * src/idcache.c: Include extern.h * src/userspec.c: Likewise.
2023-04-07Fix calculation of CRC in copy-out mode.Sergey Poznyakoff1
* 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>
2023-01-22Upgrade gnulibSergey Poznyakoff1
2023-01-22Update copyright yearsSergey Poznyakoff60
2022-02-13Fix wording in the manpageSergey Poznyakoff2
2022-01-02Update copyright yearsSergey Poznyakoff61
2021-09-03Remove redundant condition checkShreenidhi Shedi1
* src/util.c (tape_empty_output_buffer): Fix condition.
2021-09-03Use inttostr to represent integer values as stringsSergey Poznyakoff3
* gnulib.modules: Request inttostr * src/idcache.c (getuser,getgroup): Use umaxtostr instead of sprintf. * src/userspec.c (parse_user_spec): Likewise.
2021-08-18Fix dynamic string reallocationsSergey Poznyakoff1
* src/dstring.c (ds_resize): Take additional argument: number of bytes to leave available after ds_idx. All uses changed.
2021-08-11Fix previous commitSergey Poznyakoff1
* src/dstring.c (ds_reset,ds_concat): Don't call ds_resize in a loop.
2021-08-07Rewrite dynamic string support.Sergey Poznyakoff6
* 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.
2021-03-24Improve online version of the documentation.Sergey Poznyakoff4
2021-01-08Update gnulibSergey Poznyakoff6
* NEWS: Raise version number. * configure.ac: Raise version number to 2.13.90. Raise autoconf and automake requirements. * gnulib: Pull v0.1-4336-gbdae9a5 * gnulib.modules: Remove getopt * src/copyin.c (long_format): Cast rdev numbers to unsigned long
2021-01-06Update copyright yearsSergey Poznyakoff60
2020-09-18Formatting changes in the documentation.Sergey Poznyakoff2
* doc/cpio.1: Fix typos. * doc/cpio.texi: Consistently use proper Texinfo markup fo commands, files, and sample text fragments.
2020-02-08Update copyright yearsSergey Poznyakoff60
2020-01-20Minor fixSergey Poznyakoff1
* src/global.c: Remove superfluous declaration of program_name
2019-11-16Fix handling of device numbers (part 2)Sergey Poznyakoff3
Previously the members of cpio_file_stat that hold device major and minor numbers were signed (long). This caused issues when the device number was cast to unsigned value (uintmax_t) during a call to to_ascii or derived function. In particular, on *BSD systems minor numbers are negative ints. When such numbers are passed to to_ascii, the resulting unsigned representation does not fit into the target field width. For details, see https://lists.gnu.org/archive/html/bug-cpio/2019-11/msg00012.html To fix this, the return types are autodetected by configure. The types of the c_dev_maj, c_dev_min, c_rdev_maj, and c_rdev_min members of struct cpio_file_stat are changed to unsigned versions of the corresponding detected types. This ensures that the value returned from major (or minor) will not undergo sign extension during assignment to the struct member and can be correctly promoted to a wider unsigned data type. * am/ax_compile_check_rettype.m4: New macro AC_COMPILE_CHECK_RETTYPE * configure.ac: Detect return types of major(3) and minor(3). * src/cpiohdr.h (cpio_file_stat): Change types of c_dev_maj, c_dev_min, c_rdev_maj, c_rdev_min.
2019-11-14Fix handling of device numbers on copy out.Sergey Poznyakoff1
Device minor and major numbers are meaningful only for devices. Don't attempt to store them for other files. Instead fill the corresponding fields with zeros. * src/util.c (stat_to_cpio): Initialize c_rdev_maj and c_rdev_min from struct stat only if the file is a device, otherwise set them to zero.
2019-11-08Improve 684b7ac5Sergey Poznyakoff1
* src/copyin.c (read_name_from_file): Handle len == 0.
2019-11-08Fix cpio header verification.Sergey Poznyakoff2
* src/copyin.c (read_name_from_file): Print error message and skip file if its name is not nul-terminated.
2019-11-06Version 2.13release_2_13Sergey Poznyakoff6
* NEWS: Describe new version. * configure.ac: version 2.13 * src/copyin.c: Fix strict aliasing violation. * tests/CVE-2019-14866.at: New file. * tests/Makefile.am: Add new test. * tests/testsuite.at: Add new test,
2019-11-04Various fixesSergey Poznyakoff4
* doc/cpio.texi: Document URLs of the mailing list archive and subscription interface. * src/copyin.c (try_existing_file): Change type of the last argument. (copyin_file): Initialize existing_dir. * src/dstring.c: Include xalloc.h * src/filemode.c (mode_string): mode is unsigned int.
2019-11-04Get rid of the unnecessary workaround.Sergey Poznyakoff1
2019-11-04Don't repeat the help reference message.Sergey Poznyakoff1
* src/main.c (process_args): Don't specify the "Try cpio --help" message explicitly. It is added automatically by the USAGE_ERROR macro.
2019-11-04Fix CVE-2019-14866Sergey Poznyakoff3
* 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.
2019-11-03Fix CVE-2015-1197Sergey Poznyakoff4
* src/copyin.c (copyin_link): Force safer name suffix for symbolic links. * tests/CVE-2015-1197.at: New file. * tests/Makefile.am: Add new test case. * tests/testsuite.at: Likewise.
2019-11-03Provide functions for struct cpio_file_stat management.Sergey Poznyakoff7
* 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.
2019-11-03Remove HPUX CDF supportSergey Poznyakoff4
2019-01-15Minor fix in the testsuiteSergey Poznyakoff2
* tests/symlink-long.at: Use m4 to create dirname, instead of using bash-specific syntax.
2018-12-01Minor fixesSergey Poznyakoff2
* src/copyin.c: Remove unused variable. * src/util.c: Cast arguments to printf.

Return to:

Send suggestions and report system problems to the System administrator.