Merge pull request #574 from yurivict/compatibility_FreeBSD

FreeBSD compatibility
This commit is contained in:
Jonathan Warren 2013-12-15 21:58:45 -08:00
commit 99738e88aa

View File

@ -372,6 +372,11 @@ def checkSensitiveFilePermissions(filename):
# TODO: This might deserve extra checks by someone familiar with # TODO: This might deserve extra checks by someone familiar with
# Windows systems. # Windows systems.
return True return True
elif sys.platform[:7] == 'freebsd':
# FreeBSD file systems are the same as major Linux file systems
present_permissions = os.stat(filename)[0]
disallowed_permissions = stat.S_IRWXG | stat.S_IRWXO
return present_permissions & disallowed_permissions == 0
else: else:
try: try:
# Skip known problems for non-Win32 filesystems without POSIX permissions. # Skip known problems for non-Win32 filesystems without POSIX permissions.