2.7.5, including an even better fix for CVE-2015-1196 that allows relative symlinks.
This commit is contained in:
parent
158e6d1d97
commit
ab01eb74b5
@ -1,6 +1,6 @@
|
||||
diff -up patch-2.7.4/src/common.h.selinux patch-2.7.4/src/common.h
|
||||
--- patch-2.7.4/src/common.h.selinux 2015-01-31 16:09:46.000000000 +0000
|
||||
+++ patch-2.7.4/src/common.h 2015-02-01 12:46:56.922818144 +0000
|
||||
diff -up patch-2.7.5/src/common.h.selinux patch-2.7.5/src/common.h
|
||||
--- patch-2.7.5/src/common.h.selinux 2015-02-28 16:02:30.000000000 +0000
|
||||
+++ patch-2.7.5/src/common.h 2015-03-08 16:01:17.738326810 +0000
|
||||
@@ -30,6 +30,8 @@
|
||||
#include <sys/types.h>
|
||||
#include <time.h>
|
||||
@ -18,9 +18,9 @@ diff -up patch-2.7.4/src/common.h.selinux patch-2.7.4/src/common.h
|
||||
XTERN bool dry_run;
|
||||
XTERN bool posixly_correct;
|
||||
|
||||
diff -up patch-2.7.4/src/inp.c.selinux patch-2.7.4/src/inp.c
|
||||
--- patch-2.7.4/src/inp.c.selinux 2015-01-31 21:13:45.000000000 +0000
|
||||
+++ patch-2.7.4/src/inp.c 2015-02-01 12:46:56.922818144 +0000
|
||||
diff -up patch-2.7.5/src/inp.c.selinux patch-2.7.5/src/inp.c
|
||||
--- patch-2.7.5/src/inp.c.selinux 2015-03-07 00:34:20.000000000 +0000
|
||||
+++ patch-2.7.5/src/inp.c 2015-03-08 16:01:17.738326810 +0000
|
||||
@@ -145,7 +145,7 @@ get_input_file (char const *filename, ch
|
||||
char *getbuf;
|
||||
|
||||
@ -47,34 +47,34 @@ diff -up patch-2.7.4/src/inp.c.selinux patch-2.7.4/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.4/src/Makefile.am.selinux patch-2.7.4/src/Makefile.am
|
||||
--- patch-2.7.4/src/Makefile.am.selinux 2015-01-31 21:12:47.000000000 +0000
|
||||
+++ patch-2.7.4/src/Makefile.am 2015-02-01 12:46:56.922818144 +0000
|
||||
@@ -36,7 +36,7 @@ patch_SOURCES = \
|
||||
diff -up patch-2.7.5/src/Makefile.am.selinux patch-2.7.5/src/Makefile.am
|
||||
--- patch-2.7.5/src/Makefile.am.selinux 2015-03-08 16:01:17.738326810 +0000
|
||||
+++ patch-2.7.5/src/Makefile.am 2015-03-08 16:01:45.337183071 +0000
|
||||
@@ -37,7 +37,7 @@ patch_SOURCES = \
|
||||
|
||||
AM_CPPFLAGS = -I$(top_builddir)/lib -I$(top_srcdir)/lib
|
||||
patch_LDADD = $(LDADD) $(top_builddir)/lib/libpatch.a $(LIB_CLOCK_GETTIME) \
|
||||
- $(LIB_XATTR)
|
||||
+ $(LIB_XATTR) -lselinux
|
||||
- $(LIB_XATTR) $(LIB_EACCESS)
|
||||
+ $(LIB_XATTR) $(LIB_EACCESS) -lselinux
|
||||
|
||||
if ENABLE_MERGE
|
||||
patch_SOURCES += merge.c
|
||||
diff -up patch-2.7.4/src/Makefile.in.selinux patch-2.7.4/src/Makefile.in
|
||||
--- patch-2.7.4/src/Makefile.in.selinux 2015-01-31 21:14:45.000000000 +0000
|
||||
+++ patch-2.7.4/src/Makefile.in 2015-02-01 12:46:56.923818145 +0000
|
||||
@@ -1062,7 +1062,7 @@ patch_SOURCES = bestmatch.h common.h inp
|
||||
diff -up patch-2.7.5/src/Makefile.in.selinux patch-2.7.5/src/Makefile.in
|
||||
--- patch-2.7.5/src/Makefile.in.selinux 2015-03-08 16:01:17.738326810 +0000
|
||||
+++ patch-2.7.5/src/Makefile.in 2015-03-08 16:02:09.551057377 +0000
|
||||
@@ -1068,7 +1068,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) \
|
||||
- $(LIB_XATTR)
|
||||
+ $(LIB_XATTR) -lselinux
|
||||
- $(LIB_XATTR) $(LIB_EACCESS)
|
||||
+ $(LIB_XATTR) $(LIB_EACCESS) -lselinux
|
||||
|
||||
all: all-am
|
||||
|
||||
diff -up patch-2.7.4/src/patch.c.selinux patch-2.7.4/src/patch.c
|
||||
--- patch-2.7.4/src/patch.c.selinux 2015-01-31 21:14:01.000000000 +0000
|
||||
+++ patch-2.7.4/src/patch.c 2015-02-01 12:46:56.923818145 +0000
|
||||
@@ -261,19 +261,19 @@ main (int argc, char **argv)
|
||||
diff -up patch-2.7.5/src/patch.c.selinux patch-2.7.5/src/patch.c
|
||||
--- patch-2.7.5/src/patch.c.selinux 2015-03-07 00:34:20.000000000 +0000
|
||||
+++ patch-2.7.5/src/patch.c 2015-03-08 16:01:17.739326804 +0000
|
||||
@@ -263,19 +263,19 @@ main (int argc, char **argv)
|
||||
if (! strcmp (inname, outname))
|
||||
{
|
||||
if (inerrno == -1)
|
||||
@ -97,7 +97,7 @@ diff -up patch-2.7.4/src/patch.c.selinux patch-2.7.4/src/patch.c
|
||||
inerrno = -1;
|
||||
}
|
||||
if (! outerrno)
|
||||
@@ -570,7 +570,7 @@ main (int argc, char **argv)
|
||||
@@ -588,7 +588,7 @@ main (int argc, char **argv)
|
||||
mode, &new_time);
|
||||
else
|
||||
{
|
||||
@ -106,7 +106,7 @@ diff -up patch-2.7.4/src/patch.c.selinux patch-2.7.4/src/patch.c
|
||||
set_file_attributes (TMPOUTNAME, attr, inname, &instat,
|
||||
mode, &new_time);
|
||||
}
|
||||
@@ -630,7 +630,7 @@ main (int argc, char **argv)
|
||||
@@ -648,7 +648,7 @@ main (int argc, char **argv)
|
||||
struct stat oldst;
|
||||
int olderrno;
|
||||
|
||||
@ -115,7 +115,7 @@ diff -up patch-2.7.4/src/patch.c.selinux patch-2.7.4/src/patch.c
|
||||
if (olderrno && olderrno != ENOENT)
|
||||
write_fatal ();
|
||||
if (! olderrno && lookup_file_id (&oldst) == CREATED)
|
||||
@@ -1760,7 +1760,7 @@ delete_file_later (const char *name, con
|
||||
@@ -1780,7 +1780,7 @@ delete_file_later (const char *name, con
|
||||
|
||||
if (! st)
|
||||
{
|
||||
@ -124,9 +124,9 @@ diff -up patch-2.7.4/src/patch.c.selinux patch-2.7.4/src/patch.c
|
||||
pfatal ("Can't get file attributes of %s %s", "file", name);
|
||||
st = &st_tmp;
|
||||
}
|
||||
diff -up patch-2.7.4/src/pch.c.selinux patch-2.7.4/src/pch.c
|
||||
--- patch-2.7.4/src/pch.c.selinux 2015-01-31 21:14:01.000000000 +0000
|
||||
+++ patch-2.7.4/src/pch.c 2015-02-01 12:46:56.924818146 +0000
|
||||
diff -up patch-2.7.5/src/pch.c.selinux patch-2.7.5/src/pch.c
|
||||
--- patch-2.7.5/src/pch.c.selinux 2015-03-07 00:34:20.000000000 +0000
|
||||
+++ patch-2.7.5/src/pch.c 2015-03-08 16:01:17.739326804 +0000
|
||||
@@ -1,6 +1,6 @@
|
||||
/* reading patches */
|
||||
|
||||
@ -135,7 +135,7 @@ diff -up patch-2.7.4/src/pch.c.selinux patch-2.7.4/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
|
||||
@@ -296,7 +296,7 @@ there_is_another_patch (bool need_header
|
||||
if (t > buf + 1 && *(t - 1) == '\n')
|
||||
{
|
||||
inname = xmemdup0 (buf, t - buf - 1);
|
||||
@ -144,7 +144,7 @@ diff -up patch-2.7.4/src/pch.c.selinux patch-2.7.4/src/pch.c
|
||||
if (inerrno)
|
||||
{
|
||||
perror (inname);
|
||||
@@ -430,6 +430,7 @@ intuit_diff_type (bool need_header, mode
|
||||
@@ -433,6 +433,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.4/src/pch.c.selinux patch-2.7.4/src/pch.c
|
||||
int stat_errno[3];
|
||||
int version_controlled[3];
|
||||
enum diff retval;
|
||||
@@ -470,6 +471,7 @@ intuit_diff_type (bool need_header, mode
|
||||
@@ -473,6 +474,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.4/src/pch.c.selinux patch-2.7.4/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;
|
||||
@@ -879,7 +881,7 @@ intuit_diff_type (bool need_header, mode
|
||||
@@ -882,7 +884,7 @@ intuit_diff_type (bool need_header, mode
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -169,7 +169,7 @@ diff -up patch-2.7.4/src/pch.c.selinux patch-2.7.4/src/pch.c
|
||||
if (! stat_errno[i])
|
||||
{
|
||||
if (lookup_file_id (&st[i]) == DELETE_LATER)
|
||||
@@ -918,7 +920,7 @@ intuit_diff_type (bool need_header, mode
|
||||
@@ -921,7 +923,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.4/src/pch.c.selinux patch-2.7.4/src/pch.c
|
||||
stat_errno[i] = 0;
|
||||
else
|
||||
version_controlled[i] = 0;
|
||||
@@ -981,7 +983,7 @@ intuit_diff_type (bool need_header, mode
|
||||
@@ -984,7 +986,7 @@ intuit_diff_type (bool need_header, mode
|
||||
{
|
||||
if (inname)
|
||||
{
|
||||
@ -187,7 +187,7 @@ diff -up patch-2.7.4/src/pch.c.selinux patch-2.7.4/src/pch.c
|
||||
if (inerrno || (instat.st_mode & S_IFMT) == file_type)
|
||||
maybe_reverse (inname, inerrno, inerrno || instat.st_size == 0);
|
||||
}
|
||||
@@ -994,8 +996,14 @@ intuit_diff_type (bool need_header, mode
|
||||
@@ -997,8 +999,14 @@ intuit_diff_type (bool need_header, mode
|
||||
inerrno = stat_errno[i];
|
||||
invc = version_controlled[i];
|
||||
instat = st[i];
|
||||
@ -202,9 +202,9 @@ diff -up patch-2.7.4/src/pch.c.selinux patch-2.7.4/src/pch.c
|
||||
return retval;
|
||||
}
|
||||
|
||||
diff -up patch-2.7.4/src/util.c.selinux patch-2.7.4/src/util.c
|
||||
--- patch-2.7.4/src/util.c.selinux 2015-01-31 21:14:01.000000000 +0000
|
||||
+++ patch-2.7.4/src/util.c 2015-02-01 12:51:16.584224140 +0000
|
||||
diff -up patch-2.7.5/src/util.c.selinux patch-2.7.5/src/util.c
|
||||
--- patch-2.7.5/src/util.c.selinux 2015-03-07 00:34:20.000000000 +0000
|
||||
+++ patch-2.7.5/src/util.c 2015-03-08 16:04:27.633347234 +0000
|
||||
@@ -300,6 +300,19 @@ set_file_attributes (char const *to, enu
|
||||
S_ISLNK (mode) ? "symbolic link" : "file",
|
||||
quotearg (to));
|
||||
@ -259,7 +259,7 @@ diff -up patch-2.7.4/src/util.c.selinux patch-2.7.4/src/util.c
|
||||
|
||||
return 1;
|
||||
@@ -1664,12 +1685,28 @@ make_tempfile (char const **name, char l
|
||||
}
|
||||
return fd;
|
||||
}
|
||||
|
||||
-int stat_file (char const *filename, struct stat *st)
|
||||
@ -269,7 +269,8 @@ diff -up patch-2.7.4/src/util.c.selinux patch-2.7.4/src/util.c
|
||||
follow_symlinks ? safe_stat : safe_lstat;
|
||||
+ int (*xgetfilecon)(char const *, security_context_t *) =
|
||||
+ follow_symlinks ? getfilecon : lgetfilecon;
|
||||
+
|
||||
|
||||
- return xstat (filename, st) == 0 ? 0 : errno;
|
||||
+ if (xstat (filename, st) == 0)
|
||||
+ {
|
||||
+ if (con)
|
||||
@ -283,15 +284,14 @@ diff -up patch-2.7.4/src/util.c.selinux patch-2.7.4/src/util.c
|
||||
+ else
|
||||
+ return 0;
|
||||
+ }
|
||||
|
||||
- return xstat (filename, st) == 0 ? 0 : errno;
|
||||
+
|
||||
+ return errno;
|
||||
}
|
||||
|
||||
/* Check if a filename is relative and free of ".." components.
|
||||
diff -up patch-2.7.4/src/util.h.selinux patch-2.7.4/src/util.h
|
||||
--- patch-2.7.4/src/util.h.selinux 2015-01-31 21:14:01.000000000 +0000
|
||||
+++ patch-2.7.4/src/util.h 2015-02-01 12:46:56.925818147 +0000
|
||||
diff -up patch-2.7.5/src/util.h.selinux patch-2.7.5/src/util.h
|
||||
--- patch-2.7.5/src/util.h.selinux 2015-01-31 21:14:01.000000000 +0000
|
||||
+++ patch-2.7.5/src/util.h 2015-03-08 16:01:17.740326799 +0000
|
||||
@@ -44,7 +44,7 @@ char *parse_name (char const *, int, cha
|
||||
char *savebuf (char const *, size_t);
|
||||
char *savestr (char const *);
|
||||
|
@ -1,6 +1,6 @@
|
||||
Summary: Utility for modifying/upgrading files
|
||||
Name: patch
|
||||
Version: 2.7.4
|
||||
Version: 2.7.5
|
||||
Release: 1%{?dist}
|
||||
License: GPLv3+
|
||||
URL: http://www.gnu.org/software/patch/patch.html
|
||||
@ -54,6 +54,10 @@ rm -rf $RPM_BUILD_ROOT
|
||||
%{_mandir}/*/*
|
||||
|
||||
%changelog
|
||||
* Sun Mar 8 2015 Tim Waugh <twaugh@redhat.com> - 2.7.5-1
|
||||
- 2.7.5, including an even better fix for CVE-2015-1196 that still
|
||||
allows relative symlinks to be created/used.
|
||||
|
||||
* Sun Feb 1 2015 Tim Waugh <twaugh@redhat.com> - 2.7.4-1
|
||||
- 2.7.4, including a better fix for CVE-2015-1196 that still allows
|
||||
symlinks referencing ".." to be created.
|
||||
|
Loading…
Reference in New Issue
Block a user