Re: [CentOS] su path hard coded?

2012-07-29 Thread Kahlil Hodgson
On 25/07/12 20:10, Stephen Harris wrote: On Tue, Jul 24, 2012 at 11:27:09PM -0400, Karl Vogel wrote: On 07/24/12 4:33 PM, Stephen Harris wrote: S I want the ability to set the default path. That's all. It sounds like your best bet would be to change the source for su, and just be

Re: [CentOS] su path hard coded?

2012-07-25 Thread Stephen Harris
On Tue, Jul 24, 2012 at 11:27:09PM -0400, Karl Vogel wrote: On 07/24/12 4:33 PM, Stephen Harris wrote: S I want the ability to set the default path. That's all. It sounds like your best bet would be to change the source for su, and just be prepared to reinstall it if/when yum (or

Re: [CentOS] su path hard coded?

2012-07-24 Thread David G . Miller
Stephen Harris lists@... writes: On Mon, Jul 23, 2012 at 02:33:17PM -0500, Les Mikesell wrote: On Mon, Jul 23, 2012 at 2:18 PM, Stephen Harris lists@... wrote: On Mon, Jul 23, 2012 at 02:14:45PM -0500, Les Mikesell wrote: Can't you use the usual approach of 'su -' to pick up the target

Re: [CentOS] su path hard coded?

2012-07-24 Thread m . roth
David G. Miller wrote: Stephen Harris lists@... writes: On Mon, Jul 23, 2012 at 02:33:17PM -0500, Les Mikesell wrote: On Mon, Jul 23, 2012 at 2:18 PM, Stephen Harris lists@... wrote: On Mon, Jul 23, 2012 at 02:14:45PM -0500, Les Mikesell wrote: Can't you use the usual approach of 'su -'

Re: [CentOS] su path hard coded?

2012-07-24 Thread Les Mikesell
On Tue, Jul 24, 2012 at 1:36 PM, m.r...@5-cent.us wrote: Once a user has become root, they own the system. You really can't restrict them at that point. If you don't want them doing some things, perhaps su isn't the best solution. Good point, Dave. Stephen - are you sure you don't want

Re: [CentOS] su path hard coded?

2012-07-24 Thread Stephen Harris
On Tue, Jul 24, 2012 at 04:46:24PM +, David G. Miller wrote: Stephen Harris lists@... writes: You've missed the point. I want the ability to set the default path on 'su -' to be /bin:/usr/bin and then let the users override if they wish. I do not want the default path to be

Re: [CentOS] su path hard coded?

2012-07-24 Thread John R Pierce
On 07/24/12 4:33 PM, Stephen Harris wrote: I want the ability to set the default path. That's all. Just so that when I do su - foobar then the path defaults to /bin:/usr/bin. If foobar wants to add /usr/local/bin then foobar decides. If I decide I want the default path to be

Re: [CentOS] su path hard coded?

2012-07-24 Thread Stephen Harris
On Tue, Jul 24, 2012 at 04:43:54PM -0700, John R Pierce wrote: On 07/24/12 4:33 PM, Stephen Harris wrote: I want the ability to set the default path. That's all. Just so that set it in /etc/profile then. that gets run on su -l $someuser Who says all my users run /bin/sh or /bin/bash as

Re: [CentOS] su path hard coded?

2012-07-24 Thread Benjamin Franz
On 07/24/2012 04:33 PM, Stephen Harris wrote: I want the ability to set the default path. That's all. Just so that when I do su - foobar then the path defaults to /bin:/usr/bin. If foobar wants to add /usr/local/bin then foobar decides. If I decide I want the default path to be

Re: [CentOS] su path hard coded?

2012-07-24 Thread Karl Vogel
On 07/24/12 4:33 PM, Stephen Harris wrote: S I want the ability to set the default path. That's all. On Tue, Jul 24, 2012 at 04:43:54PM -0700, John R Pierce wrote: J set it in /etc/profile then. that gets run on su -l $someuser On Tue, 24 Jul 2012 19:53:23 -0400, Stephen Harris wrote: S Who

[CentOS] su path hard coded?

2012-07-23 Thread Stephen Harris
Is there any way of changing the PATH that's set by 'su' to be specific to my needs? It looks like 'su' has the path's hard coded. % rpm -qf /bin/su coreutils-5.97-34.el5_8.1 % strings /bin/su | grep local.bin /usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

Re: [CentOS] su path hard coded?

