[MacPorts] #27504: bash completion and sudo password problem
#27504: bash completion and sudo password problem -------------------------------------------+-------------------------------- Reporter: heapifyman@… | Owner: macports-tickets@… Type: defect | Status: new Priority: Normal | Milestone: Component: base | Version: 1.9.2 Keywords: bash completion sudo password | Port: -------------------------------------------+-------------------------------- I installed macports, updated to 1.9.2, then installed the bash completion. When I press TAB key after entering {{{ sudo port upgrade out }}} I get the following output in the Terminal: {{{ sudo port upgrade outPassword: }}} and the command obviously doesn't work. -- Ticket URL: <https://trac.macports.org/ticket/27504> MacPorts <http://www.macports.org/> Ports system for Mac OS
#27504: bash completion and sudo password problem ----------------------------------+----------------------------------------- Reporter: heapifyman@… | Owner: raimue@… Type: defect | Status: new Priority: Normal | Milestone: Component: base | Version: 1.9.2 Keywords: | Port: bash-completion ----------------------------------+----------------------------------------- Changes (by macsforever2000@…): * cc: heapifyman@… (removed) * keywords: bash completion sudo password => * port: => bash-completion * owner: macports-tickets@… => raimue@… Comment: Did you add this to your .bash_profile as instructed? {{{ if [ -f /opt/local/etc/bash_completion ]; then . /opt/local/etc/bash_completion fi }}} -- Ticket URL: <https://trac.macports.org/ticket/27504#comment:1> MacPorts <http://www.macports.org/> Ports system for Mac OS
#27504: bash completion and sudo password problem ----------------------------------+----------------------------------------- Reporter: heapifyman@… | Owner: raimue@… Type: defect | Status: new Priority: Normal | Milestone: Component: base | Version: 1.9.2 Keywords: | Port: bash-completion ----------------------------------+----------------------------------------- Comment(by heapifyman@…): Yes, I added above snippet to my .profile file as instructed, since I did not have a .bash_profile file. -- Ticket URL: <https://trac.macports.org/ticket/27504#comment:2> MacPorts <http://www.macports.org/> Ports system for Mac OS
#27504: bash completion and sudo password problem ----------------------------------+----------------------------------------- Reporter: heapifyman@… | Owner: raimue@… Type: defect | Status: new Priority: Normal | Milestone: Component: base | Version: 1.9.2 Keywords: | Port: bash-completion ----------------------------------+----------------------------------------- Comment(by raimue@…): Hm, I can't reproduce this problem... -- Ticket URL: <https://trac.macports.org/ticket/27504#comment:3> MacPorts <http://www.macports.org/> Ports system for Mac OS
#27504: bash completion and sudo password problem ----------------------------------+----------------------------------------- Reporter: heapifyman@… | Owner: raimue@… Type: defect | Status: new Priority: Normal | Milestone: Component: base | Version: 1.9.2 Keywords: | Port: bash-completion ----------------------------------+----------------------------------------- Comment(by heapifyman@…): Replying to [comment:3 raimue@…]:
Hm, I can't reproduce this problem...
I should maybe add that I had {{{ Defaults timestamp_timeout=0 }}} set in my sudoers file. Without this, the problem does not occur -- Ticket URL: <https://trac.macports.org/ticket/27504#comment:4> MacPorts <http://www.macports.org/> Ports system for Mac OS
#27504: bash completion and sudo password problem ----------------------------------+----------------------------------------- Reporter: heapifyman@… | Owner: raimue@… Type: defect | Status: new Priority: Normal | Milestone: Component: base | Version: 1.9.2 Keywords: | Port: bash-completion ----------------------------------+----------------------------------------- Comment(by heapifyman@…): Replying to [comment:4 heapifyman@…]:
Replying to [comment:3 raimue@…]:
Hm, I can't reproduce this problem...
I should maybe add that I had {{{ Defaults timestamp_timeout=0 }}} set in my sudoers file.
Without this, the problem does not occur
Ignore the above, please. This only works if the password has been entered before, obviously. But for me, if the password has not been cached before, bash completion does not work if port command takes more than one argument, e.g.: pressing Tab after {{{ port list a }}} produces {{{ port list aPassword: }}} while something like {{{ port installed }}} works as expected. -- Ticket URL: <https://trac.macports.org/ticket/27504#comment:6> MacPorts <http://www.macports.org/> Ports system for Mac OS
#27504: bash completion and sudo password problem ----------------------------------+----------------------------------------- Reporter: heapifyman@… | Owner: raimue@… Type: defect | Status: new Priority: Normal | Milestone: Component: base | Version: 1.9.2 Keywords: | Port: bash-completion ----------------------------------+----------------------------------------- Comment(by raimue@…): Which version of bash do you use? I am not able to reproduce this with either `/opt/local/bin/bash` or `/bin/bash`. I do not see the password prompt, port names get completed as expected for me. -- Ticket URL: <https://trac.macports.org/ticket/27504#comment:7> MacPorts <http://www.macports.org/> Ports system for Mac OS
#27504: bash completion and sudo password problem ----------------------------------+----------------------------------------- Reporter: heapifyman@… | Owner: raimue@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.2 Keywords: | Port: bash-completion ----------------------------------+----------------------------------------- Changes (by raimue@…): * component: base => ports -- Ticket URL: <https://trac.macports.org/ticket/27504#comment:8> MacPorts <http://www.macports.org/> Ports system for Mac OS
#27504: bash completion and sudo password problem ----------------------------------+----------------------------------------- Reporter: heapifyman@… | Owner: raimue@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.2 Keywords: | Port: bash-completion ----------------------------------+----------------------------------------- Comment(by heapifyman@…): Replying to [comment:7 raimue@…]:
Which version of bash do you use? I am not able to reproduce this with either `/opt/local/bin/bash` or `/bin/bash`. I do not see the password prompt, port names get completed as expected for me.
Bash version is: {{{ /bin/bash --version GNU bash, version 3.2.17(1)-release (i386-apple-darwin9.0) }}} -- Ticket URL: <https://trac.macports.org/ticket/27504#comment:9> MacPorts <http://www.macports.org/> Ports system for Mac OS
#27504: bash completion and sudo password problem ----------------------------------+----------------------------------------- Reporter: heapifyman@… | Owner: raimue@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.2 Keywords: | Port: bash-completion ----------------------------------+----------------------------------------- Comment(by heapifyman@…): The problem seems to be that I am working as a non-admin user and have to invoke the port command with prepening sudo. As I am a lazy person I thought I'd add an alias to my ~/.profile like this: {{{ alias port="sudo port" }}} The problem described above only happens when this alias is active. Without the alias bash-completion works as expected. Is there some other way to avoid typing sudo all the time when using port command? -- Ticket URL: <https://trac.macports.org/ticket/27504#comment:10> MacPorts <http://www.macports.org/> Ports system for Mac OS
#27504: bash completion and sudo password problem ----------------------------------+----------------------------------------- Reporter: heapifyman@… | Owner: raimue@… Type: defect | Status: new Priority: Normal | Milestone: Component: ports | Version: 1.9.2 Keywords: | Port: bash-completion ----------------------------------+----------------------------------------- Comment(by ryandesign@…): Replying to [comment:10 heapifyman@…]:
The problem seems to be that I am working as a non-admin user and have to invoke the port command with prepening sudo.
Even admin users have to do that. Only the root user wouldn't have to do that, but nobody would log into a Mac as root.
As I am a lazy person I thought I'd add an alias to my ~/.profile like this: {{{ alias port="sudo port" }}} The problem described above only happens when this alias is active. Without the alias bash-completion works as expected.
Then I would say this isn't something we need to fix.
Is there some other way to avoid typing sudo all the time when using port command?
Nope; I typo `sudo` all the time too. Oh well. -- Ticket URL: <https://trac.macports.org/ticket/27504#comment:11> MacPorts <http://www.macports.org/> Ports system for Mac OS
#27504: bash completion and sudo password problem -----------------------------------+---------------------------------------- Reporter: heapifyman@… | Owner: raimue@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 1.9.2 Resolution: fixed | Keywords: Port: bash-completion | -----------------------------------+---------------------------------------- Changes (by raimue@…): * status: new => closed * resolution: => fixed Comment: This was actually a problem in the way the completion was written, it should be fixed as of r95144. -- Ticket URL: <https://trac.macports.org/ticket/27504#comment:12> MacPorts <http://www.macports.org/> Ports system for Mac OS
#27504: bash completion and sudo password problem -----------------------------------+---------------------------------------- Reporter: heapifyman@… | Owner: raimue@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 1.9.2 Resolution: fixed | Keywords: Port: bash-completion | -----------------------------------+---------------------------------------- Comment(by heapifyman@…): Thanks. It's working now after the latest update. Only thing: I had to tell Terminal to use {{{ /opt/local/bin/bash }}} instead of the default {{{ /bin/bash }}} Maybe that could be added to the documentation somewhere? -- Ticket URL: <https://trac.macports.org/ticket/27504#comment:13> MacPorts <http://www.macports.org/> Ports system for Mac OS
#27504: bash completion and sudo password problem -----------------------------------+---------------------------------------- Reporter: heapifyman@… | Owner: raimue@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 1.9.2 Resolution: fixed | Keywords: Port: bash-completion | -----------------------------------+---------------------------------------- Comment(by cal@…): It kind of already is in `port notes bash-completion`. -- Ticket URL: <https://trac.macports.org/ticket/27504#comment:14> MacPorts <http://www.macports.org/> Ports system for Mac OS
#27504: bash completion and sudo password problem -----------------------------------+---------------------------------------- Reporter: heapifyman@… | Owner: raimue@… Type: defect | Status: closed Priority: Normal | Milestone: Component: ports | Version: 1.9.2 Resolution: fixed | Keywords: Port: bash-completion | -----------------------------------+---------------------------------------- Comment(by heapifyman@…): Replying to [comment:14 cal@…]:
It kind of already is in `port notes bash-completion`.
Sorry, I missed that during the install. I also added that note to the bash-completion how-to page: [https://trac.macports.org/wiki/howto/bash-completion] Hope that is ok. -- Ticket URL: <https://trac.macports.org/ticket/27504#comment:15> MacPorts <http://www.macports.org/> Ports system for Mac OS
participants (1)
-
MacPorts