]> git.ipfire.org Git - thirdparty/lxc.git/commit
Use POSIX-compliant function names in bash completion 523/head
authorLucas Werkmeister <mail@lucaswerkmeister.de>
Thu, 14 May 2015 20:12:52 +0000 (22:12 +0200)
committerLucas Werkmeister <mail@lucaswerkmeister.de>
Thu, 14 May 2015 20:39:06 +0000 (22:39 +0200)
commite0bc1067693e30644f60071f0fc861a84fb3fbb6
tree3abe8b6e72cffb9fe9a609a07b197b8cc41d2ab1
parent19fcf68ffb173f146a95c613ae9ccbff45f63a21
Use POSIX-compliant function names in bash completion

When running in posix mode (for example, because it was invoked as `sh`,
or with the --posix option), bash rejects the function names previously
used because they contain hyphens, which are not legal POSIX names, and
exits immediately.

This is a particularly serious problem on a system in which the
following three conditions hold:

1. The `sh` executable is provided by bash, e. g. via a symlink
2. Gnome Display Manager is used to launch X sessions
3. Bash completion is loaded in the (system or user) profile file
   instead of in the bashrc file

In that case, GDM's Xsession script (run with `sh`, i. e., bash in posix
mode) sources the profile files, thus causing the shell to load the bash
completion files. Upon encountering the non-POSIX-compliant function
names, bash would then exit, immediately ending the X session.

Fixes #521.

Signed-off-by: Lucas Werkmeister <mail@lucaswerkmeister.de>
config/bash/lxc.in