From 7b65da70dcd7907a95e50a8349e64f5275a5a055 Mon Sep 17 00:00:00 2001 From: Yuri Date: Thu, 28 Nov 2013 16:20:16 -0800 Subject: [PATCH] FreeBSD compatibility. --- src/shared.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/shared.py b/src/shared.py index 2404ff15..6a1750e2 100644 --- a/src/shared.py +++ b/src/shared.py @@ -347,6 +347,11 @@ def checkSensitiveFilePermissions(filename): # TODO: This might deserve extra checks by someone familiar with # Windows systems. 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: try: # Skip known problems for non-Win32 filesystems without POSIX permissions.