summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Create directory test caseOzan Çağlayan2011-02-043-0/+34
| | | | | * tests/create-delete: New test case creating a file in a new sub-directory (bug fixed on 2010-12-04).
* Also check if the input file is seekable if a filename is given (-i)Andreas Gruenbacher2011-02-034-39/+86
| | | | | | | * src/pch.c (open_patch_file): Also check if the input file is seekable if a filename is given (-i). * tests/pipe: New file. Test this. * tests/Makefile.am (TESTS): Add it.
* doc: mention the fix for CVE-2010-4651Jim Meyering2011-02-032-0/+7
| | | | * NEWS: Mention the fix.
* Do not let a malicious patch create files above current directoryJim Meyering2011-02-035-4/+76
| | | | | | | | | | This addresses CVE-2010-4651, reported by Jakub Wilk. https://bugzilla.redhat.com/show_bug.cgi?id=CVE-2010-4651 * src/util.c (strip_leading_slashes): Reject absolute file names and file names containing a component of "..". * tests/bad-filenames: New file. Test for this. * tests/Makefile.am (TESTS): Add it. Improvements by Andreas Gruenbacher.
* Create missing parent directories of temporary filesAndreas Gruenbacher2010-12-042-0/+15
| | | | | * src/util.c (make_tempfile): Create missing directories when necessary.
* Fix the USE_XATTR checksAndreas Gruenbacher2010-10-292-2/+7
| | | | | * src/util.c: USE_XATTR is defined to 0 or 1, so we need to use #if instead of #ifdef.
* Preserve extended attributes of patched files when possibleAndreas Gruenbacher2010-10-2710-11/+251
| | | | | | | | | | | | | | * src/patch.c (main): Set all file attributes of the temporary output file before renaming it over the final output file (possibly replacing the input file). Pass the input file name to set_file_attributes(). * src/util.c (set_file_attributes): When enabled (USE_XATTR), also copy extended attributes including attributes which define permissions. (copy_attr_error, copy_attr_quote, copy_attr_free, copy_attr_check, copy_attr): Helper functions for copying extended attributes. * m4/xattr.m4 (gl_FUNC_XATTR): Import from coreutils. * src/Makefile.am (patch_LDADD): Add $(LIB_XATTR) here. * bootstrap.conf: Use the gnulib verror module.
* A minor set_file_attributes() cleanupAndreas Gruenbacher2010-10-272-3/+7
| | | | | | * src/util.c (set_file_attributes): Always expect the mode argument to be set when FA_MODE is specified. (create_backup_copy): Update accordingly.
* Remove obsolete checks for mktempAndreas Gruenbacher2010-10-262-2/+5
| | | | * configure.ac: Remove obsolete checks for mktemp.
* Remove obsolete commentAndreas Gruenbacher2010-10-262-1/+4
| | | | * src/patch.c (print_header_line): Remove obsolete comment.
* Fix the --binary option when used together with --silentAndreas Gruenbacher2010-10-142-3/+12
| | | | | | * src/pch.c (there_is_another_patch): Set p_strip_trailing_cr to false if no_strip_trailing_cr is set independent of the verbosity. This broke the --binary option in combination with --silent.
* Only recognize quited filename in the "diff --git" formatAndreas Gruenbacher2010-10-056-27/+39
| | | | | | | | * src/util.c: Add a maybe_quoted parameter to fetchname. * src/pch.c: Only recognize quited filename in the "diff --git" format, at least for now. * tests/quoted-filenames: Update accordingly. * NEWS: Update accordingly.
* Add copy-after-modify test caseAndreas Gruenbacher2010-09-172-0/+45
| | | | * tests/criss-cross: Add copy-after-modify test case.
* Document that "diff --git" criss-cross renames don't workAndreas Gruenbacher2010-09-174-2/+54
| | | | | | * NEWS: Document that "diff --git" criss-cross renames are broken still. * tests/criss-cross: Test case currently expected to fail.
* Fix the "patching file" message for renames and copiesAndreas Gruenbacher2010-09-175-26/+32
| | | | | | | | | * src/patch.c (main): Generate the "patching file" message here. When the input and output file name is not he same, include both names in the message. * src/inp.c (scan_input): Previously the "patching file" message was generated here. * tests/unmodified-files, tests/copy-rename: Update.
* Remove double quotearg()Andreas Gruenbacher2010-09-172-2/+2
| | | | * src/inp.c (scan_input): Remove double quotearg().
* Stop using mktemp() for TMPOUTNAMEAndreas Gruenbacher2010-09-172-48/+23
| | | | | * src/patch.c (main): Compute TMPOUTNAME with make_tempfile(). (make_temp): Remove obsolete function.
* Stop using mktemp() for TMPREJNAMEAndreas Gruenbacher2010-09-172-15/+31
| | | | | | | * src/patch.c (main): Compute TMPREJNAME with make_tempfile() only if needed. (abort_hunk, init_reject): Pass through the output file name, and base TMPREJNAME on it.
* Replace unnecessary local variableAndreas Gruenbacher2010-09-172-13/+14
| | | | * src/patch.c (abort_hunk_unified): Replace unnecessary local variable.
* Stop using mktemp() for TMPPATNAMEAndreas Gruenbacher2010-09-173-7/+6
| | | | | * src/pch.c (open_patch_file): Compute TMPPATNAME with make_tempfile() if needed instead of precomputing it in src/patch.c (main).
* Stop using mktemp() for TMPINNAMEAndreas Gruenbacher2010-09-173-6/+14
| | | | | * src/inp.c (plan_b): Compute TMPINNAME with make_tempfile() if needed instead of precomputing it in src/patch.c (main).
* Add function make_tempfile()Andreas Gruenbacher2010-09-174-0/+62
| | | | | * bootstrap.conf: Use the gnulib tempname module. * src/util.c (make_tempfile): New function.
* do_ed_script(): Pass in the filenames to useAndreas Gruenbacher2010-09-174-10/+18
| | | | | | | * src/pch.c (do_ed_script): Add inname, outname, and outname_needs_removal arguments. This isolates TMPOUTNAME and TMPOUTNAME_needs_removal to patch.c. * src/patch.c (main): Update do_ed_script() call.
* Split up init_output()Andreas Gruenbacher2010-09-172-16/+31
| | | | | * src/patch.c (open_outfile): New function. (init_output): Split into open_outfile() and the rest.
* A lot of years in the ChangeLog are wrong (2009 -> 2010)Andreas Gruenbacher2010-09-171-18/+18
|
* Stop "patch --get 1" from segfaultingTim Waugh2010-07-272-1/+5
| | | | * src/patch.c: Stop "patch --get 1" from segfaulting.
* Fix read-only file check for ed scriptsAndreas Gruenbacher2010-05-112-13/+19
| | | | | * src/patch.c: The read-only file check was not done for ed scripts; fix this.
* test suite: Another Solaris portability fixAndreas Gruenbacher2010-05-063-12/+15
| | | | | * tests/corrupt-reject-files, tests/crlf-handling: On Solaris, cat's -e option is only effective if -v is specified as well.
* test suite: Ignore error messages during cleanupAndreas Gruenbacher2010-05-062-4/+7
| | | | | * tests/test-lib.sh: Ignore error messages when cleaning up after a test has finished.
* test library: Only use GNU diff when availableAndreas Gruenbacher2010-05-053-8/+13
| | | | | * tests/test-lib.sh: Only use GNU diff when available. * tests/dash-o-append: Fix the expected result.
* More test suite fixesAndreas Gruenbacher2010-05-053-25/+54
| | | | | * tests/create-delete: Do not use 'diff' here. * tests/merge: Require GNU diff.
* Use the gnulib unistd moduleAndreas Gruenbacher2010-05-053-19/+5
| | | | * bootstrap.conf: Use the gnulib unistd module.
* Use the gnulib mkdir moduleAndreas Gruenbacher2010-05-055-46/+6
| | | | | * bootstrap.conf: Use the gnulib mkdir module. * m4/mkdir.m4: Delete.
* tests/read-only-files: Replace the superuser testAndreas Gruenbacher2010-05-042-2/+11
| | | | | * tests/read-only-files: Remove the superuser test, and instead try out if a read-only file can be written to.
* Create temporary test directories in builddirAndreas Gruenbacher2010-05-042-6/+5
| | | | | * tests/test-lib.sh: Create temporary directories in builddir; this removes the need to do it safely: some systems do not have mktemp -d.
* Remove $(TEST_SHELL) and use $(SHELL) instead.Andreas Gruenbacher2010-05-043-2/+4
| | | | | * configure.ac, tests/Makefile: Remove $(TEST_SHELL) and use $(SHELL) instead.
* Additional minor fixes based on Eric Blake's suggestionsAndreas Gruenbacher2010-05-043-2/+11
| | | | | | * src/version.c: Put the Free Software Foundation copyright first. * tests/read-only-files: Skip when run as superuser: even files without write permissions would be writable.
* build: silence some cygwin warningsEric Blake2010-05-044-6/+16
| | | | | | | | | * src/pch.c (includes): Add <io.h> for setmode. (intuit_diff_type): Avoid 8-bit problems. * src/util.c (parse_name): Likewise. * src/util.h (skip_spaces): Likewise. Signed-off-by: Eric Blake <eblake@redhat.com>
* Fix backup file detection for deleted filesAndreas Gruenbacher2010-05-048-69/+124
| | | | | | | | | | * src/util.c (create_backup): Document patch's backup file logic. (create_backup, create_backup_copy): Add a flag to remember the backup file; use when a patch deletes a file. (move_file, copy_file): Better error messages. * tests/Makefile.am (TESTS): Remove remember-backup-files-2. * tests/remember-backup-files: Add tests from remember-backup-files-2. * tests/symlinks: Add a symlink backup file test.
* Some test suite fixes and improvementsAndreas Gruenbacher2010-05-0422-25/+45
| | | | | | | | * tests/test-lib.sh: Flag tests with missing pre-requirements as SKIPped instead of PASSed. Do not use GNU diff extensions, but still require a diff that understands "-u". * tests: Do not unnecessarily require GNU diff in a lot of tests. Make the sed utility optional.
* Remove left-over debugging codeAndreas Gruenbacher2010-05-042-7/+3
| | | | * src/pch.c (intuit_diff_type): Remove left-over debugging code.
* Allow to create and delete empty filesAndreas Gruenbacher2010-05-043-8/+64
| | | | | | | | | * src/pch.c (maybe_reverse): Allow to create and delete empty files. (sha1_says_nonexistent): New function for recognizing the sha1 checksums of nonexistent and empty files. (skip_hex_digits): New helper function for skipping [0-9a-z]. (intuit_diff_type): Parse the sha1 checksums in index lines. * tests/Makefile.am (XFAIL_TESTS): Remove empty-files.
* Minor cosmetic changesAndreas Gruenbacher2010-05-032-2/+4
|
* Stick to the best name in the reversed-patch checkAndreas Gruenbacher2010-05-033-3/+38
| | | | | | * src/pch.c (intuit_diff_type): Fix a bug where the reversed-patch check would wrongly pick the last name instead of the best name. * src/create-delete: Add test cases for that.
* Do not try to set file permissions of symlinksAndreas Gruenbacher2010-05-033-1/+13
| | | | | | | * src/pch.c (fetchmode): Document that the "diff --git" format does not store file permissions of symlinks. * src/util.c (set_file_attributes): Since we don't have symlink file permissions, don't try to set them even on systems where we could.
* Improve the symlink backup file testsAndreas Gruenbacher2010-05-032-2/+6
| | | | * tests/symlinks: Improve the backup file tests.
* Add two test cases which are currently brokenAndreas Gruenbacher2010-05-034-1/+133
| | | | | | * Removing an empty file does not work as expected. * Deleted files are not being remembered correctly. * Symlinks are not being remembered, either.
* Fix the linker library orderAndreas Gruenbacher2010-05-022-2/+5
| | | | | | * src/Makefile.am (patch_LDADD): Add $(LIB_CLOCK_GETTIME) here, after libpatch.a, so that clock_gettime is properly resolved on systems on which the library order matters.
* * NEWS: Update.Andreas Gruenbacher2010-05-024-12/+22
| | | | | * gnulib: Update to latest. * bootstrap: Update from gnulib.
* Refuse to patch read-only filesAndreas Gruenbacher2010-05-026-30/+73
| | | | | | | | | * src/patch.c (main): Refuse to patch read-only files, or at least warn when patching such files with --force or --batch. * patch.man: Document the changed behavior. * tests/read-only-files: Split read-only file test case off from tests/remember-backup-files. * tests/Makefile.am: Add new test case.