From 09f855dc76380f21aa9b8f0cb1489b56bc250e93 Mon Sep 17 00:00:00 2001 From: Fabio Rehm Date: Sun, 8 Jun 2014 23:44:02 -0300 Subject: [PATCH] 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 ``` --- lib/vagrant-lxc/command/sudoers.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/vagrant-lxc/command/sudoers.rb b/lib/vagrant-lxc/command/sudoers.rb index bfc9ce0..20c63e4 100644 --- a/lib/vagrant-lxc/command/sudoers.rb +++ b/lib/vagrant-lxc/command/sudoers.rb @@ -167,8 +167,7 @@ Whitelist.run!(ARGV) def create_sudoers!(user, command) sudoers = Tempfile.new('vagrant-lxc-sudoers').tap do |file| file.puts "# Automatically created by vagrant-lxc" - file.puts "Cmnd_Alias LXC = #{command}" - file.puts "#{user} ALL=(root) NOPASSWD: LXC" + file.puts "#{user} ALL=(root) NOPASSWD: #{command}" end sudoers.close sudoers.path