52 Commits

Author SHA1 Message Date
Andreas Gruenbacher
d576eff1df Upate NEWS
* NEWS: Update.
2015-03-05 23:19:22 +01:00
Andreas Gruenbacher
de89dde09e Upate NEWS 2015-01-31 22:14:01 +01:00
Andreas Gruenbacher
41688ad8ef Fix the fix for CVE-2015-1196
* src/util.c (filename_is_safe): New function split off from name_is_valid().
(symlink_target_is_valid): Explain why we cannot have absolute symlinks or
symlinks with ".." components for now.
(move_file): Move absolute filename check here and explain.
* tests/symlinks: Put test case with ".." symlink in comments for now.
* NEWS: Add CVE number.
2015-01-22 21:51:51 +01:00
Andreas Gruenbacher
4e9269a5fc Make sure symlinks don't point outside working directory (CVE-2015-119)
When creating symlinks from git-style patches, make sure the symlinks don't
point above the current working directory.  Otherwise, a subsequent patch could
use the symlink to write outside the working directory.

* src/pch.c (symlink_target_is_valid): New function to check for valid symlink
targets.
* src/util.c (move_file): Use symlink_target_is_valid() here.
* tests/symlinks: Add valid and invalid symlink test cases.
2015-01-19 23:18:30 +01:00
Andreas Gruenbacher
f926295f4f Improve error message when refusing to delete file
* src/patch.c: Improve error message.
* tests/create-delete: Update the test case.
2014-08-13 01:16:44 +02:00
Steven Rostedt
a2f4bfe0f3 Preserve function names in reject files
* src/patch.c (main): Preserve function names in reject files.
* tests/reject-format: Update the test case.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Andreas Gruenbacher <agruen@linbit.com>
2013-08-19 22:44:46 +02:00
Andreas Gruenbacher
bbb840edca Version 2.7.1 2012-09-28 18:39:33 +02:00
Andreas Gruenbacher
c9de555284 Trailing whitespace fix
* NEWS: Trailing whitespace fix.
2012-09-28 12:43:42 +02:00
Andreas Gruenbacher
e8bfce6547 Improve the previous commit
* src/patch.c: Only print the "file is not empty after patch" message when
trying to delete the output file.  Say that we were trying to delete the file.
* tests/create-delete: Fix the expected messages.  Add test cases for the
--remove-empty-files and --posix options.
* NEWS: Better describe this change.
2012-09-26 01:33:22 +02:00
Andreas Gruenbacher
1d9ed51e9c Only expect files to become empty if the patch says so
Test cases based on patches from Dmitry V. Levin <ldv@altlinux.org>.
* src/patch.c (main): Only expect files to become empty if the patch says so.
* NEWS: Document this change.
* tests/create-delete: Add (more) empty vs. non-empty test cases.
2012-09-25 04:07:53 +02:00
Andreas Gruenbacher
89e5f702eb Update NEWS
* NEWS: Update.
2012-09-22 20:34:53 +02:00
Andreas Gruenbacher
474bb7d333 Add note on GPLv3 license change in version 2.6
* NEWS: Add note.
2012-09-13 14:38:38 +02:00
Andreas Gruenbacher
58ec5b5643 Version 2.7
* NEWS: Update.
2012-09-12 11:35:43 +02:00
Andreas Gruenbacher
66aeedee12 Support double-quoted filenames in all context diff formats
* src/util.c (fetchname): Always recognize double-quoted filenames.
* src/util.h (fetchname): Update prototype.
* src/pch.c (intuit_diff_type): Update calls to fetchname().
* tests/quoted-filenames: Change to a normal unified diff.
* NEWS: Update.
2012-08-11 11:09:11 +02:00
Andreas Gruenbacher
e0a7877a6e Update NEWS
* NEWS: Update.
2012-04-17 16:48:19 +02:00
Jim Meyering
2d38b11799 maint: update all copyright year number ranges
Run "make update-copyright".
2012-01-01 10:26:02 +01:00
Jim Meyering
4e595c3b6d give a diagnostic rather than a failed assertion for a mangled patch
* src/pch.c (another_hunk): Rather than asserting(C), issue the
"replacement text or line numbers mangled ..." diagnostic when !C.
* tests/mangled-numbers-abort: New test for the above.
* tests/Makefile.am (TESTS): Add it.
* NEWS: Mention it.
Reported by Gabriel Vlasiu via Tim Waugh.
See also http://bugzilla.redhat.com/738959
2011-10-11 03:31:57 +02:00
Jim Meyering
db2fb7cdba maint: update copyright date year ranges to include 2011
* bootstrap.conf (gnulib_modules): Add update-copyright.
Run "make update-copyright".
2011-03-27 09:16:46 +02:00
Andreas Gruenbacher
f663762bf0 Ignore dangerous filenames instead of failing immediately
* src/pch.c (name_is_valid): New function.
(intuit_diff_type, best_name): Use name_is_valid() here.
(strip_leading_slashes): Remove name validation tests from here.
* tests/bad-filenames: Add more tests for covering more of the
file name guessing corner cases in intuit_diff_type(), update the
existing tests.
* NEWS: Update.
2011-02-16 12:01:19 +01:00
Jim Meyering
4c3004c17f doc: mention the fix for CVE-2010-4651
* NEWS: Mention the fix.
2011-02-03 23:08:03 +01:00
Andreas Gruenbacher
3e234c40d2 Only recognize quited filename in the "diff --git" format
* 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.
2010-10-05 19:21:35 +02:00
Andreas Gruenbacher
7e6d1e6718 Document that "diff --git" criss-cross renames don't work
* NEWS: Document that "diff --git" criss-cross renames are broken
still.
* tests/criss-cross: Test case currently expected to fail.
2010-09-17 13:16:08 +02:00
Andreas Gruenbacher
47622c1e46 * NEWS: Update.
* gnulib: Update to latest.
* bootstrap: Update from gnulib.
2010-05-02 12:43:45 +02:00
Andreas Gruenbacher
3288f660a0 Document the recent changes
* patch.man: Describe the fixed behavior of --set-time and --set-utc
for timestamps that include time zones.
* NEWS: Update.
2010-04-23 21:43:45 +02:00
Andreas Gruenbacher
018ff72892 * NEWS: Version 2.6.1 released. 2009-12-30 16:30:44 +01:00
Andreas Gruenbacher
8cc8b7061c * src/patch.c (longopts, get_some_switches): Add an optional argument
to the --merge option to choose the output formats for conflicts.
* patch.man: Document the new optional argument of --merge.
* src/merge.c (merge_hunk): Implement diff3-style conflicts.
* src/common.h (conflict_style): This global variable determines the
output format for conflicts.
* tests/merge: Add test cases for the diff3 output format.
2009-12-29 17:03:14 +01:00
Andreas Gruenbacher
f01f28263e Version 2.6 released 2009-11-13 15:10:28 +01:00
Andreas Gruenbacher
62d03acb14 The -m option hasn't been officially allocated yet; use only the long form for now (--merge) 2009-07-19 17:50:54 +02:00
Andreas Gruenbacher
917aa4f4f1 When the file to patch is specified on the command line, apply all patches to that file 2009-05-12 21:55:35 +02:00
Vincent Legoll
b008dece18 Change the default value of PATCH_GET to 0
Patch should default to not try to get files from revision control software
unless actively asked by the user with the "-g" or "--get" command-line
switches, or the PATCH_GET environment variable.

