Thu May 1 13:41:33 2008 UTC ()
pullup ticket #2359 - requested by tonnerre
emacs, emacs-nox11: fix for security issue

revisions pulled up:
- pkgsrc/editors/emacs/Makefile		1.107,1.108
- pkgsrc/editors/emacs/Makefile.common	r0
- pkgsrc/editors/emacs/distinfo		1.36
- pkgsrc/editors/emacs/options.mk	1.7
- pkgsrc/editors/emacs/patches/patch-ac	1.16
- pkgsrc/editors/emacs/patches/patch-af	1.11
- pkgsrc/editors/emacs-nox11/DESCR	r0
- pkgsrc/editors/emacs-nox11/Makefile	1.28

   Module Name:	pkgsrc
   Committed By:	jlam
   Date:		Fri Apr 25 16:35:32 UTC 2008

   Modified Files:
   	pkgsrc/editors/emacs: Makefile options.mk
   	pkgsrc/editors/emacs-nox11: Makefile
   Removed Files:
   	pkgsrc/editors/emacs: Makefile.common
   	pkgsrc/editors/emacs-nox11: DESCR

   Log Message:
   Make emacs and emacs-nox11 look more like xemacs and xemacs-nox11 in
   terms of file structure.  Also add DESTDIR support.
   ------------------------------------------------------------------------
   Module Name:	pkgsrc
   Committed By:	tonnerre
   Date:		Tue Apr 29 12:54:56 UTC 2008

   Modified Files:
   	pkgsrc/editors/emacs: Makefile distinfo
   Added Files:
   	pkgsrc/editors/emacs/patches: patch-ac patch-af

   Log Message:
   Fix two emacs vulnerabilities:
   - Fix unsafe handling of local variables iin hack-local-variables
     (CVE-2007-5795).
   - Prevent symlink attack on arbitrary files using the temp files vcdiff
     generates (CVE-2008-1694).


(rtr)
diff -r1.106 -r1.106.4.1 pkgsrc/editors/emacs/Makefile
diff -r1.20 -r0 pkgsrc/editors/emacs/Makefile.common
diff -r1.35 -r1.35.8.1 pkgsrc/editors/emacs/distinfo
diff -r1.6 -r1.6.4.1 pkgsrc/editors/emacs/options.mk
diff -r1.1.1.1 -r0 pkgsrc/editors/emacs-nox11/DESCR
diff -r1.27 -r1.27.6.1 pkgsrc/editors/emacs-nox11/Makefile
diff -r0 -r1.15.8.1 pkgsrc/editors/emacs/patches/patch-ac
diff -r0 -r1.10.8.1 pkgsrc/editors/emacs/patches/patch-af

cvs diff -r1.106 -r1.106.4.1 pkgsrc/editors/emacs/Makefile (expand / switch to unified diff)

--- pkgsrc/editors/emacs/Makefile 2007/12/06 12:10:32 1.106
+++ pkgsrc/editors/emacs/Makefile 2008/05/01 13:41:33 1.106.4.1
@@ -1,14 +1,66 @@ @@ -1,14 +1,66 @@
1# $NetBSD: Makefile,v 1.106 2007/12/06 12:10:32 markd Exp $ 1# $NetBSD: Makefile,v 1.106.4.1 2008/05/01 13:41:33 rtr Exp $
2 2
3DISTNAME= emacs-${EMACSVERSION} 3PKGNAME?= ${DISTNAME}
4PKGREVISION= 2 4COMMENT?= GNU editing macros (editor)
 5
 6DISTNAME= emacs-22.1
 7PKGREVISION= 3
5CATEGORIES= editors 8CATEGORIES= editors
6COMMENT= GNU editing macros (editor)${COMMENT_EXTRA} 9MASTER_SITES= ${MASTER_SITE_GNU:=emacs/}
7 10
8.include "../../editors/emacs/Makefile.common" 11MAINTAINER= markd@NetBSD.org
 12HOMEPAGE= http://www.gnu.org/software/emacs/emacs.html
