bashrc should not depend on /usr mounted

Bug #121992 reported by Tormod Volden
6
Affects Status Importance Assigned to Milestone
bash (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: bash

/etc/skel/.bashrc contains calls to dircolors. If /usr is not mounted or not in the $PATH, like in a rescue shell started by a failing fsck, this will fail, and addtionally kick off command-not-found on the error message with funny results.

Adding a test like "&& -x /usr/bin/dircolors" to /etc/skel/.bashrc would help.

command-not-found should better be disabled when starting this rescue shell.

Related branches

Revision history for this message
Tormod Volden (tormodvolden) wrote :

> command-not-found should better be disabled when starting this rescue shell.

That part belongs to bug #111255.

Revision history for this message
Tormod Volden (tormodvolden) wrote :

This is still a problem in Hardy Alpha 4.

This is not a problem in Debian, because there the root user has its own minimal .bashrc, not the one from /etc/skel.

Revision history for this message
Tormod Volden (tormodvolden) wrote :

   * debian/skel.bashrc: check if /usr/bin/dircolors exists before using
     it for colourful ls. (LP: #121992)

Matthias Klose (doko)
Changed in bash:
status: New → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package bash - 3.2-0ubuntu12

---------------
bash (3.2-0ubuntu12) hardy; urgency=low

  * Apply upstream patches 026 - 033. Fixes for:
    - Keep the Apple linker from attempting to link bash against Apple's
      readline library "replacement" rather than the one shipped with bash.
    - When updating the display after displaying, for instance, a list
      of possible completions, readline will place the cursor at the wrong
      position if the prompt contains invisible characters and a newline.
      LP: #119938.
    - Under some circumstances, readline will incorrectly display a prompt
      string containing invisible characters after the final newline.
    - When the bash arithmetic expression evaluator has temporarily turned off
      evalation, such as when parsing a pre- or post-decrement or -increment
      operator, and an error occurs, evaluation is not re-enabled.
    - If redirections attached to a compound command fail, bash does not set
      the command's exit status correctly. This only happens when the command
      is the first in a sequential list.
    - In certain cases when outputting characters at the end of the line, e.g.,
      when displaying the prompt string, readline positions the cursor
      incorrectly if the prompt string contains invisible characters and the
      text being drawn begins before the last invisible character in the line.
    - There is an off-by-one error in the code that buffers characters
      received very quickly in succession, causing characters to be dropped.
    - References made within a function to an uninitialized local array
      variable using the [*] subscript in a double-quoted string can result
      in spurious ASCII 127 characters in the expanded value.
  * Remove bash-completion from the source.
  * Remove the conflict with bash-completion, recommend bash-completion.
  * debian/skel.bashrc: Check for dircolors before using it. LP: #121992.
  * Include correct bash.pot file. LP: #104261.

 -- Matthias Klose <email address hidden> Fri, 08 Feb 2008 19:26:17 +0100

Changed in bash:
status: In Progress → Fix Released
Revision history for this message
Tormod Volden (tormodvolden) wrote :

Funny, I just discovered now that I have an old /root/.bashrc:
 ls -l /root/.bashrc /etc/skel/.bashrc
-rw-r--r-- 1 root root 2940 2008-05-09 18:05 /etc/skel/.bashrc
-rw-r--r-- 1 root root 2227 2007-10-20 13:51 /root/.bashrc

I installed from scratch using ubiquity in April, long after this was fixed in the bash package. How did this happen? Did ubiquity set up the root account in its own way, not using /etc/skel?

Revision history for this message
Tormod Volden (tormodvolden) wrote :

I checked again with an Intrepid live cd (~alpha2): The /root/.bashrc (and .profile) is the old one from last year. On which package should I file this?

Revision history for this message
Tormod Volden (tormodvolden) wrote :

Just for the record, I followed up on this in bug #228747.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.