Bash Completion ignores changes made to sudo's secure_path

The name of the pictureThe name of the pictureThe name of the pictureClash 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 ?







share|improve this question
























    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 ?







    share|improve this question






















      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 ?







      share|improve this question












      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 ?









      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 17 at 15:06









      ChennyStar

      362




      362

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          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



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes










           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          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













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay