Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Permission issue on OSX and sudo problem #668

Closed
vinchi007 opened this issue Feb 14, 2016 · 6 comments
Closed

Permission issue on OSX and sudo problem #668

vinchi007 opened this issue Feb 14, 2016 · 6 comments

Comments

@vinchi007
Copy link

Trying to enable any alias getting the permission error:

2016-02-14 12:05:50 ☆ Vlads-MBP in ~
○ → bash-it enable alias git
mkdir: /Users/vinchi007/.bash_it/aliases/enabled: Permission denied
ln: /Users/vinchi007/.bash_it/aliases/enabled/git.aliases.bash: No such file or directory
git enabled.

When running as sudo, bash-it function does not pass off to sudo environment:

2016-02-14 12:05:56 ☆ Vlads-MBP in ~
○ → sudo bash-it enable alias git
Password:
sudo: bash-it: command not found

@vinchi007
Copy link
Author

When I did

git clone
it required to use sudo. Once I used sudo it created ~/.bash_it dir with root permission "root:group" instead of "myuserid:group". To fix it I did:
chown -R myuserid:group ~/.bash_it

Can we add some login into bash-it so it checks permissions of the dir?

@nwinkler
Copy link
Member

Thanks for the detailed analysis. The issue was caused by the wrong ownership of the Bash-it directory. The question is why you had to use sudo to clone the repo in the first place...

I'm not sure whether we need to add a check for that - in theory, this could happen with any project, and the general expectation is that you have write permissions in your own home directory. If you use sudo to write stuff to your home directory, it's pretty much always going to end up in tears.

@vinchi007
Copy link
Author

agree, this is local permission issue. However, I think the status should properly reflect that the action failed (enabling an alias) - instead it misleads by stating "git enabled"

@nwinkler
Copy link
Member

Good point - that's probably worth fixing.

edubxb added a commit to edubxb/bash-it that referenced this issue Nov 11, 2016
edubxb added a commit to edubxb/bash-it that referenced this issue Nov 11, 2016
edubxb added a commit to edubxb/bash-it that referenced this issue Nov 11, 2016
edubxb added a commit to edubxb/bash-it that referenced this issue Nov 11, 2016
edubxb added a commit to edubxb/bash-it that referenced this issue Nov 12, 2016
@edubxb
Copy link
Member

edubxb commented Nov 12, 2016

I tried to manage this issue in #833, can you test it @vinchi007?

Thanks!

@NoahGorny
Copy link
Member

This issue is very stale, so I close it. Thanks for contributing and posting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants