saltstack/salt — pull request #13086 by thematthopkins (2014-05-28 20:49:35+00:00)
Title: Fix for Windows filesystems without a SECURITY_DESCRIPTOR

When hosting files on a VirtualBox shared folder, I was receiving:
```
[ERROR ] An exception occurred in this state: Traceback (most recent call last):
File "c:\salt\salt-2014.1.4.win32\salt-2014.1.4-py2.7.egg\salt\state.py", line 1484, in call
**cdata['kwargs'])
File "c:\salt\salt-2014.1.4.win32\salt-2014.1.4-py2.7.egg\salt\states\file.py", line 1533, in directory
follow_symlinks)
File "c:\salt\salt-2014.1.4.win32\salt-2014.1.4-py2.7.egg\salt\modules\file.py", line 2417, in check_perms
cur = stats(name, follow_symlinks=follow_symlinks)
File "c:\salt\salt-2014.1.4.win32\salt-2014.1.4-py2.7.egg\salt\modules\win_file.py", line 840, in stats
ret['pgid'] = get_pgid(path, follow_symlinks)
File "c:\salt\salt-2014.1.4.win32\salt-2014.1.4-py2.7.egg\salt\modules\win_file.py", line 337, in get_pgid
path, win32security.GROUP_SECURITY_INFORMATION
MemoryError: allocating SECURITY_DESCRIPTOR
```

VirtualBox shared folders (along with some SAMBA file shares) don't supply SecurityDescriptors, and cause this error.

Unfortunately, win32security.GetFileSecurity is raising a generic MemoryError in this case, so the exception handling is a little ugly.

The use-case is having masterless salt running in a Windows Vagrant box to allow automated provisioning of the guest VM. In this situation, the salt repository is hosted on the VirtualBox shared folder.