2012-07-23 Thread Les Mikesell
On Mon, Jul 23, 2012 at 2:00 PM, Stephen Harris li...@spuddy.org wrote: Is there any way of changing the PATH that's set by 'su' to be specific to my needs? It looks like 'su' has the path's hard coded. % rpm -qf /bin/su coreutils-5.97-34.el5_8.1 % strings /bin/su | grep local.bin

Re: [CentOS] su path hard coded?

2012-07-23 Thread Stephen Harris
On Mon, Jul 23, 2012 at 02:14:45PM -0500, Les Mikesell wrote: Can't you use the usual approach of 'su -' to pick up the target user's login environment? It's su - that causes the 'su' comman to rewrite the PATH to the hardcoded default. -- rgds Stephen

Re: [CentOS] su path hard coded?

2012-07-23 Thread Les Mikesell
On Mon, Jul 23, 2012 at 2:18 PM, Stephen Harris li...@spuddy.org wrote: On Mon, Jul 23, 2012 at 02:14:45PM -0500, Les Mikesell wrote: Can't you use the usual approach of 'su -' to pick up the target user's login environment? It's su - that causes the 'su' comman to rewrite the PATH to the

Re: [CentOS] su path hard coded?

2012-07-23 Thread Stephen Harris
On Mon, Jul 23, 2012 at 02:33:17PM -0500, Les Mikesell wrote: On Mon, Jul 23, 2012 at 2:18 PM, Stephen Harris li...@spuddy.org wrote: On Mon, Jul 23, 2012 at 02:14:45PM -0500, Les Mikesell wrote: Can't you use the usual approach of 'su -' to pick up the target user's login environment?

Re: [CentOS] su path hard coded?

2012-07-23 Thread Les Mikesell
On Mon, Jul 23, 2012 at 2:37 PM, Stephen Harris li...@spuddy.org wrote: But it should be executing the target user's .profile which can override it. '-' should be a synonym for -l or --login. You've missed the point. I want the ability to set the default path on 'su -' to be

Re: [CentOS] su path hard coded?

2012-07-23 Thread Stephen Harris
On Mon, Jul 23, 2012 at 02:52:28PM -0500, Les Mikesell wrote: On Mon, Jul 23, 2012 at 2:37 PM, Stephen Harris li...@spuddy.org wrote: You've missed the point. I want the ability to set the default path on 'su -' to be /bin:/usr/bin and then let the users override if they wish. I do not

Re: [CentOS] su path hard coded?

2012-07-23 Thread Les Mikesell
On Mon, Jul 23, 2012 at 3:02 PM, Stephen Harris li...@spuddy.org wrote: That's never a reasonable solution for an enterprise distro; what happens at the next yum update? :-) The reasonable solution is to live with the defaults... If the answer is it's hard coded; nothing you can do then I

Re: [CentOS] su path hard coded?

2012-07-23 Thread Stephen Harris
On Mon, Jul 23, 2012 at 03:31:12PM -0500, Les Mikesell wrote: Hmmm, per 'man su' on a debian system, you can override with ENV_PATH (default /bin:/usr/bin) or (for root) ENV_SUPATH (default /sbin:/bin:/usr/sbin:/usr/bin) /etc/login.defs. Adding /usr/local/bin must be an RH-specific patch.

Re: [CentOS] su path hard coded?

2012-07-23 Thread Robert Nichols
On 07/23/2012 02:37 PM, Stephen Harris wrote: On Mon, Jul 23, 2012 at 02:33:17PM -0500, Les Mikesell wrote: On Mon, Jul 23, 2012 at 2:18 PM, Stephen Harrisli...@spuddy.org wrote: On Mon, Jul 23, 2012 at 02:14:45PM -0500, Les Mikesell wrote: Can't you use the usual approach of 'su -' to pick

Re: [CentOS] su path hard coded?

2012-07-23 Thread Stephen Harris
On Mon, Jul 23, 2012 at 06:16:57PM -0500, Robert Nichols wrote: On 07/23/2012 02:37 PM, Stephen Harris wrote: You've missed the point. I want the ability to set the default path on 'su -' to be /bin:/usr/bin and then let the users override if they wish. I do not want the default path to

Re: [CentOS] su path hard coded?

2012-07-23 Thread Mogens Kjaer
On 07/23/2012 10:02 PM, Stephen Harris wrote: That's never a reasonable solution for an enterprise distro; what happens at the next yum update? :-) You could put your locally modified su into /usr/local/bin :-) Mogens -- Mogens Kjaer, m...@lemo.dk http://www.lemo.dk