From owner-freebsd-arch@freebsd.org Sat Oct 3 21:09:01 2015 Return-Path: Delivered-To: freebsd-arch@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 88BD6A0F52E for ; Sat, 3 Oct 2015 21:09:01 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client CN "mailhost.stack.nl", Issuer "CA Cert Signing Authority" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 55A771A12; Sat, 3 Oct 2015 21:09:01 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id A3E6DB801F; Sat, 3 Oct 2015 23:08:57 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 8D84628494; Sat, 3 Oct 2015 23:08:57 +0200 (CEST) Date: Sat, 3 Oct 2015 23:08:57 +0200 From: Jilles Tjoelker To: Bryan Drewery Cc: freebsd-arch@FreeBSD.org Subject: Re: login -f changing session getlogin(2) Message-ID: <20151003210857.GA57303@stack.nl> References: <560D826D.7000302@FreeBSD.org> <20151001203436.GA22737@stack.nl> <560DAD6D.7050007@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <560DAD6D.7050007@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2015 21:09:01 -0000 On Thu, Oct 01, 2015 at 03:02:21PM -0700, Bryan Drewery wrote: > Can't we use something like forkpty(3) for the child to avoid the issues > you mention? It calls setsid(2) via login_tty(3). This would make sense for a special impersonation tool or for a paranoid version of su, but not for a normal login. You can do this right now using script(1), for example script /dev/null login -f SOMEUSER -- Jilles Tjoelker