From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12068 invoked from network); 22 Oct 2008 13:39:38 -0000 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.2.5 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 22 Oct 2008 13:39:38 -0000 Received-SPF: none (ns1.primenet.com.au: domain at sunsite.dk does not designate permitted sender hosts) Received: (qmail 87482 invoked from network); 22 Oct 2008 13:39:06 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 22 Oct 2008 13:39:06 -0000 Received: (qmail 13985 invoked by alias); 22 Oct 2008 13:38:23 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 13371 Received: (qmail 17545 invoked from network); 22 Oct 2008 02:31:39 -0000 Received: from bifrost.dotsrc.org (130.225.254.106) by sunsite.dk with SMTP; 22 Oct 2008 02:31:39 -0000 Received: from mail-gx0-f21.google.com (mail-gx0-f21.google.com [209.85.217.21]) by bifrost.dotsrc.org (Postfix) with ESMTP id 9196080524C2 for ; Wed, 22 Oct 2008 04:31:34 +0200 (CEST) Received: by gxk14 with SMTP id 14so6415453gxk.21 for ; Tue, 21 Oct 2008 19:31:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:reply-to :organization:user-agent:mime-version:to:cc:subject:references :in-reply-to:x-enigmail-version:content-type :content-transfer-encoding:from; bh=xwM1iPNVIbZHMGQ91t17/+fRnfVJWpcRfGPxVs0inSU=; b=xiM9mN2mA9TBPFquLmhxSfh9WotoBd5/tfUB/ywhKYNPaTq69ZD93o4FI1I2s0XMrg MI929/mEnuQWA8WqFEYdokGa0bxM9EGKTuKtdeIt6mFEHheMx8crkV3m7Y212UpSa6M2 ZIDWJVz2anjtyToaOd/raKSSwfeEpCbN7ALHA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:reply-to:organization:user-agent:mime-version:to:cc :subject:references:in-reply-to:x-enigmail-version:content-type :content-transfer-encoding:from; b=qj0xW4ir8jjeQY8N4qRVw+PdxFc1EUlchH8Cik4r7EJ1TvcHgZLYl2CUJnsr+ahh88 ivNirFalf5KtUUp4W+E/Ge2L87Da4CABGA7X7eipCobf+D1fs4wt8f3jgzNzg/ed7NhE ql6fyFz1Jc5vZWuFifTHEHoBDNtl9hWcUsuBw= Received: by 10.90.113.17 with SMTP id l17mr379030agc.40.1224642692942; Tue, 21 Oct 2008 19:31:32 -0700 (PDT) Received: from z4.local (h229.149.31.71.dynamic.ip.windstream.net [71.31.149.229]) by mx.google.com with ESMTPS id 5sm21305853yxt.1.2008.10.21.19.31.31 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 21 Oct 2008 19:31:32 -0700 (PDT) Message-ID: <48FE9074.5020103@case.edu> Date: Tue, 21 Oct 2008 22:31:16 -0400 Reply-To: Chet Ramey Organization: ITS, Case Western Reserve University User-Agent: Thunderbird 2.0.0.17 (Macintosh/20080914) MIME-Version: 1.0 To: dqarras@yahoo.com, zsh-workers+phil.pennock@spodhuis.org CC: ZSH Users , pws@pws-pc.ntlworld.com, chet.ramey@case.edu Subject: Re: SHELL not always correct References: <903527.44182.qm@web36808.mail.mud.yahoo.com> <200810212058.m9LKwXQe009278@pws-pc.ntlworld.com> <20081021231323.GA89901@redoubt.spodhuis.org> In-Reply-To: <20081021231323.GA89901@redoubt.spodhuis.org> X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit From: Chet Ramey X-Virus-Scanned: ClamAV 0.92.1/8466/Wed Oct 22 03:00:16 2008 on bifrost X-Virus-Status: Clean Phil Pennock wrote: > I don't want to read the bash source and end up with tainted knowledge > or whatever the term is, but this seems safe enough: > > # cd /usr/ports/shells/bash > # make extract > # fgrep -r '"SHELL"' work > work/bash-3.2/variables.c: temp_var = find_variable ("SHELL"); > work/bash-3.2/variables.c: temp_var = bind_variable ("SHELL", current_user.shell, 0); > work/bash-3.2/shell.c: set_var_read_only ("SHELL"); > > Okay, I peeked at variables.c and this comment: > /* Set $SHELL to the user's login shell if it is not already set. Call > get_current_user_info if we haven't already fetched the shell. */ > decorates set_shell_var() which forcibly claims SHELL for itself. > > Seems rather presumptuous, to claim to child processes that you are the > user's chosen preferred shell, merely because you're running. Gee, it sure would be. If only that were happening. Since you don't want to read the bash source to avoid contaminating yourself, why are you speculating? The comment is accurate: the function sets SHELL to the user's login shell if it's not already set. Bash neither presumes it is the preferred shell nor overrides a user's intent. It does assume that the login shell is the appropriate `preferred shell'. Bash used to auto-export SHELL because programs like tset and make still depend on its value. If the current version sets the value, however, it doesn't export it. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer Chet Ramey, ITS, CWRU chet@case.edu http://cnswww.cns.cwru.edu/~chet/