Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15118

Re: bash bug with root account

From Greg Wooledge <wooledg@eeg.ccf.org>
Newsgroups gnu.bash.bug
Subject Re: bash bug with root account
Date 2019-07-10 09:50 -0400
Message-ID <mailman.827.1562766643.2688.bug-bash@gnu.org> (permalink)
References <11a52025-9a9f-363c-21da-e05301735f95@videotron.ca> <c53442ce-d70a-645a-8850-b0a995b3416e@case.edu> <20190710135002.GG2450@eeg.ccf.org>

Show all headers | View raw


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.

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: bash bug with root account Greg Wooledge <wooledg@eeg.ccf.org> - 2019-07-10 09:50 -0400

csiph-web