zsh-workers
 help / color / mirror / code / Atom feed
From: "Bart Schaefer" <schaefer@brasslantern.com>
To: Zefram <zefram@tao.co.uk>, zsh-workers@math.gatech.edu
Cc: aumuelle@mi.uni-erlangen.de
Subject: Re: Wrong emulation mode if exec'd by su
Date: Mon, 15 Jun 1998 08:52:38 -0700	[thread overview]
Message-ID: <980615085238.ZM4667@candle.brasslantern.com> (raw)
In-Reply-To: <199806151428.PAA10680@taos.demon.co.uk>

On Jun 15,  3:28pm, Zefram wrote:
} Subject: Re: Wrong emulation mode if exec'd by su
}
} The original behaviour is correct.  "su" really should not give the shell
} this weird argv[0] (some versions don't).  But on the older systems where
} it does, it's more likely that the shell being invoked is supposed to
} be sh, so treating a name of "su" as "sh" is the best behaviour.

For plain "su", I mostly agree.  For "su -" it's the user's login shell
that is supposed to be invoked.  (I suspect the reason for the "weird" $0
is so that it will show up in "ps" even after exec()ing the real shell.)

However, the fix in the patch is the wrong one.  Rather than looking for
every possible shell name in argv[0], the right thing would be to look
for "su" in argv[0], before testing the first letter for emulation, and
in that case do the emulation test on the value of $SHELL rather than on
argv[0].

I'm short of time this morning, but if that seems reasonable and no one
else does it first I may make a patch later today.

-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


  reply	other threads:[~1998-06-15 15:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-06-15 13:58 Martin Aumueller
1998-06-15 14:28 ` Zefram
1998-06-15 15:52   ` Bart Schaefer [this message]
1998-06-16  6:14     ` Bart Schaefer

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=980615085238.ZM4667@candle.brasslantern.com \
    --to=schaefer@brasslantern.com \
    --cc=aumuelle@mi.uni-erlangen.de \
    --cc=zefram@tao.co.uk \
    --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).