9 13
 14CONFLICTS+= elisp-manual-[0-9]*
 15CONFLICTS+= emacs-[0-9]*
10CONFLICTS+= emacs-nox11-[0-9]* 16CONFLICTS+= emacs-nox11-[0-9]*
 17CONFLICTS+= mule-[0-9]*
 18
 19PKG_DESTDIR_SUPPORT= user-destdir
 20
 21USE_TOOLS+= gmake gzip mktemp:run perl:run pkg-config
 22GNU_CONFIGURE= yes
 23INFO_FILES= # PLIST
11 24
12.include "options.mk" 25.include "options.mk"
13 26
 27MAKEFLAGS+= EMACSLOADPATH=${WRKSRC}/lisp
 28
 29CONFIGURE_ARGS+= --localstatedir=${VARBASE:Q}
 30CONFIGURE_ENV+= GAMEOWN=${GAMEOWN:Q}
 31
 32BUILD_DEFS+= VARBASE
 33BUILD_DEFS+= GAMEDATAMODE
 34
 35# build PATH in the dumped emacs is not a problem
 36CHECK_WRKREF_SKIP+= bin/emacs
 37CHECK_WRKREF_SKIP+= bin/emacs-[0-9]*
 38
 39REPLACE_PERL= lib-src/grep-changelog
 40
 41SUBST_CLASSES+= test_equal
 42SUBST_STAGE.test_equal= pre-configure
 43SUBST_MESSAGE.test_equal= Fixing bashisms in test(1) usage.
 44SUBST_FILES.test_equal= mac/make-package
 45SUBST_SED.test_equal= -e 's/ == / = /g'
 46
 47MAKE_DIRS_PERMS+= ${VARBASE}/games/emacs \
 48 ${GAMEOWN:Q} ${GAMEGRP} ${GAMEDIRMODE:Q}
 49CONF_FILES_PERMS+= /dev/null ${VARBASE}/games/emacs/snake-scores \
 50 ${GAMEOWN:Q} ${GAMEGRP:Q} ${GAMEDATAMODE:Q}
 51CONF_FILES_PERMS+= /dev/null ${VARBASE}/games/emacs/tetris-scores \
 52 ${GAMEOWN:Q} ${GAMEGRP:Q} ${GAMEDATAMODE:Q}
 53SPECIAL_PERMS+= libexec/emacs/${PKGVERSION_NOREV}/${MACHINE_GNU_PLATFORM}/update-game-score ${GAMEOWN:Q} ${GAMEGRP:Q} ${GAMEMODE:Q}
 54
 55.if (${OPSYS} == "DragonFly") && exists(/usr/lib/crtbegin.o)
 56CPPFLAGS+= -DDFLY_PRE_17_CRT
 57.endif
 58
 59post-extract:
 60 cp ${FILESDIR}/site-init.el ${WRKSRC}/lisp
 61 cp ${FILESDIR}/dragonfly.h ${WRKSRC}/src/s
 62
 63.include "../../mk/oss.buildlink3.mk"
 64.include "../../mk/termcap.buildlink3.mk"
 65
14.include "../../mk/bsd.pkg.mk" 66.include "../../mk/bsd.pkg.mk"

File Deleted: pkgsrc/editors/emacs/Makefile.common

cvs diff -r1.35 -r1.35.8.1 pkgsrc/editors/emacs/Attic/distinfo (expand / switch to unified diff)

