Merge pull request #1801 from davegudge/patch-1

core: use getent to get group ID
This commit is contained in:
Mitchell Hashimoto 2013-08-28 17:02:46 -07:00
commit 826c8a884d
1 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@ module VagrantPlugins
:shell_expand_guest_path, guestpath)
# Determine the permission string to attach to the mount command
mount_options = "-o uid=`id -u #{options[:owner]}`,gid=`id -g #{options[:group]}`"
mount_options = "-o uid=`id -u #{options[:owner]}`,gid=`getent group #{options[:group]} | cut -d: -f3`"
mount_options += ",#{options[:extra]}" if options[:extra]
mount_command = "mount -t vboxsf #{mount_options} #{name} #{expanded_guest_path}"
@ -32,7 +32,7 @@ module VagrantPlugins
# Chown the directory to the proper user
machine.communicate.sudo(
"chown `id -u #{options[:owner]}`:`id -g #{options[:group]}` #{expanded_guest_path}")
"chown `id -u #{options[:owner]}`:`getent group #{options[:group]} | cut -d: -f3` #{expanded_guest_path}")
end
end
end