sudo error with aliases defined using the "command" shell builtin
Task Info (Flyspray) | |
---|---|
Opened By | Bastien Traverse (Neitsab) |
Task ID | 58360 |
Type | Bug Report |
Project | Arch Linux |
Category | Upstream Bugs |
Version | None |
OS | All |
Opened | 2018-04-26 17:32:58 UTC |
Status | Assigned |
Assignee | Pierre Schmitz (Pierre) |
Details
Description:
When using an alias defined in /etc/zsh/zshrc using the builtin 'command' via sudo (e.g. ll), we receive an error message "sudo: ll: command not found". However once in a root shell via sudo -i the aliases work properly.
Additional info:
- package version(s): 0.14.3-1 + zsh 5.5.1
- config and/or log files etc. Vanilla config files, no ~/.zshrc in my user's or root's home directory and sudoers only contain "mysuer ALL=(ALL) ALL".
Affected aliases:
% grep "="command " /etc/zsh/zshrc
alias ls="command ls {ls_options:+
{ls_options[]}}"
alias la="command ls -la {ls_options:+
{ls_options[]}}"
alias ll="command ls -l {ls_options:+
{ls_options[]}}"
alias lh="command ls -hAl {ls_options:+
{ls_options[]}}"
alias l="command ls -l {ls_options:+
{ls_options[*]}}"
alias dir="command ls -lSrah"
alias lsbig="command ls -flh *(.OL[1,10])"
alias lsnew="command ls -rtlh *(D.om[1,10])"
alias lsold="command ls -rtlh *(D.Om[1,10])"
alias lssmall="command ls -Srl *(.oL[1,10])"
alias lsnewdir="command ls -rthdl (/om[1,10]) .(D/om[1,10])"
alias lsolddir="command ls -rthdl (/Om[1,10]) .(D/Om[1,10])"
Steps to reproduce:
$ sudo pacman -S zsh grml-zsh-config $ chsh -s /usr/bin/zsh $ sudo chsh -s /usr/bin/zsh root $ zsh % ll % sudo ll sudo: ll: command not found % sudo -i