Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/patch Pass -S to ed(1) so that patches containing ! ...



details:   https://anonhg.NetBSD.org/src/rev/3b3c2429cbc5
branches:  trunk
changeset: 360896:3b3c2429cbc5
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Apr 05 18:50:10 2018 +0000

description:
Pass -S to ed(1) so that patches containing ! commands don't run commands.
Real cause of CVS-2018-0492:
    https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=894667)

diffstat:

 usr.bin/patch/pch.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (32 lines):

diff -r ec1a5b711d21 -r 3b3c2429cbc5 usr.bin/patch/pch.c
--- a/usr.bin/patch/pch.c       Thu Apr 05 18:44:57 2018 +0000
+++ b/usr.bin/patch/pch.c       Thu Apr 05 18:50:10 2018 +0000
@@ -1,7 +1,7 @@
 /*
  * $OpenBSD: pch.c,v 1.37 2007/09/02 15:19:33 deraadt Exp $
  * $DragonFly: src/usr.bin/patch/pch.c,v 1.6 2008/08/10 23:35:40 joerg Exp $
- * $NetBSD: pch.c,v 1.28 2015/07/30 21:47:51 christos Exp $
+ * $NetBSD: pch.c,v 1.29 2018/04/05 18:50:10 christos Exp $
  */
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: pch.c,v 1.28 2015/07/30 21:47:51 christos Exp $");
+__RCSID("$NetBSD: pch.c,v 1.29 2018/04/05 18:50:10 christos Exp $");
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -1414,8 +1414,8 @@
                        unlink(TMPOUTNAME);
                        fatal("can't create temp file %s", TMPOUTNAME);
                }
-               snprintf(buf, buf_len, "%s%s%s", _PATH_ED,
-                   verbose ? " " : " -s ", TMPOUTNAME);
+               snprintf(buf, buf_len, "%s -S%s %s", _PATH_ED,
+                   verbose ? "" : "s", TMPOUTNAME);
                pipefp = popen(buf, "w");
        }
        for (;;) {



Home | Main Index | Thread Index | Old Index