From 5587b741e0009b1f49ea24bce041fb1ab4da5b70 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Jan 23 2015 09:54:43 +0000 Subject: 2.7.2. --- diff --git a/.gitignore b/.gitignore index 9605cca..afc686b 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ patch-2.6.tar.xz patch-2.6.1.tar.xz /patch-2.7.tar.xz /patch-2.7.1.tar.xz +/patch-2.7.2.tar.xz diff --git a/patch-2.7.1.tar.xz.sig b/patch-2.7.1.tar.xz.sig deleted file mode 100644 index 5d42bca..0000000 --- a/patch-2.7.1.tar.xz.sig +++ /dev/null @@ -1,7 +0,0 @@ ------BEGIN PGP SIGNATURE----- -Version: GnuPG v1.4.12 (GNU/Linux) - -iEYEABECAAYFAlBl1CwACgkQ9+hy/rlxVNM6+ACgmJmBZhc7jJKR6qmrlGLt7/6a -qT4AoNRERhprm8oQWEJvQfv++kFyYmMS -=0Wdl ------END PGP SIGNATURE----- diff --git a/patch-2.7.2.tar.xz.sig b/patch-2.7.2.tar.xz.sig new file mode 100644 index 0000000..0a8c50d --- /dev/null +++ b/patch-2.7.2.tar.xz.sig @@ -0,0 +1,17 @@ +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1 + +iQIcBAABAgAGBQJUvuVFAAoJEMTJJ81dGzbX6mcP/RTbggN+E0KdDpsTRyIJmSM/ +Wqql+SYMZlrXNqC9fpflfXodwumnztJcZxIubHfZiiJM1AeWTL3c7qWmlGXz7/og +CFLv6nKQQ26p45FthtCRRlYkTLymoMcVjju+C7WoxheZe6oy5kD6KeDXfQKvy9mc +09EbCt3OlKwztk/toRnk+Zwj9l3GtfhqPCqIO7vmT/KyV1lErWHVGvKw8Ecrb4jg +YcMJ3ttXschvkZWDmJibnBdJOFd5qFWjpOqbcmLkEeDDnKaIQ0YRwOdfDi761aPO +h1XZkt2cbFsAAmGegFFxPOxQjBX9hmJZ9tl/x1ka/iSBBEAljqvLWh11E5ZToUtS +QGD9t7uDFEyVKNpkSkiqsgGh5U4eyOxbsni22ZWtjeHWlIwoamEEp77211/FlROF +V1nZvuF12p+HyRKOl4UV3/EHUlWTXhzbLyRPNeQFBUcXk+KPrk9K2yicQmSDa+qF +Y4zNFE7Cs8AVh18CzzILXj31FS1sNp8BxUq3tEGz5DOrS/McvQvoYS4FWT/SzVOp +q8g3PzgC5G1suA3Lp8DK9okYOttHpU1ZUlldg11Q5FPjoRZVyhdaBRUko3GFxMWs +5/EMvIFNz2X5vUD6Bl+ggWd8yYdTYngBMxB0KRukgaO/sjKffjww83l3knpapimm +02+0Xdc/j2e9gE1xDvMR +=Y3Lt +-----END PGP SIGNATURE----- diff --git a/patch-CVE-2015-1196.patch b/patch-CVE-2015-1196.patch deleted file mode 100644 index 374dc3d..0000000 --- a/patch-CVE-2015-1196.patch +++ /dev/null @@ -1,212 +0,0 @@ -diff -up patch-2.7.1/src/pch.c.CVE-2015-1196 patch-2.7.1/src/pch.c ---- patch-2.7.1/src/pch.c.CVE-2015-1196 2012-09-22 18:44:33.000000000 +0100 -+++ patch-2.7.1/src/pch.c 2015-01-20 13:29:14.304859557 +0000 -@@ -387,29 +387,6 @@ skip_hex_digits (char const *str) - return s == str ? NULL : s; - } - --/* Check if we are in the root of a particular filesystem namespace ("/" on -- UNIX or a particular drive's root on DOS-like systems). */ --static bool --cwd_is_root (char const *name) --{ -- unsigned int prefix_len = FILE_SYSTEM_PREFIX_LEN (name); -- char root[prefix_len + 2]; -- struct stat st; -- dev_t root_dev; -- ino_t root_ino; -- -- memcpy (root, name, prefix_len); -- root[prefix_len] = '/'; -- root[prefix_len + 1] = 0; -- if (stat (root, &st)) -- return false; -- root_dev = st.st_dev; -- root_ino = st.st_ino; -- if (stat (".", &st)) -- return false; -- return root_dev == st.st_dev && root_ino == st.st_ino; --} -- - static bool - name_is_valid (char const *name) - { -diff -up patch-2.7.1/src/util.c.CVE-2015-1196 patch-2.7.1/src/util.c ---- patch-2.7.1/src/util.c.CVE-2015-1196 2012-09-22 21:09:10.000000000 +0100 -+++ patch-2.7.1/src/util.c 2015-01-20 13:29:14.305859561 +0000 -@@ -422,6 +422,60 @@ create_backup (char const *to, const str - } - } - -+static bool -+symlink_target_is_valid (char const *target, char const *to) -+{ -+ bool is_valid; -+ -+ if (IS_ABSOLUTE_FILE_NAME (to)) -+ is_valid = true; -+ else if (IS_ABSOLUTE_FILE_NAME (target)) -+ is_valid = false; -+ else -+ { -+ unsigned int depth = 0; -+ char const *t; -+ -+ is_valid = true; -+ t = to; -+ while (*t) -+ { -+ while (*t && ! ISSLASH (*t)) -+ t++; -+ if (ISSLASH (*t)) -+ { -+ while (ISSLASH (*t)) -+ t++; -+ depth++; -+ } -+ } -+ -+ t = target; -+ while (*t) -+ { -+ if (*t == '.' && *++t == '.' && (! *++t || ISSLASH (*t))) -+ { -+ if (! depth--) -+ { -+ is_valid = false; -+ break; -+ } -+ } -+ else -+ { -+ while (*t && ! ISSLASH (*t)) -+ t++; -+ depth++; -+ } -+ while (ISSLASH (*t)) -+ t++; -+ } -+ } -+ -+ /* Allow any symlink target if we are in the filesystem root. */ -+ return is_valid || cwd_is_root (to); -+} -+ - /* Move a file FROM (where *FROM_NEEDS_REMOVAL is nonzero if FROM - needs removal when cleaning up at the end of execution, and where - *FROMST is FROM's status if known), -@@ -465,6 +519,13 @@ move_file (char const *from, bool *from_ - read_fatal (); - buffer[size] = 0; - -+ if (! symlink_target_is_valid (buffer, to)) -+ { -+ fprintf (stderr, "symbolic link target '%s' is invalid\n", -+ buffer); -+ fatal_exit (0); -+ } -+ - if (! backup) - { - if (unlink (to) == 0) -@@ -1660,3 +1721,26 @@ int stat_file (char const *filename, str - - return xstat (filename, st) == 0 ? 0 : errno; - } -+ -+/* Check if we are in the root of a particular filesystem namespace ("/" on -+ UNIX or a particular drive's root on DOS-like systems). */ -+bool -+cwd_is_root (char const *name) -+{ -+ unsigned int prefix_len = FILE_SYSTEM_PREFIX_LEN (name); -+ char root[prefix_len + 2]; -+ struct stat st; -+ dev_t root_dev; -+ ino_t root_ino; -+ -+ memcpy (root, name, prefix_len); -+ root[prefix_len] = '/'; -+ root[prefix_len + 1] = 0; -+ if (stat (root, &st)) -+ return false; -+ root_dev = st.st_dev; -+ root_ino = st.st_ino; -+ if (stat (".", &st)) -+ return false; -+ return root_dev == st.st_dev && root_ino == st.st_ino; -+} -diff -up patch-2.7.1/src/util.h.CVE-2015-1196 patch-2.7.1/src/util.h ---- patch-2.7.1/src/util.h.CVE-2015-1196 2012-09-21 21:21:16.000000000 +0100 -+++ patch-2.7.1/src/util.h 2015-01-20 13:29:14.306859564 +0000 -@@ -69,6 +69,7 @@ enum file_id_type lookup_file_id (struct - void set_queued_output (struct stat const *, bool); - bool has_queued_output (struct stat const *); - int stat_file (char const *, struct stat *); -+bool cwd_is_root (char const *); - - enum file_attributes { - FA_TIMES = 1, -diff -up patch-2.7.1/tests/symlinks.CVE-2015-1196 patch-2.7.1/tests/symlinks ---- patch-2.7.1/tests/symlinks.CVE-2015-1196 2012-09-19 02:18:42.000000000 +0100 -+++ patch-2.7.1/tests/symlinks 2015-01-20 13:29:14.306859564 +0000 -@@ -146,6 +146,59 @@ ncheck 'test ! -L symlink' - - # -------------------------------------------------------------- - -+# Patch should not create symlinks which point outside the working directory. -+ -+cat > symlink-target.diff < bad-symlink-target1.diff < bad-symlink-target2.diff < - #endif -+#include - - #include - /* CTYPE_DOMAIN (C) is nonzero if the unsigned char C can safely be given -@@ -68,6 +69,9 @@ - - typedef off_t lin; /* must be signed */ - -+#define LINENUM_MIN TYPE_MINIMUM (lin) -+#define LINENUM_MAX TYPE_MAXIMUM (lin) -+ - /* globals */ - - XTERN char *buf; /* general purpose buffer */ -diff -up patch-2.7.1/src/pch.c.lineno-overflow patch-2.7.1/src/pch.c ---- patch-2.7.1/src/pch.c.lineno-overflow 2015-01-20 14:46:49.533109967 +0000 -+++ patch-2.7.1/src/pch.c 2015-01-20 14:47:37.264280630 +0000 -@@ -1294,6 +1294,8 @@ another_hunk (enum diff difftype, bool r - s++; - scan_linenum (s, &p_ptrn_lines); - p_ptrn_lines += 1 - p_first; -+ if (p_ptrn_lines < 0) -+ malformed (); - } - else if (p_first) - p_ptrn_lines = 1; -@@ -1301,6 +1303,9 @@ another_hunk (enum diff difftype, bool r - p_ptrn_lines = 0; - p_first = 1; - } -+ if (p_first >= LINENUM_MAX - p_ptrn_lines || -+ p_ptrn_lines >= LINENUM_MAX - 6) -+ malformed (); - p_max = p_ptrn_lines + 6; /* we need this much at least */ - while (p_max + 1 >= hunkmax) - if (! grow_hunkmax ()) -@@ -1370,6 +1375,8 @@ another_hunk (enum diff difftype, bool r - while (! ISDIGIT (*s)); - scan_linenum (s, &p_repl_lines); - p_repl_lines += 1 - p_newfirst; -+ if (p_repl_lines < 0) -+ malformed (); - } - else if (p_newfirst) - p_repl_lines = 1; -@@ -1378,6 +1385,9 @@ another_hunk (enum diff difftype, bool r - p_repl_lines = 0; - p_newfirst = 1; - } -+ if (p_newfirst >= LINENUM_MAX - p_repl_lines || -+ p_repl_lines >= LINENUM_MAX - p_end) -+ malformed (); - p_max = p_repl_lines + p_end; - while (p_max + 1 >= hunkmax) - if (! grow_hunkmax ()) -@@ -1617,6 +1627,8 @@ another_hunk (enum diff difftype, bool r - s = scan_linenum (s + 1, &p_ptrn_lines); - else - p_ptrn_lines = 1; -+ if (p_first >= LINENUM_MAX - p_ptrn_lines) -+ malformed (); - if (*s == ' ') s++; - if (*s != '+') - malformed (); -@@ -1625,6 +1637,8 @@ another_hunk (enum diff difftype, bool r - s = scan_linenum (s + 1, &p_repl_lines); - else - p_repl_lines = 1; -+ if (p_newfirst >= LINENUM_MAX - p_repl_lines) -+ malformed (); - if (*s == ' ') s++; - if (*s++ != '@') - malformed (); -@@ -1640,6 +1654,8 @@ another_hunk (enum diff difftype, bool r - p_first++; /* do append rather than insert */ - if (!p_repl_lines) - p_newfirst++; -+ if (p_ptrn_lines >= LINENUM_MAX - (p_repl_lines + 1)) -+ malformed (); - p_max = p_ptrn_lines + p_repl_lines + 1; - while (p_max + 1 >= hunkmax) - if (! grow_hunkmax ()) -@@ -1776,6 +1792,8 @@ another_hunk (enum diff difftype, bool r - } - else - p_ptrn_lines = (*s != 'a'); -+ if (p_first >= LINENUM_MAX - p_ptrn_lines) -+ malformed (); - hunk_type = *s; - if (hunk_type == 'a') - p_first++; /* do append rather than insert */ -@@ -1784,17 +1802,23 @@ another_hunk (enum diff difftype, bool r - scan_linenum (s + 1, &max); - else - max = min; -+ if (min > max || max - min == LINENUM_MAX) -+ malformed (); - if (hunk_type == 'd') - min++; -- p_end = p_ptrn_lines + 1 + max - min + 1; -+ p_newfirst = min; -+ p_repl_lines = max - min + 1; -+ if (p_newfirst >= LINENUM_MAX - p_repl_lines) -+ malformed (); -+ if (p_ptrn_lines >= LINENUM_MAX - (p_repl_lines + 1)) -+ malformed (); -+ p_end = p_ptrn_lines + p_repl_lines + 1; - while (p_end + 1 >= hunkmax) - if (! grow_hunkmax ()) - { - p_end = -1; - return -1; - } -- p_newfirst = min; -- p_repl_lines = max - min + 1; - sprintf (buf, "*** %s,%s\n", - format_linenum (numbuf0, p_first), - format_linenum (numbuf1, p_first + p_ptrn_lines - 1)); diff --git a/patch-remove-empty-dir.patch b/patch-remove-empty-dir.patch deleted file mode 100644 index b018cf2..0000000 --- a/patch-remove-empty-dir.patch +++ /dev/null @@ -1,57 +0,0 @@ -diff -up patch-2.7.1/src/patch.c.remove-empty-dir patch-2.7.1/src/patch.c ---- patch-2.7.1/src/patch.c.remove-empty-dir 2012-10-18 17:57:41.708586721 +0100 -+++ patch-2.7.1/src/patch.c 2013-03-11 11:35:54.607901400 +0000 -@@ -646,8 +646,8 @@ main (int argc, char **argv) - if (outstate.ofp && (ferror (outstate.ofp) || fclose (outstate.ofp) != 0)) - write_fatal (); - output_files (NULL); -- delete_files (); - cleanup (); -+ delete_files (); - if (somefailed) - exit (1); - return 0; -diff -up patch-2.7.1/tests/Makefile.am.remove-empty-dir patch-2.7.1/tests/Makefile.am ---- patch-2.7.1/tests/Makefile.am.remove-empty-dir 2012-09-14 10:15:22.000000000 +0100 -+++ patch-2.7.1/tests/Makefile.am 2013-03-11 11:35:54.619901466 +0000 -@@ -49,6 +49,7 @@ TESTS = \ - reject-format \ - remember-backup-files \ - remember-reject-files \ -+ remove-directories \ - symlinks \ - unmodified-files - -diff -up patch-2.7.1/tests/remove-directories.remove-empty-dir patch-2.7.1/tests/remove-directories ---- patch-2.7.1/tests/remove-directories.remove-empty-dir 2013-03-11 11:35:54.619901466 +0000 -+++ patch-2.7.1/tests/remove-directories 2013-03-11 11:35:54.619901466 +0000 -@@ -0,0 +1,29 @@ -+# Copyright (C) 2013 Free Software Foundation, Inc. -+# -+# Copying and distribution of this file, with or without modification, -+# in any medium, are permitted without royalty provided the copyright -+# notice and this notice are preserved. -+ -+. $srcdir/test-lib.sh -+ -+require_cat -+use_local_patch -+use_tmpdir -+ -+# ============================================================== -+# Remove empty parent diectories when removing a file -+ -+mkdir dir -+echo foobar > dir/file -+cat > apatch < #include @@ -10,7 +10,7 @@ diff -up patch-2.7.1/src/common.h.selinux patch-2.7.1/src/common.h #include #include -@@ -80,6 +82,7 @@ XTERN char *outfile; +@@ -84,6 +86,7 @@ XTERN char *outfile; XTERN int inerrno; XTERN int invc; XTERN struct stat instat; @@ -18,10 +18,10 @@ diff -up patch-2.7.1/src/common.h.selinux patch-2.7.1/src/common.h XTERN bool dry_run; XTERN bool posixly_correct; -diff -up patch-2.7.1/src/inp.c.selinux patch-2.7.1/src/inp.c ---- patch-2.7.1/src/inp.c.selinux 2012-09-19 02:07:31.000000000 +0100 -+++ patch-2.7.1/src/inp.c 2015-01-20 13:29:30.388915881 +0000 -@@ -138,7 +138,7 @@ get_input_file (char const *filename, ch +diff -up patch-2.7.2/src/inp.c.selinux patch-2.7.2/src/inp.c +--- patch-2.7.2/src/inp.c.selinux 2014-11-26 13:17:55.000000000 +0000 ++++ patch-2.7.2/src/inp.c 2015-01-21 15:17:16.277750792 +0000 +@@ -144,7 +144,7 @@ get_input_file (char const *filename, ch char *getbuf; if (inerrno == -1) @@ -30,7 +30,7 @@ diff -up patch-2.7.1/src/inp.c.selinux patch-2.7.1/src/inp.c /* Perhaps look for RCS or SCCS versions. */ if (S_ISREG (file_type) -@@ -183,7 +183,7 @@ get_input_file (char const *filename, ch +@@ -189,7 +189,7 @@ get_input_file (char const *filename, ch } if (cs && version_get (filename, cs, ! inerrno, elsewhere, getbuf, @@ -39,7 +39,7 @@ diff -up patch-2.7.1/src/inp.c.selinux patch-2.7.1/src/inp.c inerrno = 0; free (getbuf); -@@ -194,6 +194,7 @@ get_input_file (char const *filename, ch +@@ -200,6 +200,7 @@ get_input_file (char const *filename, ch { instat.st_mode = S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH; instat.st_size = 0; @@ -47,9 +47,9 @@ diff -up patch-2.7.1/src/inp.c.selinux patch-2.7.1/src/inp.c } else if (! ((S_ISREG (file_type) || S_ISLNK (file_type)) && (file_type & S_IFMT) == (instat.st_mode & S_IFMT))) -diff -up patch-2.7.1/src/Makefile.am.selinux patch-2.7.1/src/Makefile.am ---- patch-2.7.1/src/Makefile.am.selinux 2012-09-14 10:15:41.000000000 +0100 -+++ patch-2.7.1/src/Makefile.am 2015-01-20 13:29:30.388915881 +0000 +diff -up patch-2.7.2/src/Makefile.am.selinux patch-2.7.2/src/Makefile.am +--- patch-2.7.2/src/Makefile.am.selinux 2014-11-26 13:17:55.000000000 +0000 ++++ patch-2.7.2/src/Makefile.am 2015-01-21 15:17:16.278750796 +0000 @@ -34,7 +34,7 @@ patch_SOURCES = \ AM_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib @@ -59,10 +59,10 @@ diff -up patch-2.7.1/src/Makefile.am.selinux patch-2.7.1/src/Makefile.am if ENABLE_MERGE patch_SOURCES += merge.c -diff -up patch-2.7.1/src/Makefile.in.selinux patch-2.7.1/src/Makefile.in ---- patch-2.7.1/src/Makefile.in.selinux 2012-09-28 17:41:31.000000000 +0100 -+++ patch-2.7.1/src/Makefile.in 2015-01-20 13:29:30.389915884 +0000 -@@ -981,7 +981,7 @@ patch_SOURCES = bestmatch.h common.h inp +diff -up patch-2.7.2/src/Makefile.in.selinux patch-2.7.2/src/Makefile.in +--- patch-2.7.2/src/Makefile.in.selinux 2015-01-19 19:36:16.000000000 +0000 ++++ patch-2.7.2/src/Makefile.in 2015-01-21 15:17:16.278750796 +0000 +@@ -1047,7 +1047,7 @@ patch_SOURCES = bestmatch.h common.h inp AM_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib \ $(am__append_2) patch_LDADD = $(LDADD) $(top_builddir)/lib/libpatch.a $(LIB_CLOCK_GETTIME) \ @@ -71,9 +71,9 @@ diff -up patch-2.7.1/src/Makefile.in.selinux patch-2.7.1/src/Makefile.in all: all-am -diff -up patch-2.7.1/src/patch.c.selinux patch-2.7.1/src/patch.c ---- patch-2.7.1/src/patch.c.selinux 2015-01-20 13:29:30.383915863 +0000 -+++ patch-2.7.1/src/patch.c 2015-01-20 13:29:30.389915884 +0000 +diff -up patch-2.7.2/src/patch.c.selinux patch-2.7.2/src/patch.c +--- patch-2.7.2/src/patch.c.selinux 2015-01-20 09:11:48.000000000 +0000 ++++ patch-2.7.2/src/patch.c 2015-01-21 15:17:16.278750796 +0000 @@ -257,19 +257,19 @@ main (int argc, char **argv) if (! strcmp (inname, outname)) { @@ -115,7 +115,7 @@ diff -up patch-2.7.1/src/patch.c.selinux patch-2.7.1/src/patch.c if (olderrno && olderrno != ENOENT) write_fatal (); if (! olderrno && lookup_file_id (&oldst) == CREATED) -@@ -1751,7 +1751,7 @@ delete_file_later (const char *name, con +@@ -1754,7 +1754,7 @@ delete_file_later (const char *name, con if (! st) { @@ -124,9 +124,9 @@ diff -up patch-2.7.1/src/patch.c.selinux patch-2.7.1/src/patch.c pfatal ("Can't get file attributes of %s %s", "file", name); st = &st_tmp; } -diff -up patch-2.7.1/src/pch.c.selinux patch-2.7.1/src/pch.c ---- patch-2.7.1/src/pch.c.selinux 2015-01-20 13:29:30.385915870 +0000 -+++ patch-2.7.1/src/pch.c 2015-01-20 13:29:30.389915884 +0000 +diff -up patch-2.7.2/src/pch.c.selinux patch-2.7.2/src/pch.c +--- patch-2.7.2/src/pch.c.selinux 2015-01-20 11:43:07.000000000 +0000 ++++ patch-2.7.2/src/pch.c 2015-01-21 15:18:00.130926862 +0000 @@ -1,6 +1,6 @@ /* reading patches */ @@ -135,16 +135,16 @@ diff -up patch-2.7.1/src/pch.c.selinux patch-2.7.1/src/pch.c Copyright (C) 1990-1993, 1997-2003, 2006, 2009-2012 Free Software Foundation, Inc. -@@ -293,7 +293,7 @@ there_is_another_patch (bool need_header +@@ -292,7 +292,7 @@ there_is_another_patch (bool need_header + if (t > buf + 1 && *(t - 1) == '\n') { - inname = savebuf (buf, t - buf); - inname[t - buf - 1] = 0; + inname = xmemdup0 (buf, t - buf - 1); - inerrno = stat_file (inname, &instat); + inerrno = stat_file (inname, &instat, &incontext); if (inerrno) { perror (inname); -@@ -445,6 +445,7 @@ intuit_diff_type (bool need_header, mode +@@ -444,6 +444,7 @@ intuit_diff_type (bool need_header, mode bool extended_headers = false; enum nametype i; struct stat st[3]; @@ -152,7 +152,7 @@ diff -up patch-2.7.1/src/pch.c.selinux patch-2.7.1/src/pch.c int stat_errno[3]; int version_controlled[3]; enum diff retval; -@@ -484,6 +485,7 @@ intuit_diff_type (bool need_header, mode +@@ -483,6 +484,7 @@ intuit_diff_type (bool need_header, mode version_controlled[OLD] = -1; version_controlled[NEW] = -1; version_controlled[INDEX] = -1; @@ -160,7 +160,7 @@ diff -up patch-2.7.1/src/pch.c.selinux patch-2.7.1/src/pch.c p_rfc934_nesting = 0; p_timestamp[OLD].tv_sec = p_timestamp[NEW].tv_sec = -1; p_says_nonexistent[OLD] = p_says_nonexistent[NEW] = 0; -@@ -891,7 +893,7 @@ intuit_diff_type (bool need_header, mode +@@ -890,7 +892,7 @@ intuit_diff_type (bool need_header, mode } else { @@ -169,7 +169,7 @@ diff -up patch-2.7.1/src/pch.c.selinux patch-2.7.1/src/pch.c if (! stat_errno[i]) { if (lookup_file_id (&st[i]) == DELETE_LATER) -@@ -930,7 +932,7 @@ intuit_diff_type (bool need_header, mode +@@ -929,7 +931,7 @@ intuit_diff_type (bool need_header, mode if (cs) { if (version_get (p_name[i], cs, false, readonly, @@ -178,7 +178,7 @@ diff -up patch-2.7.1/src/pch.c.selinux patch-2.7.1/src/pch.c stat_errno[i] = 0; else version_controlled[i] = 0; -@@ -983,7 +985,7 @@ intuit_diff_type (bool need_header, mode +@@ -982,7 +984,7 @@ intuit_diff_type (bool need_header, mode { if (inname) { @@ -187,7 +187,7 @@ diff -up patch-2.7.1/src/pch.c.selinux patch-2.7.1/src/pch.c if (inerrno || (instat.st_mode & S_IFMT) == file_type) maybe_reverse (inname, inerrno, inerrno || instat.st_size == 0); } -@@ -996,8 +998,14 @@ intuit_diff_type (bool need_header, mode +@@ -995,8 +997,14 @@ intuit_diff_type (bool need_header, mode inerrno = stat_errno[i]; invc = version_controlled[i]; instat = st[i]; @@ -202,10 +202,10 @@ diff -up patch-2.7.1/src/pch.c.selinux patch-2.7.1/src/pch.c return retval; } -diff -up patch-2.7.1/src/util.c.selinux patch-2.7.1/src/util.c ---- patch-2.7.1/src/util.c.selinux 2015-01-20 13:29:30.386915874 +0000 -+++ patch-2.7.1/src/util.c 2015-01-20 13:29:30.390915888 +0000 -@@ -294,6 +294,19 @@ set_file_attributes (char const *to, enu +diff -up patch-2.7.2/src/util.c.selinux patch-2.7.2/src/util.c +--- patch-2.7.2/src/util.c.selinux 2015-01-20 09:08:38.000000000 +0000 ++++ patch-2.7.2/src/util.c 2015-01-21 15:17:16.279750800 +0000 +@@ -295,6 +295,19 @@ set_file_attributes (char const *to, enu S_ISLNK (mode) ? "symbolic link" : "file", quotearg (to)); } @@ -225,7 +225,7 @@ diff -up patch-2.7.1/src/util.c.selinux patch-2.7.1/src/util.c } static void -@@ -494,7 +507,7 @@ move_file (char const *from, bool *from_ +@@ -495,7 +508,7 @@ move_file (char const *from, bool *from_ struct stat to_st; int to_errno; @@ -234,7 +234,7 @@ diff -up patch-2.7.1/src/util.c.selinux patch-2.7.1/src/util.c if (backup) create_backup (to, to_errno ? NULL : &to_st, false); if (! to_errno) -@@ -871,7 +884,8 @@ version_controller (char const *filename +@@ -872,7 +885,8 @@ version_controller (char const *filename Return true if successful. */ bool version_get (char const *filename, char const *cs, bool exists, bool readonly, @@ -244,7 +244,7 @@ diff -up patch-2.7.1/src/util.c.selinux patch-2.7.1/src/util.c { if (patch_get < 0) { -@@ -896,6 +910,13 @@ version_get (char const *filename, char +@@ -897,6 +911,13 @@ version_get (char const *filename, char fatal ("Can't get file %s from %s", quotearg (filename), cs); if (stat (filename, filestat) != 0) pfatal ("%s", quotearg (filename)); @@ -258,7 +258,7 @@ diff -up patch-2.7.1/src/util.c.selinux patch-2.7.1/src/util.c } return 1; -@@ -1714,12 +1735,28 @@ make_tempfile (char const **name, char l +@@ -1712,12 +1733,28 @@ make_tempfile (char const **name, char l } } @@ -289,9 +289,9 @@ diff -up patch-2.7.1/src/util.c.selinux patch-2.7.1/src/util.c } /* Check if we are in the root of a particular filesystem namespace ("/" on -diff -up patch-2.7.1/src/util.h.selinux patch-2.7.1/src/util.h ---- patch-2.7.1/src/util.h.selinux 2015-01-20 13:29:30.386915874 +0000 -+++ patch-2.7.1/src/util.h 2015-01-20 13:30:14.653081617 +0000 +diff -up patch-2.7.2/src/util.h.selinux patch-2.7.2/src/util.h +--- patch-2.7.2/src/util.h.selinux 2015-01-20 09:07:24.000000000 +0000 ++++ patch-2.7.2/src/util.h 2015-01-21 15:17:16.280750804 +0000 @@ -45,7 +45,7 @@ char *parse_name (char const *, int, cha char *savebuf (char const *, size_t); char *savestr (char const *); diff --git a/patch.spec b/patch.spec index c4b1f63..8700f9e 100644 --- a/patch.spec +++ b/patch.spec @@ -1,16 +1,11 @@ Summary: Utility for modifying/upgrading files Name: patch -Version: 2.7.1 -Release: 12%{?dist} +Version: 2.7.2 +Release: 1%{?dist} License: GPLv3+ URL: http://www.gnu.org/software/patch/patch.html Group: Development/Tools Source: ftp://ftp.gnu.org/gnu/patch/patch-%{version}.tar.xz -Patch1: patch-remove-empty-dir.patch -Patch2: patch-args.patch -Patch3: patch-args-segfault.patch -Patch4: patch-CVE-2015-1196.patch -Patch5: patch-lineno-overflow.patch Patch100: patch-selinux.patch Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -31,22 +26,6 @@ applications. %prep %setup -q -# Upstream patch to fix removal of empty directories (bug #919489). -%patch1 -p1 -b .remove-empty-dir - -# Don't document unsupported -m option; document -x option (bug #948972). -%patch2 -p1 -b .args - -# Don't segfault when given bad arguments (bug #972330). -%patch3 -p1 -b .args-segfault - -# Apply upstream patch to fix directory traversal via symlinks -# (bug #1182157, CVE-2015-1196). -%patch4 -p1 -b .CVE-2015-1196 - -# Apply upstream patch to fix line numbering integer overflow. -%patch5 -p1 -b .lineno-overflow - # SELinux support. %patch100 -p1 -b .selinux @@ -75,6 +54,9 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/*/* %changelog +* Fri Jan 23 2015 Tim Waugh - 2.7.2-1 +- 2.7.2. + * Tue Jan 20 2015 Tim Waugh - 2.7.1-12 - Apply upstream patch to fix line numbering integer overflow. diff --git a/sources b/sources index 68736e2..9e3e560 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -e9ae5393426d3ad783a300a338c09b72 patch-2.7.1.tar.xz +0b0217d45d3d45d3f07d6b241abbeb2a patch-2.7.2.tar.xz