1

I'd like to add a new path (/usr/lib/cyrus/bin in this example) to root's $PATH (and to sudo's secure_path). I'm in Debian, by the way

First, I add it to root's $PATH, using /etc/bash.bashrc. So far so good, I get :

# which cyr_expire
/usr/lib/cyrus/bin/cyr_expire
# cyr<Tab><Tab>
cyradm cyr_dbtool cyrdeliver cyr_deny cyr_df cyrdump cyr_expire cyr_info cyrmaster cyr_sequence cyrus cyr_userseen

Bash Completion works juste fine.

Next, I add it to sudo's secure_path, in /etc/sudoers :

Defaults    secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/cyrus/bin"

I check that the new directory is handled well by sudo :

$ sudo which cyr_expire
/usr/lib/cyrus/bin/cyr_expire

Ok, it works

But bash completion doesn't seem to take that new directory into account :

$ sudo cyr<Tab><Tab>
cyradm cyrdeliver cyrmaster cyrus 

Binaries under /usr/lib/cyrus/bin (e.g. cyr_dbtool, cyr_deny, cyr_expire, ...) aren't proposed by Bash completion when called through sudo.

What did I miss ?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.