From owner-freebsd-current@FreeBSD.ORG Thu Oct 18 19:31:59 2007 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C66816A417 for ; Thu, 18 Oct 2007 19:31:59 +0000 (UTC) (envelope-from askbill@conducive.net) Received: from conducive.net (lindfield.ch [203.194.153.81]) by mx1.freebsd.org (Postfix) with ESMTP id 44CA113C46B for ; Thu, 18 Oct 2007 19:31:58 +0000 (UTC) (envelope-from askbill@conducive.net) Received: from cm218-253-81-177.hkcable.com.hk ([218.253.81.177]:63807 helo=pb.local) by conducive.net with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.63 (FreeBSD)) (envelope-from ) id 1Iib65-0006pe-C7 for freebsd-current@freebsd.org; Thu, 18 Oct 2007 19:31:57 +0000 Message-ID: <4717B4AD.6000706@conducive.net> Date: Thu, 18 Oct 2007 15:31:57 -0400 From: =?UTF-8?B?6Z+T5a625qiZIEJpbGwgSGFja2Vy?= User-Agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1.2) Gecko/20070221 SeaMonkey/1.1.1 MIME-Version: 1.0 To: freebsd-current@freebsd.org References: <00bd01c810ec$10371230$0c00a8c0@Artem> <8cb6106e0710171143m3dff7546o457192ede76e6598@mail.gmail.com> <012c01c810f3$aafeecf0$0c00a8c0@Artem> <20071017193615.GO9006@server.vk2pj.dyndns.org> <20071018174506.GB420@dragon.NUXI.org> In-Reply-To: <20071018174506.GB420@dragon.NUXI.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: Broken su in current - trying to fix myself, help needed! X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2007 19:31:59 -0000 David O'Brien wrote: > On Thu, Oct 18, 2007 at 05:36:15AM +1000, Peter Jeremy wrote: >> This bug (or another one with identical symptoms) affects the 'su' >> commands within the ports build system if you are using tcsh or zsh > > or bash > > It has been suggested that reverting rev 1.79 of su.c may address the issue. > > ---------------------------- > revision 1.79 > date: 2006/01/03 09:17:04; author: brian; state: Exp; lines: +14 -1 > Fix the other su bug reintroduced two commits ago, namely > > $ su > % kill -STOP $$ > > where su is executing (t)csh. csh's job handling is a little more > special than that of (a)sh, bash and even zsh and blows up a little > more spectacularly. This modification restores the original mucking > about with the tty pgrp, but is careful to only do it when su (or > su's child) is the foreground process > ---------------------------- Well.... if 'blows up...' wasn't hyperbole, back in 2006, and IF calling for a pid on a dead/nonexistent process reliably returns the *same* invalid pid tday (100000 was cited) it might be safer for the time being to do a compare on that value then continue the march if matched. Belt and braces - at least 'til it can be better checked and cleaned up properly. JFWIW, pkgdb here lists around 600 packages and on each of three test slices, 2 i386, 1 amd64. Probably 90% were invoked from a csh, the rest with bash. Maybe 80% were built from a terminal in xfce4, and guessing that 80% were pkg_add'ed, rest were: cd /usr/ports// make install [-DFORCE_PKG_REGISTER]. Quite a few more attempted and failed did so for clear reasons not related to su. Not ONE instance of any *detectable* difficulty with su as-it-is-now. But 100% were built su'ed to root *before* running. Bill