Date: Sun, 22 Apr 2012 16:50:12 +0000 (UTC) From: naddy@mips.inka.de (Christian Weisgerber) To: freebsd-x11@freebsd.org Subject: x11/luit cleanup Message-ID: <jn1cs4$1p0q$1@lorvorc.mips.inka.de>
next in thread | raw e-mail | index | archive | help
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@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@mips.inka.de
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?jn1cs4$1p0q$1>