command/sudoers: Remove Cmnd_Alias from sudoers file
Since the wrapper is versioned, we would end up having multiple `LXC` command aliases, making `sudo` unusable: ``` >>> /etc/sudoers.d/vagrant-lxc-1-0-0-alpha-3-dev: Alias `LXC' already >>> defined near line 2 <<< sudo: parse error in /etc/sudoers.d/vagrant-lxc-1-0-0-alpha-3-dev near line 2 sudo: no valid sudoers sources found, quitting sudo: unable to initialize policy plugin ```
This commit is contained in:
parent
b4376ef995
commit
09f855dc76
1 changed files with 1 additions and 2 deletions
|
@ -167,8 +167,7 @@ Whitelist.run!(ARGV)
|
||||||
def create_sudoers!(user, command)
|
def create_sudoers!(user, command)
|
||||||
sudoers = Tempfile.new('vagrant-lxc-sudoers').tap do |file|
|
sudoers = Tempfile.new('vagrant-lxc-sudoers').tap do |file|
|
||||||
file.puts "# Automatically created by vagrant-lxc"
|
file.puts "# Automatically created by vagrant-lxc"
|
||||||
file.puts "Cmnd_Alias LXC = #{command}"
|
file.puts "#{user} ALL=(root) NOPASSWD: #{command}"
|
||||||
file.puts "#{user} ALL=(root) NOPASSWD: LXC"
|
|
||||||
end
|
end
|
||||||
sudoers.close
|
sudoers.close
|
||||||
sudoers.path
|
sudoers.path
|
||||||
|
|
Loading…
Reference in a new issue