Bugzilla – Bug 564
sudo is escaping $ leaving no access to env variables
Last modified: 2013-09-30 09:36:01 MDT
The fix for bug 413 is to escape non-alfanumeric characters , except - and _ Because of this $ is also escaped and it's not possible anymore to pass commands which use environment variables, braking other scripts. Before the escaping this worked: $ sudo -i '/bin/echo "$USER"' root After the escaping spaces etc. are escaped so this doesn't work anymore: $ sudo -i '/bin/echo "$USER"' -bash: /bin/echo "$USER": No such file or directory And $ sudo -i /bin/echo '$USER' $USER So there's no easy way anymore to get the effect from before the escaping.On the other hand before the escaping there was another way to perform the command the fix was made for: e.g. instead of $ sudo -i ls "something is here" you could have done $sudo -i 'ls "something is here"'
Fixed in sudo 1.8.8.