--- pkgsrc/editors/emacs/Attic/distinfo 2007/06/11 13:57:16 1.35
+++ pkgsrc/editors/emacs/Attic/distinfo 2008/05/01 13:41:33 1.35.8.1
@@ -1,22 +1,24 @@ @@ -1,22 +1,24 @@
1$NetBSD: distinfo,v 1.35 2007/06/11 13:57:16 markd Exp $ 1$NetBSD: distinfo,v 1.35.8.1 2008/05/01 13:41:33 rtr Exp $
2 2
3SHA1 (emacs-22.1.tar.gz) = 327664173eabe5db49d4e7e4a4b1794577af902e 3SHA1 (emacs-22.1.tar.gz) = 327664173eabe5db49d4e7e4a4b1794577af902e
4RMD160 (emacs-22.1.tar.gz) = da5360871db8b1d473ff7f0b0937ee6c278c0b19 4RMD160 (emacs-22.1.tar.gz) = da5360871db8b1d473ff7f0b0937ee6c278c0b19
5Size (emacs-22.1.tar.gz) = 38172226 bytes 5Size (emacs-22.1.tar.gz) = 38172226 bytes
6SHA1 (patch-aa) = d7ae318f2140dbd8f796bfcbb48f299fe6bf2d81 6SHA1 (patch-aa) = d7ae318f2140dbd8f796bfcbb48f299fe6bf2d81
7SHA1 (patch-ab) = 0e022290d305fd73ab7aa633f955fca10ac70799 7SHA1 (patch-ab) = 0e022290d305fd73ab7aa633f955fca10ac70799
 8SHA1 (patch-ac) = 1fc45d38f879c2ae7287bc7f7a9cb868e2db74d8
8SHA1 (patch-ad) = 39a11bc214ae3d2f9d634c30b196a46d473ab92f 9SHA1 (patch-ad) = 39a11bc214ae3d2f9d634c30b196a46d473ab92f
9SHA1 (patch-ae) = 30a31df58bbcae854ded212ad42bde5b855a7318 10SHA1 (patch-ae) = 30a31df58bbcae854ded212ad42bde5b855a7318
 11SHA1 (patch-af) = 9b2b8c5dfe1b2dc9ca76587cdb323272f8cb103e
10SHA1 (patch-aj) = 7707c5f8bb57bbacbd1d3c6f37a34916baacc363 12SHA1 (patch-aj) = 7707c5f8bb57bbacbd1d3c6f37a34916baacc363
11SHA1 (patch-ak) = ef0bf533754e5392c419c251aac8278b5e90b438 13SHA1 (patch-ak) = ef0bf533754e5392c419c251aac8278b5e90b438
12SHA1 (patch-am) = 4e068210bcbea638d143bd9fb566795636d77b35 14SHA1 (patch-am) = 4e068210bcbea638d143bd9fb566795636d77b35
13SHA1 (patch-an) = b541a2e78398aba03a43bf5b38140661dd959e76 15SHA1 (patch-an) = b541a2e78398aba03a43bf5b38140661dd959e76
14SHA1 (patch-ao) = a843f4d7dde6e1d701cf65b87458c44d6a8fa7d1 16SHA1 (patch-ao) = a843f4d7dde6e1d701cf65b87458c44d6a8fa7d1
15SHA1 (patch-ap) = faad589de5971460b65ee9c0c4f01b035fb74b44 17SHA1 (patch-ap) = faad589de5971460b65ee9c0c4f01b035fb74b44
16SHA1 (patch-aq) = 5d040fa79de68ec4a673db93caf3a9434c22a029 18SHA1 (patch-aq) = 5d040fa79de68ec4a673db93caf3a9434c22a029
17SHA1 (patch-ar) = d681a5e6daef094da957f198ab1607dca95a306a 19SHA1 (patch-ar) = d681a5e6daef094da957f198ab1607dca95a306a
18SHA1 (patch-as) = 15ab1dcc2d6a445b119b7f2bb8a8331b4aa1fbd0 20SHA1 (patch-as) = 15ab1dcc2d6a445b119b7f2bb8a8331b4aa1fbd0
19SHA1 (patch-at) = 470cbad6632038ff85aa942f74cab601e7f707fe 21SHA1 (patch-at) = 470cbad6632038ff85aa942f74cab601e7f707fe
20SHA1 (patch-au) = e5d90961b4d78c37dec196097a16e0b6ac22e3bb 22SHA1 (patch-au) = e5d90961b4d78c37dec196097a16e0b6ac22e3bb
21SHA1 (patch-av) = 252f3085a1e4986a25b46afa74837ca0562f4f05 23SHA1 (patch-av) = 252f3085a1e4986a25b46afa74837ca0562f4f05
22SHA1 (patch-xx) = c486e9ca2c9134caf60ec935bf086e29324b1979 24SHA1 (patch-xx) = c486e9ca2c9134caf60ec935bf086e29324b1979

