mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Merge pull request #13989 from thematthopkins/virtualbox_shared_folder_win2k3
Expands fix for skipping loading security descriptors on filesystems where they aren't present to work on win2k8+ and Directories
This commit is contained in:
commit
5fdd29163e
@ -343,7 +343,13 @@ def get_pgid(path, follow_symlinks=True):
|
|||||||
# can't load a file descriptor for the file, we default
|
# can't load a file descriptor for the file, we default
|
||||||
# to "Everyone" - http://support.microsoft.com/kb/243330
|
# to "Everyone" - http://support.microsoft.com/kb/243330
|
||||||
except MemoryError:
|
except MemoryError:
|
||||||
|
# generic memory error (win2k3+)
|
||||||
return 'S-1-1-0'
|
return 'S-1-1-0'
|
||||||
|
except pywinerror as exc:
|
||||||
|
# Incorrect function error (win2k8+)
|
||||||
|
if exc.winerror == 1:
|
||||||
|
return 'S-1-1-0'
|
||||||
|
raise
|
||||||
group_sid = secdesc.GetSecurityDescriptorGroup()
|
group_sid = secdesc.GetSecurityDescriptorGroup()
|
||||||
return win32security.ConvertSidToStringSid(group_sid)
|
return win32security.ConvertSidToStringSid(group_sid)
|
||||||
|
|
||||||
@ -533,7 +539,13 @@ def get_uid(path, follow_symlinks=True):
|
|||||||
path, win32security.OWNER_SECURITY_INFORMATION
|
path, win32security.OWNER_SECURITY_INFORMATION
|
||||||
)
|
)
|
||||||
except MemoryError:
|
except MemoryError:
|
||||||
|
# generic memory error (win2k3+)
|
||||||
return 'S-1-1-0'
|
return 'S-1-1-0'
|
||||||
|
except pywinerror as exc:
|
||||||
|
# Incorrect function error (win2k8+)
|
||||||
|
if exc.winerror == 1:
|
||||||
|
return 'S-1-1-0'
|
||||||
|
raise
|
||||||
owner_sid = secdesc.GetSecurityDescriptorOwner()
|
owner_sid = secdesc.GetSecurityDescriptorOwner()
|
||||||
return win32security.ConvertSidToStringSid(owner_sid)
|
return win32security.ConvertSidToStringSid(owner_sid)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user