Ignore insecure files and directories in compinit #633
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This might be a bit controversial PR, and I'm definitely open for suggestions on how to do things differently.
Let me explain the problem that I'm trying to solve. I have all my dotfiles (including antigen) in my home dir, all of them are owned by my regular user. Sometimes I know that I need to execute a few privileged operations, so instead of prepending each command with
sudo
I change to root with$ sudo -s
and then execute the commands without any prefix.I like using
$ sudo -s
, because it preserves my user environment, $HOME directory, my prompt, antigen configuration, everything stays the same. However, when I enter$ sudo -s
, I'm welcomed with the following message:This happens because of the following:
Basically, compinit complains because current user is
root
, and dotfiles are owned by a different user.I can't "fix" the permissions, I want my dotfiles to be owned by my own user, so I see this annoying warning every time.
Adding
-i
is an easy win, this flag makes compinit silently ignore all insecure files and directories.What do you think about it, can we add it?