[colug-432] Prevent SU from changing CWD

Steve VanSlyck s.vanslyck at spamcop.net
Wed Mar 9 07:14:28 EST 2011


Well that was certainly simple enough - one box of assorted items from
the food group "chocolate" for you!

On Wed, 2011-03-09 at 07:11 -0500, Angelo McComis wrote:
> Leave off the -   The - means to emulate logging in, including cwd ~
> and loading the environment. 
> 
> 
> - Angelo
> 
> 
> {via mobile device}
> 
> On Mar 9, 2011, at 7:09 AM, Steve VanSlyck <s.vanslyck at spamcop.net>
> wrote:
> 
> 
> 
> > I've asked Google, but Google wasn't feeling very helpful.
> > 
> > When I become root via the "SU -" command, my current working
> > directory is changed to root's home.
> > 
> > "info su" says, "By default, 'su' does not change the current
> > directory. It sets the environment variables 'HOME' and 'SHELL' from
> > the password entry for USER, and if USER is not the super-user, sets
> > 'USER' and 'LOGNAME' to USER."
> > 
> > I think that means that SU asks root what directory to change to.
> > Are there any hints or tips someone can give me on how to prevent SU
> > from changing the current working directory, ideally without having
> > to modify root's environment variables?
> > 
> > 
> > Spam detection software, running on the system "lists.colug.net",
> > has
> > identified this incoming email as possible spam.  The original
> > message
> > has been attached to this so you can view it (if it isn't spam) or
> > label
> > similar future email.  If you have any questions, see
> > the administrator of that system for details.
> > 
> > Content preview:  I've asked Google, but Google wasn't feeling very
> > helpful.
> >   When I become root via the "SU -" command, my current working
> > directory is
> >   changed to root's home. "info su" says, "By default, 'su' does not
> > change
> >   the current directory. It sets the environment variables 'HOME'
> > and 'SHELL'
> >   from the password entry for USER, and if USER is not the
> > super-user, sets
> >   'USER' and 'LOGNAME' to USER." [...] 
> > 
> > Content analysis details:   (5.0 points, 5.0 required)
> > 
> > pts rule name              description
> > ---- ----------------------
> > --------------------------------------------------
> > 3.8 BAYES_99               BODY: Bayes spam probability is 99 to
> > 100%
> >                            [score: 1.0000]
> > 1.2 DATE_IN_PAST_03_06     Date: is 3 to 6 hours before Received:
> > date
> > 0.0 HTML_MESSAGE           BODY: HTML included in message
> > 
> > 
> > 
> > _______________________________________________
> > colug-432 mailing list
> > colug-432 at colug.net
> > http://lists.colug.net/mailman/listinfo/colug-432
> > 
> > Spam detection software, running on the system "lists.colug.net",
> > has
> > identified this incoming email as possible spam.  The original
> > message
> > has been attached to this so you can view it (if it isn't spam) or
> > label
> > similar future email.  If you have any questions, see
> > the administrator of that system for details.
> > 
> > Content preview:  I've asked Google, but Google wasn't feeling very
> > helpful.
> >   When I become root via the "SU -" command, my current working
> > directory is
> >   changed to root's home. "info su" says, "By default, 'su' does not
> > change
> >   the current directory. It sets the environment variables 'HOME'
> > and 'SHELL'
> >   from the password entry for USER, and if USER is not the
> > super-user, sets
> >   'USER' and 'LOGNAME' to USER." [...] 
> > 
> > Content analysis details:   (5.0 points, 5.0 required)
> > 
> > pts rule name              description
> > ---- ----------------------
> > --------------------------------------------------
> > 3.8 BAYES_99               BODY: Bayes spam probability is 99 to
> > 100%
> >                            [score: 1.0000]
> > 1.2 DATE_IN_PAST_03_06     Date: is 3 to 6 hours before Received:
> > date
> > 0.0 HTML_MESSAGE           BODY: HTML included in message
> > 
> > 
> > 
> _______________________________________________
> colug-432 mailing list
> colug-432 at colug.net
> http://lists.colug.net/mailman/listinfo/colug-432



More information about the colug-432 mailing list