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


Groups > gnu.bash.bug > #15118 > unrolled thread

Re: bash bug with root account

Started byGreg Wooledge <wooledg@eeg.ccf.org>
First post2019-07-10 09:50 -0400
Last post2019-07-10 09:50 -0400
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#15118 — Re: bash bug with root account

FromGreg Wooledge <wooledg@eeg.ccf.org>
Date2019-07-10 09:50 -0400
SubjectRe: bash bug with root account
Message-ID<mailman.827.1562766643.2688.bug-bash@gnu.org>
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.

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web