Bug 1729

Summary: Bash environmental associative arrays not getting set
Product: Portable OpenSSH Reporter: Matt Woodson <woodsdog>
Component: sshAssignee: Assigned to nobody <unassigned-bugs>
Status: CLOSED WONTFIX    
Severity: minor CC: djm
Priority: P2    
Version: 5.2p1   
Hardware: Other   
OS: Linux   

Description Matt Woodson 2010-03-02 07:57:58 AEDT
In Bash 4.0 associative arrays were introduced.  There are some environmental variables that are associative arrays.  One of these variables is the BASH_ALIASES associative array.  Documentation can be found here:

http://www.gnu.org/software/bash/manual/bashref.html#Bash-Variables

In short, it's an active array of the system aliases,  with both the alias and the corresponding command kept track of.

For example, to set:

$ BASH_ALIASES[cdt]="cd /tmp"

would be the equivalent of:

$ alias cdt="cd /tmp"

Setting this variable, the alias is instantly available in that bash environment.

Now, when passing these variables with SSH, ssh doesn't interpret these variables as special.  I've tested this on two different distros, Fedora 12 (OpenSSH_5.2p1) and Ubuntu 9.10 (OpenSSH_5.1p1).  Both give different the same bad result.

My environment file:

$ cat environment 
BASH_ALIASES[cdt]="cd /tmp"
TESTME="This is a test"

On F12 & Ub 9.10:
-after an ssh to Ub 9.10 box, the $TESTME variable is set and can be seen when the 'set' or 'env' command is run. The $BASH_ALIASES variable appears in the list as a regular environment variable, ignoring the associative  There is no "cdt" alias either.  It didn't add this to the associative array.

$ env | grep BASH
BASH_ALIASES[cdt]="cd /tmp"
$
Comment 1 Damien Miller 2010-03-26 10:50:27 AEDT
I don't think that this is under our control - OpenSSH passes all variables though execve() and doesn't filter them if they contain special characters (e.g. square brackets). Perhaps your kernel or bash itself it rejecting them?
Comment 2 Damien Miller 2010-04-16 15:50:47 AEST
Mass move of bugs RESOLVED->CLOSED following the release of openssh-5.5p1