Skip to content
This repository has been archived by the owner on Nov 24, 2022. It is now read-only.

use uid/gid for chowns. #140

Merged
merged 1 commit into from
Sep 10, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions lib/vagrant-lxc/driver.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
require "vagrant-lxc/errors"
require "vagrant-lxc/driver/cli"

require "etc"

module Vagrant
module LXC
class Driver
Expand Down Expand Up @@ -108,8 +110,11 @@ def compress_rootfs
@sudo_wrapper.run('rm', '-f', 'rootfs.tar.gz')
@sudo_wrapper.run('tar', '--numeric-owner', '-czf', target_path, 'rootfs')

@logger.info "Changing rootfs tarbal owner"
@sudo_wrapper.run('chown', "#{ENV['USER']}:#{ENV['USER']}", target_path)
@logger.info "Changing rootfs tarball owner"

user_details=Etc.getpwnam(Etc.getlogin)

@sudo_wrapper.run('chown', "#{user_details.uid}:#{user_details.gid}", target_path)
end

target_path
Expand Down