BerlinVagrant / vagrant-dns

A plugin to manage DNS records for vagrant environments
MIT License
490 stars 50 forks source link

Use sudo only for system files #12

Closed sheerun closed 11 years ago

sheerun commented 11 years ago

This pull-request fixes #5

frickenate commented 11 years ago

There definitely needs to be a fix implemented for #5 - just ran into the same issue (after getting past compiler errors for vagrant gem install - needed the Xcode command-line tools package).

However, is this the best way to fix this? I'm not a ruby guy, but will executing sudo within backticks work for people who don't use password-less sudo - can you still type in your password at the prompt?

An alternative method that should work would be to still expect vagrant-dns --install to be run as root, and then use the value of the environment variable SUDO_USER to chown() the files. If no SUDO_USER environment variable is set, you don't do any chown commands.

sheerun commented 11 years ago

You can enter the password at prompt. I think this solution is simpler and safer than running vagrant-dns with sudo. And it works now. Maybe merge this and work on another solution in meantime .