Make the posixly correct behaviour of not using source control, the global
patch default. I.e. default to "-g0".

This is related to debian BTS bug: #200895
Please refer to that discussion for more background
information and discussion.
2009-05-12 14:32:15 +02:00
Andreas Gruenbacher
b7a82a44b8 Update NEWS 2009-04-07 02:12:46 +02:00
Andreas Gruenbacher
c7d14511bf Phrase things a little better 2009-04-06 16:54:28 +02:00
Andreas Gruenbacher
a03f22893c Copyright notice updates 2009-04-05 21:12:30 +02:00
Andreas Gruenbacher
802b26e78d Revert (almost) to the original asymmetric hunk behavior and document that 2009-04-05 20:24:04 +02:00
Andreas Gruenbacher
1ce9b303ce If an asymmmetric hunk starts at a line > 1, it is not from the start of the file 2009-04-03 22:28:38 +02:00
Andreas Gruenbacher
a3b6c4bbe6 Update the NEWS file 2009-04-03 11:18:47 +02:00
Andreas Gruenbacher
df890caf03 Prepare for second alpha release
Update NEWS.
Packaging and various other minor fixes.
2009-03-29 00:59:26 +01:00
Andreas Gruenbacher
b85f4543b4 When conforming to POSIX and no filename was given or found, ask 2009-03-22 22:32:04 +01:00
Andreas Gruenbacher
7efe74a605 More NEWS. 2009-03-22 16:00:29 +01:00
Andreas Gruenbacher
2684e74048 Prepare for first alpha release
Update NEWS.
Don't make $(TESTS) a prerequisite of dist: this would run the tests.
Add reminder for myself how to upload.
2009-03-22 14:30:15 +01:00
Andreas Gruenbacher
bb6e23b888 Include patch headers in reject files
This turns reject files into properly formatted patches.
2009-03-22 13:38:54 +01:00
Andreas Gruenbacher
0a22c10196 Add unified reject format and the --reject-format=FORMAT option 2009-03-22 13:38:46 +01:00
Andreas Gruenbacher
48a9e9afb9 Various changes lumped together
(Imported from working tree by Andreas Gruenbacher)
2009-03-21 17:40:30 +01:00
Andreas Gruenbacher
e930d168ad Import of patch-2.5.9.tar.gz 2009-03-17 21:46:21 +01:00
Andreas Gruenbacher
aa0d4dd837 Import of patch-2.5.8.tar.gz 2009-03-17 21:44:30 +01:00
Andreas Gruenbacher
712cce6fdd Import of patch-2.5.7.tar.gz 2009-03-17 21:43:20 +01:00
Andreas Gruenbacher
957f7b6423 Import of patch-2.5.3.tar.gz 2009-03-12 15:17:03 +01:00
Andreas Gruenbacher
6b2b462038 Import of patch-2.5.tar.gz 2009-03-12 15:15:49 +01:00
Andreas Gruenbacher
6263c220df Import of patch-2.4.tar.gz 2009-03-12 15:15:17 +01:00
Andreas Gruenbacher
1adb4535a3 Import of patch-2.3.tar.gz 2009-03-12 15:14:29 +01:00