From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gatech.edu (gatech.edu [130.207.244.244]) by werple.net.au (8.7/8.7) with SMTP id EAA19580 for ; Sat, 21 Oct 1995 04:56:57 +1000 (EST) Received: from euclid (euclid.skiles.gatech.edu) by gatech.edu with SMTP id AA20938 (5.65c/Gatech-10.0-IDA for ); Fri, 20 Oct 1995 14:50:47 -0400 Received: by euclid (5.x/SMI-SVR4) id AA01475; Fri, 20 Oct 1995 14:49:15 -0400 Resent-Date: Fri, 20 Oct 1995 19:50:08 +0100 (MET) Old-Return-Path: From: Zoltan Hidvegi Message-Id: <199510201850.TAA06402@bolyai.cs.elte.hu> Subject: Re: global zlogout and .zlogout To: zsh-workers@math.gatech.edu (zsh-workers) Date: Fri, 20 Oct 1995 19:50:08 +0100 (MET) In-Reply-To: <9510181928.AA01846@redwood.skiles.gatech.edu> from "Richard Coleman" at Oct 18, 95 03:28:02 pm X-Mailer: ELM [version 2.4 PL24] Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Resent-Message-Id: <"IwWzR1.0.wM.hy-Xm"@euclid> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/488 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu > I meant to say the global zshenv, not the global zlogin. But the more I > think about it, I'm no longer happy with this idea. There should be > someway to suppress the sourcing of the global zlogout. But you don't > want users to be able to do this. I believe it was Zoltan who mentioned > sourcing the global zlogout only if the global zlogin was sourced. That is > easy to do. Before anything is changed, I would like to know for what > purposes are people using the global zlogout file. The is no way to prevent the user to avoid the global zlogout. Anyone can exit the shell with kill -9 $$. One can even put kill -9 $$ into her .zlogout which is executed before the global zlogout. That's why I think that we can use no_rcs to decide whether zlogout should be executed or not. > > >Also, I now realize another potential problem. When the init scripts > > >are sourced when the shell is starting up, there is a hack (setting the > > >sourcelevel to 32768) that prevents an error in these scripts from tripping > > >ERREXIT. This same should probably apply to the global zlogout and .zlogout. > > > > Only to the global one. The user's one is his problem. > > ERREXIT is suppressed for all the init script (both global and personal). > Seems like the same should be the case for the global zlogout and .zlogout. That's right. But this is because an errexit during the init scripts may lock out a user from her shell. An init script should not exit to give a chance to the user to correct her mistake. In logout scripts there is no such danger I think but as you said it depends on the function of the global zlogout script. But there are other things which can be changed here. Currently the order of sourcing in a login shell is: GLOBAL_ZSHENV, .zshenv, GLOBAL_ZPROFILE, .zprofile, GLOBAL_ZSHRC, .zshrc, GLOBAL_ZLOGIN, .zlogin This means that a clever user can avoid every global init scripts except the GLOBAL_ZSHENV. So everything which must be executed should be put here. But we must keep it small and fast since it is executed on all zsh invocations. One solution may be to execute all of the user init scripts after the global ones. The global zlogin can be an exception here since zprofile has similar functions. Cheers, Zoltan