cvs diff -r1.6 -r1.6.4.1 pkgsrc/editors/emacs/Attic/options.mk (expand / switch to unified diff)

--- pkgsrc/editors/emacs/Attic/options.mk 2007/11/01 06:44:08 1.6
+++ pkgsrc/editors/emacs/Attic/options.mk 2008/05/01 13:41:33 1.6.4.1
@@ -1,37 +1,39 @@ @@ -1,37 +1,39 @@
1# $NetBSD: options.mk,v 1.6 2007/11/01 06:44:08 uebayasi Exp $ 1# $NetBSD: options.mk,v 1.6.4.1 2008/05/01 13:41:33 rtr Exp $
2 2
3PKG_OPTIONS_VAR= PKG_OPTIONS.emacs 3PKG_OPTIONS_VAR= PKG_OPTIONS.emacs
4PKG_SUPPORTED_OPTIONS= x11 4PKG_SUPPORTED_OPTIONS= x11
5PKG_OPTIONS_OPTIONAL_GROUPS= toolkit 5PKG_OPTIONS_OPTIONAL_GROUPS= toolkit
6PKG_OPTIONS_GROUP.toolkit= gtk motif xaw 6PKG_OPTIONS_GROUP.toolkit= gtk motif xaw
7PKG_SUGGESTED_OPTIONS= x11 7PKG_SUGGESTED_OPTIONS= x11
8 8
9.include "../../mk/bsd.options.mk" 9.include "../../mk/bsd.options.mk"
10 10
11### 11###
12### Any of the "toolkit" options implies "x11". 12### Any of the "toolkit" options implies "x11".
13### 13###
14.if !empty(PKG_OPTIONS:Mgtk) || !empty(PKG_OPTIONS:Mmotif) || !empty(PKG_OPTIONS:Mxaw) 14.if !empty(PKG_OPTIONS:Mgtk) || !empty(PKG_OPTIONS:Mmotif) || \
 15 !empty(PKG_OPTIONS:Mxaw)
15. if empty(PKG_OPTIONS:Mx11) 16. if empty(PKG_OPTIONS:Mx11)
16PKG_OPTIONS+= x11 17PKG_OPTIONS+= x11
17. endif 18. endif
18.endif 19.endif
19 20
20### 21###
21### Default to using the Xaw X11 toolkit if none is specified. 22### Default to using the Athena X11 toolkit if none is specified.
22### 23###
23.if !empty(PKG_OPTIONS:Mx11) 24.if !empty(PKG_OPTIONS:Mx11)
24. if empty(PKG_OPTIONS:Mgtk) && empty(PKG_OPTIONS:Mmotif) && empty(PKG_OPTIONS:Mxaw) 25. if empty(PKG_OPTIONS:Mgtk) && empty(PKG_OPTIONS:Mmotif) && \
 26 empty(PKG_OPTIONS:Mxaw)
