Skip to content

Instantly share code, notes, and snippets.

@cincodenada
Last active February 6, 2017 22:33
Show Gist options
  • Save cincodenada/b5b1c68457f976b62c9e42b5b8e6d0ca to your computer and use it in GitHub Desktop.
Save cincodenada/b5b1c68457f976b62c9e42b5b8e6d0ca to your computer and use it in GitHub Desktop.
Patches Vagrant bug #7616
#!/bin/bash
# Patches a Vagrant permissions-creating script that breaks assigning groups
# that don't have a matching user. See Vagrant bug #7616
# Thanks to @Jc-L for the patch
paths=( "/usr/share/vagrant/" "/opt/vagrant/embedded/gems/gems/vagrant-1.8.5/" )
for p in "${paths[@]}"; do
if [ -d "$p" ]; then
PREFIX="$p"
fi
done
if [ -z "$PREFIX" ]; then
echo "Vagrant installation not found!"
exit 1
fi
read -r -d '' PATCH <<'PATCH'
--- a/plugins/guests/linux/cap/mount_virtualbox_shared_folder.rb Wed Aug 10 15:29:59 2016
+++ b/plugins/guests/linux/cap/mount_virtualbox_shared_folder.rb Wed Aug 10 15:30:47 2016
@@ -11,7 +11,7 @@
def self.mount_virtualbox_shared_folder(machine, name, guestpath, options)
guest_path = Shellwords.escape(guestpath)
- mount_commands = ["set -e"]
+ mount_commands = [""]
if options[:owner].is_a? Integer
mount_uid = options[:owner]
PATCH
cd $PREFIX
echo "$PATCH" | patch -bN -p1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment