zsh-workers
 help / color / mirror / code / Atom feed
From: Zoltan Hidvegi  <hzoli@cs.elte.hu>
To: zsh-workers@math.gatech.edu (zsh-workers)
Subject: Re: global zlogout and .zlogout
Date: Fri, 20 Oct 1995 19:50:08 +0100 (MET)	[thread overview]
Message-ID: <199510201850.TAA06402@bolyai.cs.elte.hu> (raw)
In-Reply-To: <9510181928.AA01846@redwood.skiles.gatech.edu> from "Richard Coleman" at Oct 18, 95 03:28:02 pm

> 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


      reply	other threads:[~1995-10-20 18:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-09-06 15:52 global zlogout Carlos Carvalho
1995-09-06 16:37 ` Zoltan Hidvegi
1995-10-18  5:59   ` global zlogout and .zlogout Richard Coleman
1995-10-18 18:54     ` Carlos Carvalho
1995-10-18 19:28       ` Richard Coleman
1995-10-20 18:50         ` Zoltan Hidvegi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=199510201850.TAA06402@bolyai.cs.elte.hu \
    --to=hzoli@cs.elte.hu \
    --cc=zsh-workers@math.gatech.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).