"grep" not working
Ric Moore
wayward4now
Thu May 17 15:12:03 PDT 2007
On Thu, 2007-05-17 at 14:08 -0500, David Bandel wrote:
> On 5/17/07, Bill Campbell <linux-sxs at celestial.com> wrote:
> > On Thu, May 17, 2007, David Bandel wrote:
> > >On 5/17/07, Net Llama! <netllama at linux-sxs.org> wrote:
> > >> On Thu, 17 May 2007, Bill Campbell wrote:
> > >> > On Thu, May 17, 2007, Net Llama! wrote:
> > >> >> On Thu, 17 May 2007, David Bandel wrote:
> > >> >>> Here's why I personally _never_ allow anyone (especially root) to have
> > >> >>> "." in the PATH, and any personal directories ($HOME, $HOME/bin) last.
> > >> >>>
> > >> >>
> > >> >> How do you prevent someone from running "export PATH=$PATH:." ?
> > >> >
> > >> > Linux/Unix is a system for adults, not children, so there's no
> > >> > way to protect people from their own stupidity. You may be able
> > >> > to cure ignorance, but you can't fix stupid.
> > >>
> > >> Exactly, which is why I don't understand how David claims thath he
> > >> prevents it.
> > >
> > >If you read what the original poster found, it was only when he used
> > >`su -` picking up the users' environment -- the user had no chance to
> > >enter export PATH=.:$PATH, so it was in the users' rc files. In
> > >/etc/skel, I link rc files to those in /etc/ which they can't change.
> >
> > Actually ``su -'' picks up the root login environment. Omitting
> > the ``-'' keeps the user's environment.
> >
>
> Ahhhh! Let me go through this _really_ slow for those who didn't
> reread the original post solution.
>
> The guy went in as root and all worked. He then ran `su - $USER`
> (whoever that user is) and nothing worked because he picked up the
> users' environment (what the '-' does). He exited and run only `su
> $USER` _not_ picking up the user's environment and it worked. That
> gave him the clue that something in the users' environment (like the
> PATH variable) was hosed since he picked it up the first time, and
> didn't the second time.
>
> And yes, if you don't put a $USER after the su (with or without the
> '-') root is assumed.
>
> Is that better? Jeez I hate all this unnecessary typing. Someone
> must think my name is Ric.
Hey! I wuz just minding my own business and enjoying the thread when
someone mentioned my name. At least you took a pointer from me and
posted in plain English instead of "geek-speek". You getting MUCH better
Meester Bandel. Heck, I understood what you provided. That's a plus!
<giggles> Ric
--
More information about the Linux-users
mailing list