You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Most programs output the completion scripts and the user can load them. vault -autocomplete-install (added in https://github.com/hashicorp/vault/pull/3223/files) tries to do the install but this fails in my instance since my .bashrc is read-only (for security reasons, and I can't ):
Describe the solution you'd like
I would like vault to just output the autocompletion code and let the user install the completion, it works better for package managers too such as apt or nix where you can add the autocompletion next to the software
Describe alternatives you've considered
I've tried export HOME=/tmp to run the command but vault still attempted to write to /home/teto/.bashrc which seems to be another error ?
Explain any additional use-cases
My main shell is zsh so it would be nice to have zsh completion too though it seems like this can be done through a zsh compatibility layer #9901 (comment)
It seems vault uses the github.com/posener/complete package to generate completions. That package uses os/user to find information about the user's home directory. os/user parses /etc/passwd to find the home directory for a given user. If using the pure go implementation it parses /etc/passwd directly, otherwise it calls getpwuid_r to get the same information. You may be able to change the location of your home directory via usermod to get the completion code to write out, and then change it back. (Disclaimer: this may have unintended consequences)
thanks for confirming it looks in /etc/passwd. It's a bit insane to have to change a user's $HOME to access the completion, especially as the solution is to do less: just output the completion, dont install it. I am not able to say if github.com/posener/complete can do that but seems like it doesn't considering the issues users have: posener/complete#71 posener/complete#119
Is your feature request related to a problem? Please describe.
Most programs output the completion scripts and the user can load them.
vault -autocomplete-install
(added in https://github.com/hashicorp/vault/pull/3223/files) tries to do the install but this fails in my instance since my .bashrc is read-only (for security reasons, and I can't ):Describe the solution you'd like
I would like vault to just output the autocompletion code and let the user install the completion, it works better for package managers too such as apt or nix where you can add the autocompletion next to the software
Describe alternatives you've considered
I've tried
export HOME=/tmp
to run the command but vault still attempted to write to /home/teto/.bashrc which seems to be another error ?Explain any additional use-cases
My main shell is zsh so it would be nice to have zsh completion too though it seems like this can be done through a zsh compatibility layer #9901 (comment)
Additional context
If the change is done here, I will update the nix package https://github.com/NixOS/nixpkgs/blob/d9811d585a4e967c3883f11b7653b44121c25f62/pkgs/tools/security/vault/default.nix#L35
The text was updated successfully, but these errors were encountered: