From 5500058343c8aaa0c9ca58b5faa5b3ab23b0007d Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Thu, 26 Jan 2012 09:56:06 -0800 Subject: [PATCH] Call xpg4/bin/id on Solaris [GH-679] --- CHANGELOG.md | 1 + lib/vagrant/guest/solaris.rb | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 71d3bfde8..47fb34b59 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ they are properly detected. [GH-683] - Fix issue where VM import sometimes made strange VirtualBox folder layouts. [GH-669] + - Call proper `id` command on Solaris. [GH-679] ## 0.9.3 (January 24, 2012) diff --git a/lib/vagrant/guest/solaris.rb b/lib/vagrant/guest/solaris.rb index dbb645655..db2afeb4d 100644 --- a/lib/vagrant/guest/solaris.rb +++ b/lib/vagrant/guest/solaris.rb @@ -101,13 +101,17 @@ module Vagrant # Create the shared folder vm.channel.execute("#{vm.config.solaris.suexec_cmd} mkdir -p #{guestpath}") + # We have to use this `id` command instead of `/usr/bin/id` since this + # one accepts the "-u" and "-g" flags. + id_cmd = "/usr/xpg4/bin/id" + # Mount the folder with the proper owner/group - mount_options = "-o uid=`id -u #{owner}`,gid=`id -g #{group}`" + mount_options = "-o uid=`#{id_cmd} -u #{owner}`,gid=`#{id_cmd} -g #{group}`" mount_options += ",#{options[:extra]}" if options[:extra] vm.channel.execute("#{vm.config.solaris.suexec_cmd} /sbin/mount -F vboxfs #{mount_options} #{name} #{guestpath}") # chown the folder to the proper owner/group - vm.channel.execute("#{vm.config.solaris.suexec_cmd} chown `id -u #{owner}`:`id -g #{group}` #{guestpath}") + vm.channel.execute("#{vm.config.solaris.suexec_cmd} chown `#{id_cmd} -u #{owner}`:`#{id_cmd} -g #{group}` #{guestpath}") end end end