openbsd-ports/textproc/groff/Makefile
schwarze 2ad97ee4b1 Following http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=538330,
Solar Designer did an audit of temp file handling in groff-1.20.
He found and fixed *lots* of ugliness, but most does not look
exploitable and some was already improved in groff-1.21.

This is my own fix for the only one that, with a huge amount of extra
paranoia, might be worth patching.  To mount an exploit, the attacker
would need to trick root into setting an unusable TMPDIR (or similar)
variable in the environment such that mktemp -d fails, then convince
root to run pdfroff (*you* don't run that as root, do you?), then
handle a race condition to find the PID and predict the temp file
name to mount a symlink attack.

"I think we should still go for the fix" jasper@
2011-06-23 12:14:51 +00:00

34 lines
868 B
Makefile

# $OpenBSD: Makefile,v 1.12 2011/06/23 12:14:51 schwarze Exp $
COMMENT = GNU troff typesetter
DISTNAME = groff-1.21
REVISION = 3
CATEGORIES = textproc
HOMEPAGE = http://www.gnu.org/software/groff/
MAINTAINER = Ingo Schwarze <schwarze@openbsd.org>
# GPLv3+
PERMIT_PACKAGE_CDROM = Yes
PERMIT_PACKAGE_FTP = Yes
PERMIT_DISTFILES_CDROM =Yes
PERMIT_DISTFILES_FTP = Yes
WANTLIB = c m stdc++
MASTER_SITES = ${MASTER_SITE_GNU:=groff/}
MAKE_FLAGS += docdir=${PREFIX}/share/doc/groff \
exampledir=${PREFIX}/share/examples/groff
CONFIGURE_STYLE = gnu
CONFIGURE_ARGS += --without-libiconv-prefix --without-gs --without-x
MODGNU_CONFIG_GUESS_DIRS = ${WRKSRC} ${WRKSRC}/src/libs/gnulib/build-aux
pre-configure:
find ${WRKBUILD} -name \*.pl -type f | \
xargs perl -pi -e 's@^#![[:space:]]*/usr/bin/env[[:space:]]+perl@#!/usr/bin/perl@'
.include <bsd.port.mk>