Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug#1034658: /etc/bash.bashrc: does not protect against unset PS1 => breaks when run with -u

44 views
Skip to first unread message

наб

unread,
Apr 20, 2023, 10:40:04 PM4/20/23
to
Package: bash
Version: 5.2.15-2+b1
Severity: normal
Tags: patch

Dear Maintainer,

When running the man-pages linters with 2>&1 | less, I got a wall of
/etc/bash.bashrc: line 7: PS1: unbound variable

It uses
SHELL := /usr/bin/env bash -Eeuo pipefail
and, /etc/bash.bashrc says, ll. 7,8:
# If not running interactively, don't do anything
[ -z "$PS1" ] && return

I've fixed this by making that expansion ${PS1-} instead;
this is what debian_chroot does below, for presumably the same reason.

I've preventatively done the same thing to the rest of the variables,
but just the PS1 thing was enough to run the tests.

I'm attaching a diff of the unpacked source
(incl. a $(cat => $(<; this a free optimisation in bash-specific code);
this would be much easier if the VCS pointed at anything (#1024158).

Best,
наб


-- System Information:
Debian Release: 12.0
APT prefers unstable
APT policy: (500, 'unstable')
Architecture: x32 (x86_64)
Foreign Architectures: amd64, i386

Kernel: Linux 6.1.0-2-amd64 (SMP w/2 CPU threads; PREEMPT)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages bash depends on:
ii base-files 12.4
ii debianutils 5.7-0.4
ii libc6 2.36-9
ii libtinfo6 6.4-2

Versions of packages bash recommends:
ii bash-completion 1:2.11-6

Versions of packages bash suggests:
pn bash-doc <none>

-- no debconf information
signature.asc
0 new messages