From owner-freebsd-x11@FreeBSD.ORG Sun Apr 22 17:22:33 2012 Return-Path: Delivered-To: freebsd-x11@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4859106564A for ; Sun, 22 Apr 2012 17:22:33 +0000 (UTC) (envelope-from mailnull@mips.inka.de) Received: from mail-in-08.arcor-online.net (mail-in-08.arcor-online.net [151.189.21.48]) by mx1.freebsd.org (Postfix) with ESMTP id 9818C8FC12 for ; Sun, 22 Apr 2012 17:22:33 +0000 (UTC) Received: from mail-in-15-z2.arcor-online.net (mail-in-15-z2.arcor-online.net [151.189.8.32]) by mx.arcor.de (Postfix) with ESMTP id 1223F1FB895 for ; Sun, 22 Apr 2012 18:50:13 +0200 (CEST) Received: from mail-in-18.arcor-online.net (mail-in-18.arcor-online.net [151.189.21.58]) by mail-in-15-z2.arcor-online.net (Postfix) with ESMTP id 0E8E233E28F for ; Sun, 22 Apr 2012 18:50:13 +0200 (CEST) Received: from lorvorc.mips.inka.de (dslb-092-075-194-200.pools.arcor-ip.net [92.75.194.200]) by mail-in-18.arcor-online.net (Postfix) with ESMTPS id DC9A73DC89C for ; Sun, 22 Apr 2012 18:50:12 +0200 (CEST) X-DKIM: Sendmail DKIM Filter v2.8.2 mail-in-18.arcor-online.net DC9A73DC89C Received: from lorvorc.mips.inka.de (localhost [127.0.0.1]) by lorvorc.mips.inka.de (8.14.5/8.14.3) with ESMTP id q3MGoCQQ058404 for ; Sun, 22 Apr 2012 18:50:12 +0200 (CEST) (envelope-from mailnull@lorvorc.mips.inka.de) Received: (from mailnull@localhost) by lorvorc.mips.inka.de (8.14.5/8.14.5/Submit) id q3MGoCZX058403 for freebsd-x11@freebsd.org; Sun, 22 Apr 2012 18:50:12 +0200 (CEST) (envelope-from mailnull) From: naddy@mips.inka.de (Christian Weisgerber) Date: Sun, 22 Apr 2012 16:50:12 +0000 (UTC) Message-ID: Originator: naddy@mips.inka.de (Christian Weisgerber) To: freebsd-x11@freebsd.org Subject: x11/luit cleanup X-BeenThere: freebsd-x11@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: X11 on FreeBSD -- maintaining and support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Apr 2012 17:22:34 -0000 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 -- Christian "naddy" Weisgerber naddy@mips.inka.de