25PKG_OPTIONS+= xaw 27PKG_OPTIONS+= xaw
26. endif 28. endif
27.endif 29.endif
28 30
29### 31###
30### Support drawing pretty X11 widgets. 32### Support drawing pretty X11 widgets.
31### 33###
32.if !empty(PKG_OPTIONS:Mx11) 34.if !empty(PKG_OPTIONS:Mx11)
33. include "../../graphics/jpeg/buildlink3.mk" 35. include "../../graphics/jpeg/buildlink3.mk"
34. include "../../graphics/tiff/buildlink3.mk" 36. include "../../graphics/tiff/buildlink3.mk"
35. include "../../graphics/png/buildlink3.mk" 37. include "../../graphics/png/buildlink3.mk"
36. include "../../x11/libXpm/buildlink3.mk" 38. include "../../x11/libXpm/buildlink3.mk"
37 39
@@ -43,33 +45,31 @@ CONFIGURE_ARGS+= --with-gif @@ -43,33 +45,31 @@ CONFIGURE_ARGS+= --with-gif
43CONFIGURE_ARGS+= --with-jpeg 45CONFIGURE_ARGS+= --with-jpeg
44CONFIGURE_ARGS+= --with-png 46CONFIGURE_ARGS+= --with-png
45CONFIGURE_ARGS+= --with-tiff 47CONFIGURE_ARGS+= --with-tiff
46CONFIGURE_ARGS+= --with-x 48CONFIGURE_ARGS+= --with-x
47CONFIGURE_ARGS+= --with-xpm 49CONFIGURE_ARGS+= --with-xpm
48.else 50.else
49CONFIGURE_ARGS+= --without-gif 51CONFIGURE_ARGS+= --without-gif
50CONFIGURE_ARGS+= --without-jpeg 52CONFIGURE_ARGS+= --without-jpeg
51CONFIGURE_ARGS+= --without-png 53CONFIGURE_ARGS+= --without-png
52CONFIGURE_ARGS+= --without-tiff 54CONFIGURE_ARGS+= --without-tiff
53CONFIGURE_ARGS+= --without-x 55CONFIGURE_ARGS+= --without-x
54CONFIGURE_ARGS+= --without-xpm 56CONFIGURE_ARGS+= --without-xpm
55. if exists(/System/Library/Frameworks/Carbon.framework) 57. if exists(/System/Library/Frameworks/Carbon.framework)
56APPLICATIONS_DIR= Applications 
57CONFIGURE_ARGS+= --with-carbon 58CONFIGURE_ARGS+= --with-carbon
58CONFIGURE_ARGS+= --enable-carbon-app=${PREFIX}/${APPLICATIONS_DIR} 59CONFIGURE_ARGS+= --enable-carbon-app=${PREFIX}/Applications
59PLIST_SRC+= PLIST.carbon 60PLIST_SRC+= PLIST.carbon
60PLIST_SUBST+= APPLIDATIONS_DIR=${APPLICATIONS_DIR:Q} 61INSTALLATION_DIRS+= Applications
61INSTALLATION_DIRS+= ${APPLICATIONS_DIR} 62CHECK_WRKREF_SKIP+= Applications/Emacs.app/Contents/MacOS/Emacs
62CHECK_WRKREF_SKIP+= ${APPLICATIONS_DIR}/Emacs.app/Contents/MacOS/Emacs 
63. endif 63. endif
64.endif 64.endif
65 65
66### 66###
67### Support using GTK X11 widgets. 67### Support using GTK X11 widgets.
68### 68###
69.if !empty(PKG_OPTIONS:Mgtk) 69.if !empty(PKG_OPTIONS:Mgtk)
70. include "../../x11/gtk2/buildlink3.mk" 70. include "../../x11/gtk2/buildlink3.mk"
71CONFIGURE_ARGS+= --with-x-toolkit=gtk 71CONFIGURE_ARGS+= --with-x-toolkit=gtk
72.endif 72.endif
73 73
74### 74###
75### Support using Motif X11 widgets. 75### Support using Motif X11 widgets.

File Deleted: pkgsrc/editors/emacs-nox11/DESCR

cvs diff -r1.27 -r1.27.6.1 pkgsrc/editors/emacs-nox11/Makefile (expand / switch to unified diff)

