summaryrefslogtreecommitdiff
path: root/system/patch/allow-missing.patch
diff options
context:
space:
mode:
authorKiyoshi Aman <kiyoshi.aman+apkfission@gmail.com>2018-06-17 00:29:51 -0500
committerKiyoshi Aman <kiyoshi.aman+apkfission@gmail.com>2018-06-17 00:29:51 -0500
commit8bfd4ec4f904902286d845b4a1cf9056fcdc9149 (patch)
treed06d86b3ff2f9d850c46297e29b4d5ff8f51da00 /system/patch/allow-missing.patch
parent99c331a08cba00feb07381100dce2e6ef9a6c0b3 (diff)
downloadpackages-8bfd4ec4f904902286d845b4a1cf9056fcdc9149.tar.gz
packages-8bfd4ec4f904902286d845b4a1cf9056fcdc9149.tar.bz2
packages-8bfd4ec4f904902286d845b4a1cf9056fcdc9149.tar.xz
packages-8bfd4ec4f904902286d845b4a1cf9056fcdc9149.zip
system/patch: [PD] fix maintainer, fix CVE-2018-100156
Diffstat (limited to 'system/patch/allow-missing.patch')
-rw-r--r--system/patch/allow-missing.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/system/patch/allow-missing.patch b/system/patch/allow-missing.patch
new file mode 100644
index 000000000..98c9aa877
--- /dev/null
+++ b/system/patch/allow-missing.patch
@@ -0,0 +1,33 @@
+From b5a91a01e5d0897facdd0f49d64b76b0f02b43e1 Mon Sep 17 00:00:00 2001
+From: Andreas Gruenbacher <agruen@gnu.org>
+Date: Fri, 6 Apr 2018 11:34:51 +0200
+Subject: Allow input files to be missing for ed-style patches
+
+* src/pch.c (do_ed_script): Allow input files to be missing so that new
+files will be created as with non-ed-style patches.
+---
+ src/pch.c | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/src/pch.c b/src/pch.c
+index bc6278c..0c5cc26 100644
+--- a/src/pch.c
++++ b/src/pch.c
+@@ -2394,9 +2394,11 @@ do_ed_script (char const *inname, char const *outname,
+
+ if (! dry_run && ! skip_rest_of_patch) {
+ int exclusive = *outname_needs_removal ? 0 : O_EXCL;
+- assert (! inerrno);
+- *outname_needs_removal = true;
+- copy_file (inname, outname, 0, exclusive, instat.st_mode, true);
++ if (inerrno != ENOENT)
++ {
++ *outname_needs_removal = true;
++ copy_file (inname, outname, 0, exclusive, instat.st_mode, true);
++ }
+ sprintf (buf, "%s %s%s", editor_program,
+ verbosity == VERBOSE ? "" : "- ",
+ outname);
+--
+cgit v1.0-41-gc330
+