use uid/gid for chowns.
This commit is contained in:
parent
ce3e061cae
commit
e5790d3ad1
1 changed files with 7 additions and 2 deletions
|
@ -4,6 +4,8 @@ require "vagrant/util/subprocess"
|
||||||
require "vagrant-lxc/errors"
|
require "vagrant-lxc/errors"
|
||||||
require "vagrant-lxc/driver/cli"
|
require "vagrant-lxc/driver/cli"
|
||||||
|
|
||||||
|
require "etc"
|
||||||
|
|
||||||
module Vagrant
|
module Vagrant
|
||||||
module LXC
|
module LXC
|
||||||
class Driver
|
class Driver
|
||||||
|
@ -108,8 +110,11 @@ module Vagrant
|
||||||
@sudo_wrapper.run('rm', '-f', 'rootfs.tar.gz')
|
@sudo_wrapper.run('rm', '-f', 'rootfs.tar.gz')
|
||||||
@sudo_wrapper.run('tar', '--numeric-owner', '-czf', target_path, 'rootfs')
|
@sudo_wrapper.run('tar', '--numeric-owner', '-czf', target_path, 'rootfs')
|
||||||
|
|
||||||
@logger.info "Changing rootfs tarbal owner"
|
@logger.info "Changing rootfs tarball owner"
|
||||||
@sudo_wrapper.run('chown', "#{ENV['USER']}:#{ENV['USER']}", target_path)
|
|
||||||
|
user_details=Etc.getpwnam(Etc.getlogin)
|
||||||
|
|
||||||
|
@sudo_wrapper.run('chown', "#{user_details.uid}:#{user_details.gid}", target_path)
|
||||||
end
|
end
|
||||||
|
|
||||||
target_path
|
target_path
|
||||||
|
|
Loading…
Reference in a new issue