FS#58360 - [grml-zsh-config] sudo error with aliases defined using the "command" shell builtin
Attached to Project:
Arch Linux
Opened by Bastien Traverse (Neitsab) - Thursday, 26 April 2018, 17:32 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:22 GMT
Opened by Bastien Traverse (Neitsab) - Thursday, 26 April 2018, 17:32 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:22 GMT
|
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 <correct output> % sudo ll sudo: ll: command not found % sudo -i # ll <correct output> |
This task depends upon
Closed by Buggy McBugFace (bugbot)
Saturday, 25 November 2023, 20:22 GMT
Reason for closing: Moved
Additional comments about closing: https://gitlab.archlinux.org/archlinux/p ackaging/packages/grml-zsh-config/issues /1
Saturday, 25 November 2023, 20:22 GMT
Reason for closing: Moved
Additional comments about closing: https://gitlab.archlinux.org/archlinux/p ackaging/packages/grml-zsh-config/issues /1
# sed -i 's/\"command/\"/g' /etc/zsh/zshrc
# source !$
% source /etc/zsh/zshrc
% sudo lh
<correct output>
So I was expecting you to assess whether it was indeed a bug and point to what to do with it, which you did. Now I'll carry it upstream and report back when I'll have news.