diff options
author | Radek Podgorny <radek@podgorny.cz> | 2020-04-11 23:18:26 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-11 23:18:26 +0700 |
commit | 9a1765ab2e538023c1a34ce0e6ccdcc878109812 (patch) | |
tree | 5797eb6452edc6f7e5d2a58b1010319f85c2c12b | |
parent | f1bd82a7121d1a0b59123bbcd99d2ebeeae3629b (diff) | |
parent | f3fccaf25e6a61b4a1a30d0b2789b1818a406a1a (diff) | |
download | unionfs-fuse-git-9a1765ab2e538023c1a34ce0e6ccdcc878109812.tar.gz |
Merge pull request #93 from briankendall/mac-fixes
Mac fixes
-rw-r--r-- | src/fuse_ops.c | 2 | ||||
-rwxr-xr-x | test_all.py | 19 |
2 files changed, 19 insertions, 2 deletions
diff --git a/src/fuse_ops.c b/src/fuse_ops.c index 0e74ad0..99c0b4b 100644 --- a/src/fuse_ops.c +++ b/src/fuse_ops.c @@ -783,7 +783,7 @@ static int unionfs_setxattr(const char *path, const char *name, const char *valu if (BUILD_PATH(p, uopt.branches[i].path, path)) RETURN(-ENAMETOOLONG); #if __APPLE__ - int res = setxattr(p, name, value, size, position, flags | XATTR_NOFOLLOW); + int res = setxattr(p, name, value, size, position, (flags | XATTR_NOFOLLOW) & ~XATTR_NOSECURITY); #else int res = lsetxattr(p, name, value, size, flags); #endif diff --git a/test_all.py b/test_all.py index a1dd7df..c9b443d 100755 --- a/test_all.py +++ b/test_all.py @@ -7,6 +7,7 @@ import shutil import time import tempfile import stat +import platform def call(cmd): @@ -27,6 +28,11 @@ def get_dir_contents(directory): return [dirs for (_, dirs, _) in os.walk(directory)] +def get_osxfuse_unionfs_mounts(): + mount_output = call('mount -t osxfuse').decode('utf8') + return [line.split(' ')[0] for line in mount_output.split('\n') if len(line) > 0] + + class Common: def setUp(self): self.unionfs_path = os.path.abspath('src/unionfs') @@ -71,6 +77,8 @@ class Common: time.sleep(1) call('umount union') + elif platform.system() == 'Darwin': + call('umount %s' % self.mount_device) else: call('fusermount -u union') @@ -78,7 +86,15 @@ class Common: shutil.rmtree(self.tmpdir) def mount(self, cmd): - call(cmd) + if platform.system() == 'Darwin': + # Need to get the unionfs device name so that we can unmount it later: + prev_mounts = get_osxfuse_unionfs_mounts() + call(cmd) + cur_mounts = get_osxfuse_unionfs_mounts() + self.mount_device = list(set(cur_mounts)-set(prev_mounts))[0] + else: + call(cmd) + self.mounted = True @@ -450,6 +466,7 @@ class UnionFS_RO_RW_COW_TestCase(Common, unittest.TestCase): @unittest.skipIf(os.environ.get('RUNNING_ON_TRAVIS_CI'), 'Not supported on Travis') +@unittest.skipIf(platform.system() == 'Darwin', 'Not supported on macOS') class IOCTL_TestCase(Common, unittest.TestCase): def setUp(self): super().setUp() |