[Top][All Lists]

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

Re: bash bug with root account

From: Greg Wooledge
Subject: Re: bash bug with root account
Date: Wed, 10 Jul 2019 09:50:02 -0400
User-agent: Mutt/1.10.1 (2018-07-13)

On Wed, Jul 10, 2019 at 09:15:14AM -0400, Chet Ramey wrote:
> On 7/10/19 4:01 AM, westlake wrote:
> > If a normal user types "su -l<enter>" and issues this "ls" statement,
> This account has the `extglob' shell option enabled.

"su -l" gives you a login shell, so this instance of bash is reading
/etc/profile and ~root/.profile (or other login-shell-only dot files).

> > If "su<enter>" (without the -l),  is given instead, then "!" is taken to be
> This account does not.

"su" without "-" or "-l" gives a non-login shell, so this instance of
bash is only reading ~root/.bashrc (and possibly some vendor-specific
files in /etc, possibly /etc/bash.bashrc or /etc/bashrc, depending on
the vendor's compile-time options).

Understanding the difference between a login shell and a non-login shell
is the primary issue here.  If you actually want to track down where
the extglob setting is coming from (or not coming from), I'd start with
~root/.profile and ~root/.bashrc as the most likely places to look.

Enabling extglob *should* be done in .bashrc (if it's going to be done
at all), and .bashrc *should* be sourced from .profile or .bash_profile
in order to ensure that login shells and non-login shells both have the
same basic options enabled.

My first guess is your .profile isn't sourcing your .bashrc the way it
should.  But there are myriad other ways this could have been
misconfigured, and the only way to be sure will be to dig through all
of the dot files.

reply via email to

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