help-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Avoid sourcing bashrc when connected to sockets


From: Andrew Gregory
Subject: Re: Avoid sourcing bashrc when connected to sockets
Date: Mon, 21 Feb 2022 13:25:17 -0800

On 02/21/22 at 03:54pm, Chet Ramey wrote:
> On 2/21/22 1:31 PM, Andrew Gregory wrote:
> > I had considered this, but wasn't sure how reliable manipulating SHLVL would
> > be.  If that's going to be reliable behavior going forward though, that's
> > probably the easiest option.
> 
> The check's been in there since 1999, so I don't see it changing. Just
> don't set it to 999.

Thanks, that's probably what we'll go with.

> I guess the socket connection carries the day. I made the assumption that
> the package manager didn't carry SHLVL through the environment (since, if
> it did, bash would have incremented it to at least 2), but did pass
> SSH_CLIENT through (so the run_by_ssh check, if compiled in, would have
> passed). But the socket connection will succeed even if the test for
> SSH_CLIENT isn't performed.

pacman doesn't do anything itself to block SHLVL, but these operations are
generally run with sudo, which does reset the environment unless the user has
specifically configured it to let it through.

Thanks,
apg



reply via email to

[Prev in Thread] Current Thread [Next in Thread]