synced_folders/smb: set recursive ACL for folders

This commit is contained in:
Mitchell Hashimoto 2014-03-06 08:30:04 -08:00
parent 0037d2c767
commit 46b5f0d22b
2 changed files with 11 additions and 1 deletions

View File

@ -23,6 +23,16 @@ $grant = "Everyone,Full"
if (![string]::IsNullOrEmpty($host_share_username)) { if (![string]::IsNullOrEmpty($host_share_username)) {
$computer_name = $(Get-WmiObject Win32_Computersystem).name $computer_name = $(Get-WmiObject Win32_Computersystem).name
$grant = "$computer_name\$host_share_username,Full" $grant = "$computer_name\$host_share_username,Full"
# Here we need to set the proper ACL for this folder. This lets full
# recursive access to this folder.
Get-ChildItem $path -recurse -Force |% {
$current_acl = Get-ACL $_.fullname
$permission = "$computer_name\$host_share_username","FullControl","ContainerInherit,ObjectInherit","None","Allow"
$acl_access_rule = New-Object System.Security.AccessControl.FileSystemAccessRule $permission
$current_acl.SetAccessRule($acl_access_rule)
$current_acl | Set-Acl $_.fullname
}
} }
$result = net share $share_name=$path /unlimited /GRANT:$grant $result = net share $share_name=$path /unlimited /GRANT:$grant

View File

@ -57,7 +57,7 @@ Hyper-V:
``` ```
$ sudo apt-get install linux-tools-3.11.0-15-generic $ sudo apt-get install linux-tools-3.11.0-15-generic
$ sudo apt-get install hv-kvp-daemon-init $ sudo apt-get install hv-kvp-daemon-init
$ cp/usr/lib/linux-tools-3.11.0-15/hv_* /usr/sbin/ $ sudo cp /usr/lib/linux-tools/3.11.0-15/hv_* /usr/sbin/
``` ```
## Packaging the Box ## Packaging the Box