From owner-freebsd-questions Thu Aug 19 16:40: 8 1999 Delivered-To: freebsd-questions@freebsd.org Received: from scientia.demon.co.uk (scientia.demon.co.uk [212.228.14.13]) by hub.freebsd.org (Postfix) with ESMTP id C363414BD8 for ; Thu, 19 Aug 1999 16:39:45 -0700 (PDT) (envelope-from ben@scientia.demon.co.uk) Received: from lithium.scientia.demon.co.uk ([192.168.0.3] ident=exim) by scientia.demon.co.uk with esmtp (Exim 3.024 #3) id 11HZcu-000Dwq-00; Thu, 19 Aug 1999 22:21:36 +0100 Received: (from ben) by lithium.scientia.demon.co.uk (Exim 3.024 #3) id 11HZcs-0003f3-00; Thu, 19 Aug 1999 22:21:34 +0100 Date: Thu, 19 Aug 1999 22:21:33 +0100 From: Ben Smithurst To: Doug Cc: "Bill A. K." , FreeBSD Questions Subject: Re: roots shell Message-ID: <19990819222133.B12658@lithium.scientia.demon.co.uk> References: <002b01bee97f$2a3fdf60$01010101@bopper> <37BB45F2.71B6FFD3@gorean.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.95.6i In-Reply-To: <37BB45F2.71B6FFD3@gorean.org> Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Doug wrote: > Yes there is, but it's a bad idea. Several people have already pointed out > some reasons why. An additional alternative to su -m is to put the > following in /root/.login: > > [ -x /usr/local/bin/bash] && exec /usr/local/bin/bash > > That will start bash for you if it's available, and if it isn't you can > still log in. Wouldn't that fail (i.e. execute bash when it can't) if, say, bash existed and had the execute bit set, but a library it required on was trashed? I'd be tempted to try something like /usr/local/bin/bash --version >/dev/null 2>&1 && exec /usr/local/bin/bash to make sure it really can be executed, rather than just having the execute flag set. Or is that just paranoid? But a certain level of paranoia is a Good Thing, in my opinion. I just do this, what the hell, it saves me three keypresses :-) function su() { if [[ $# == 0 ]]; then command su -m else command su "$@" fi chpwd } I use zsh now, so I don't know if it knows about "function", "command" and "su". -- Ben Smithurst | PGP: 0x99392F7D ben@scientia.demon.co.uk | key available from keyservers and | ben+pgp@scientia.demon.co.uk To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message