OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: /etc/suid_profile

From: Peter Fraser (pjfthinkage.ca)
Date: Tue May 09 2006 - 12:25:44 CDT


from "man ksh":

-p Privileged shell. A shell is ``privileged'' if this option is
     used or if the real user ID or group ID does not match the effec-
     tive user ID or group ID (see getuid(2) and getgid(2)).

I would have thought starting with a non privileged userid
(not quite true, it has "wheel" as one of its groups)
and going "sudo ksh" or "sudo ksh -l" should put you
into a privileged shell.

-----Original Message-----
From: owner-miscopenbsd.org [mailto:owner-miscopenbsd.org] On Behalf
Of Jason McIntyre
Sent: Tuesday, May 09, 2006 12:53 PM
To: miscopenbsd.org
Subject: Re: /etc/suid_profile

On Tue, May 09, 2006 at 12:13:33PM -0400, Peter Fraser wrote:
> I was a user of "bash", but with 3.9 I thought
> I would try to use ksh my normal shell. So
> far so good. One problem though, "man ksh"
> states:
>
> A privileged shell does not process $HOME/.profile
> nor the ENV parameter. Instead, the file
> /etc/suid_profile is processed.
>
> 1) /etc/suid_profile is not getting executed.
> I don't know why, its ownership is "root:wheel" with
> permission 700.
>
> 2) ENV will get process with privileged shells on
> recursive calls. For example:
>
> sudo ksh
> export ENV=~/.kshrc
> ksh
>
> you will see with the second ksh, that the ENV
> was executed.
>
> Any help please

are you sure that your initial shell invocation is a privileged shell?
i.e. somewhere along the line, -p is happening.

jmc