x11/luit cleanup

Christian Weisgerber naddy at mips.inka.de
Sun Apr 22 17:22:34 UTC 2012


Short version:
Simplify x11/luit port, remove need for setuid.

Long version:
Portable PTY allocation is a mess.  In configure, luit checks for
grantpt(), which we have, and then skips the check for openpty().
The actual luit code tries to open /dev/ptmx, which FreeBSD 7 lacks,
and since it already skipped openpty(), it then falls back to directly
open()ing /dev/pty's, chowning them (which requires setuid), etc.

Instead, simply pretend that we don't have grantpt(), so luit will
use openpty(), which is available on all versions of FreeBSD, and
doesn't require setuid.

Anybody disagree?

Index: Makefile
===================================================================
RCS file: /home/pcvs/ports/x11/luit/Makefile,v
retrieving revision 1.7
diff -u -r1.7 Makefile
--- Makefile	11 Oct 2011 03:14:29 -0000	1.7
+++ Makefile	22 Apr 2012 16:39:15 -0000
@@ -7,6 +7,7 @@
 
 PORTNAME=	luit
 PORTVERSION=	1.1.0
+PORTREVISION=	1
 CATEGORIES=	x11
 
 MAINTAINER=	x11 at FreeBSD.org
@@ -15,25 +16,13 @@
 XORG_CAT=	app
 USE_XORG=	x11 fontenc
 
-CFLAGS+=	-DBSD
 CONFIGURE_ARGS=	--datadir=${LOCALBASE}/lib
 
+# Use openpty(), FreeBSD 7 has grantpt but not /dev/ptmx
+CONFIGURE_ENV=	ac_cv_func_grantpt=no
+
 PLIST_FILES=	bin/luit
 
 MAN1=		luit.1
 
-.if !defined(WITH_SETUID_LUIT)
-pre-everything::
-	@${ECHO_MSG} "If you want to use xterm with locales in a secure manner, luit must be"
-	@${ECHO_MSG} "installed setuid.  If you want to do this, define WITH_SETUID_LUIT when"
-	@${ECHO_MSG} "installing this port (either in /etc/make.conf or on command line with"
-	@${ECHO_MSG} "install target)."
-.endif
-
-post-install:
-.if defined(WITH_SETUID_LUIT)
-	${CHOWN} root:wheel ${PREFIX}/bin/luit
-	${CHMOD} 04711 ${PREFIX}/bin/luit
-.endif
-
 .include <bsd.port.mk>
-- 
Christian "naddy" Weisgerber                          naddy at mips.inka.de



More information about the freebsd-x11 mailing list