🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.bugs.sys5
Article #886

Should "su -" set SHELL?

#886
From: David Elliott
Date: Thu, 27 Oct 1988 14:24
25 lines
1351 bytes
In SVR3 (and SVR3.1), if you run su with the - option, it clears out
the environment and executes the shell (found in the password file) of
the new user, but, unlike login, and unlike you might expect, does not
set the environment variable SHELL to this value.

This means that programs that use the value of SHELL to execute
subshells use /bin/sh, no matter what shell is being used
interactively.

When I first heard of this problem, I changed su to set SHELL just as
login would.

The problem is that this broke sysadm.  The admin login shell (via
/usr/admin/.profile) looks to see if SHELL is set to /bin/rsh to
tell it if the process was invoked via su or login, and uses this
information to figure out how it should get any arguments.

So, now we're back to where we started; su - doesn't work like
login, and could be considered to be broken.

Anyone have any opinion on this?

-- 
David Elliott		dce@mips.com  or  {ames,prls,pyramid,decwrl}!mips!dce
Technical Details
Message-ID: <7152@dunkshot.mips.COM>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ames!vsi1!wyse!mips!dce

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ames!vsi1!wyse!mips!dce
From: dce@mips.COM (David Elliott)
Newsgroups: comp.bugs.sys5
Subject: Should "su -" set SHELL?
Message-ID: <7152@dunkshot.mips.COM>
Date: 27 Oct 88 14:24:19 GMT
Reply-To: dce@mips.COM (David Elliott)
Organization: MIPS Computer Systems, Sunnyvale, CA
Lines: 24