Bash Completion ignores changes made to sudo's secure_path
Clash Royale CLAN TAG#URR8PPP
up vote
1
down vote
favorite
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 ?
bash sudo path autocomplete
add a comment |Â
up vote
1
down vote
favorite
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 ?
bash sudo path autocomplete
add a comment |Â
up vote
1
down vote
favorite
up vote
1
down vote
favorite
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 ?
bash sudo path autocomplete
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 ?
bash sudo path autocomplete
asked Feb 17 at 15:06
ChennyStar
362
362
add a comment |Â
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f424813%2fbash-completion-ignores-changes-made-to-sudos-secure-path%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password