--- pkgsrc/editors/emacs-nox11/Makefile 2007/08/13 12:40:57 1.27
+++ pkgsrc/editors/emacs-nox11/Makefile 2008/05/01 13:41:33 1.27.6.1
@@ -1,13 +1,16 @@ @@ -1,13 +1,16 @@
1# $NetBSD: Makefile,v 1.27 2007/08/13 12:40:57 jlam Exp $ 1# $NetBSD: Makefile,v 1.27.6.1 2008/05/01 13:41:33 rtr Exp $
2 2
3PKGNAME= emacs-nox11-${EMACSVERSION} 3PKGNAME= ${DISTNAME:S/-/-nox11-/}
4COMMENT_EXTRA= : non-X11 version 
5 4
6CONFLICTS+= emacs-[0-9]* 5FILESDIR= ${.CURDIR}/../../editors/emacs/files
 6PATCHDIR= ${.CURDIR}/../../editors/emacs/patches
 7PKGDIR= ${.CURDIR}/../../editors/emacs
 8
 9# Mirror PKG_DESTDIR_SUPPORT setting from emacs/Makefile.
 10PKG_DESTDIR_SUPPORT= user-destdir
7 11
8.include "../../mk/bsd.prefs.mk" 12.include "../../mk/bsd.prefs.mk"
9 13
10# Forcibly remove any "x11" options. 
11PKG_OPTIONS.emacs+= -x11 -gtk -motif -xaw 14PKG_OPTIONS.emacs+= -x11 -gtk -motif -xaw
12 15
13.include "../../editors/emacs/Makefile" 16.include "../../editors/emacs/Makefile"

File Added: pkgsrc/editors/emacs/patches/Attic/patch-ac
$NetBSD: patch-ac,v 1.15.8.1 2008/05/01 13:41:33 rtr Exp $

--- lisp/files.el.orig	2007-05-25 13:43:31.000000000 +0100
+++ lisp/files.el	2008-04-29 12:41:52.000000000 +0100
@@ -2736,8 +2736,8 @@
 		;; If caller wants only the safe variables,
 		;; install only them.
 		(dolist (elt result)
-		  (unless (or (memq (car elt) unsafe-vars)
-			      (memq (car elt) risky-vars))
+		  (unless (or (member elt unsafe-vars)
+			      (member elt risky-vars))
 		    (hack-one-local-variable (car elt) (cdr elt))))
 	      ;; Query, except in the case where all are known safe
 	      ;; if the user wants no quuery in that case.

File Added: pkgsrc/editors/emacs/patches/Attic/patch-af
$NetBSD: patch-af,v 1.10.8.1 2008/05/01 13:41:33 rtr Exp $

--- lib-src/vcdiff.orig	2007-01-21 04:49:26.000000000 +0000
+++ lib-src/vcdiff	2008-04-29 12:48:03.000000000 +0100
@@ -4,13 +4,13 @@
 # This version is more compatible with rcsdiff(1).
 #
 # Copyright (C) 1992, 1993, 1995, 1997, 2001, 2002, 2003, 2004,
-#               2005, 2006, 2007 Free Software Foundation, Inc.
+#               2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 #
 # This file is part of GNU Emacs.
 #
 # GNU Emacs is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
+# the Free Software Foundation; either version 3, or (at your option)
 # any later version.
 #
 # GNU Emacs is distributed in the hope that it will be useful,
@@ -84,14 +84,14 @@
 	case $f in
 	s.* | */s.*)
 		if
-			rev1=/tmp/geta$$
+			rev1=`mktemp /tmp/geta.XXXXXXXX`
 			get -s -p -k $sid1 "$f" > $rev1 &&
 			case $sid2 in
 			'')
 				workfile=`expr " /$f" : '.*/s.\(.*\)'`
 				;;
 			*)
-				rev2=/tmp/getb$$
+				rev2=`mktemp /tmp/getb.XXXXXXXX`
 				get -s -p -k $sid2 "$f" > $rev2
 				workfile=$rev2
 			esac