[comp.sys.3b1] Bug in /bin/su?

kevin@kosman.UUCP (Kevin O'Gorman) (03/04/91)

I'm not sure I understand all the issues here, but I'm having trouble
with /bin/su.

After logging in, if I su to anything, it works as expected; if I then
try to su to something else, there seems to be no actual change of
which user I am.

For instance, if I want to su to 'news', which is generally unavailable
for normal login, on most systems you can su to root and then su to
news.  On the 3b1 this doesn't work -- you're stuck as root.

On this system, it seems that to work as 'news' I have to log in originally
as 'root' and use /bin/su only once.  This does seem to work.

The reasons that I think this is a bug are (1) there's no error report
and (2) the second /bin/su does actually leave you running a subshell,
just not as the user you expect.

Anyone with more insight?
-- 
Kevin O'Gorman ( kevin@kosman.UUCP, kevin%kosman.uucp@nrc.com )
voice: 805-984-8042 Vital Computer Systems, 5115 Beachcomber, Oxnard, CA  93035
Non-Disclaimer: my boss is me, and he stands behind everything I say.

dnichols@ceilidh.beartrack.com (DoN Nichols) (03/05/91)

In article <1299@kosman.UUCP> kevin@kosman.UUCP (Kevin O'Gorman) writes:
>I'm not sure I understand all the issues here, but I'm having trouble
>with /bin/su.

	[ ... ]
>
>For instance, if I want to su to 'news', which is generally unavailable
>for normal login, on most systems you can su to root and then su to
>news.  On the 3b1 this doesn't work -- you're stuck as root.

	I just shelled out of trn, su'ed from my personal account (dnichols)
to root, ran id(1), and got the expected response, and then su'ed to news,
ran id(1), and got the expected response (news), (news).  I than backed out,
doing id(1) at each step, and got the expected response.  On my system, it
does not seem to be broken!

	I'm running 3.51m, on a 7300 with 1MB on the motherboard, 1.5MB on a
combo board.

>On this system, it seems that to work as 'news' I have to log in originally
>as 'root' and use /bin/su only once.  This does seem to work.
>
>The reasons that I think this is a bug are (1) there's no error report
>and (2) the second /bin/su does actually leave you running a subshell,
>just not as the user you expect.

	Yes, it is a bug if it behaves as you describe, but is it due to the
software (su), or to some system configuration item?  Is there a valid home
directory for news?  What shell are you running?  Which version of the os?
How much core?  What are the modes on /bin/su?  On my system they are as
follows:

-rwsr-xr-x  1 root    sys        3488 Apr 18  1987 /bin/su

	Note the suid bit on owner, and the owner is root.  It SHOULD be
this way on your system, or you shouldn't be able to su TO root.

>Anyone with more insight?

	Give us more facts, then we'll try.  Since I can't duplicate the
behavior on my system, I don't know what is happening.

	Good Luck
		DoN.


-- 
Donald Nichols (DoN.)		| Voice (Days):	(703) 664-1585
D&D Data			| Voice (Eves):	(703) 938-4564
Disclaimer: from here - None	| Email:     <dnichols@ceilidh.beartrack.com>
	--- Black Holes are where God is dividing by zero ---

craig@attcan.UUCP (Craig Campbell) (03/09/91)

In article <1299@kosman.UUCP> kevin@kosman.UUCP (Kevin O'Gorman) writes:
>I'm not sure I understand all the issues here, but I'm having trouble
>with /bin/su.
>
>After logging in, if I su to anything, it works as expected; if I then
>try to su to something else, there seems to be no actual change of
>which user I am.

Kevin, I did not notice any reference to which Unix OS you are running, so
this may be way off base, but have you tried,

	su - <newuser>

instead of 

	su <newuser>
?

The first example MAY do what you desire (or not:-)).


>-- 
>Kevin O'Gorman ( kevin@kosman.UUCP, kevin%kosman.uucp@nrc.com )
>voice: 805-984-8042 Vital Computer Systems, 5115 Beachcomber, Oxnard, CA  93035
>Non-Disclaimer: my boss is me, and he stands behind everything I say.


Good Luck,

craig

kak@hico2.UUCP (Kris A. Kugel) (03/14/91)

In article <1299@kosman.UUCP>, kevin@kosman.UUCP (Kevin O'Gorman) writes:
> For instance, if I want to su to 'news', which is generally unavailable
> for normal login, on most systems you can su to root and then su to
> news.  On the 3b1 this doesn't work -- you're stuck as root.
> -- 
> Kevin O'Gorman ( kevin@kosman.UUCP, kevin%kosman.uucp@nrc.com )

I've just noticed this here, and now I'm starting to wonder:
is there something strange in the software I have here now,
that I didn't notice this before?  I could have sworn that this
worked before.  Perhaps a bug with my su alias (sets different history
file?)  Perhaps a mis-directed binary patch?

                               Kris A. Kugel
                             ( 908 ) 842-2707
                      uunet!tsdiag.ccur.com!hico2!kak
                        {daver,ditka,zorch}!hico2!kak
                      internet: kak@hico2.westmark.com