Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions liquidctl/keyval.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def get_runtime_dirs(appname='liquidctl'):
if sys.platform == 'win32':
dirs = [os.path.join(os.getenv('TEMP'), appname)]
elif sys.platform == 'darwin':
dirs = [os.path.join('~/Library/Caches', appname)]
dirs = [os.path.expanduser(os.path.join('~/Library/Caches', appname))]
elif sys.platform == 'linux':
# threat all other platforms as *nix and conform to XDG basedir spec
dirs = []
Expand Down Expand Up @@ -56,7 +56,7 @@ def __init__(self, key_prefixes):
self._read_dirs = [os.path.join(x, *key_prefixes) for x in get_runtime_dirs()]
self._write_dir = self._read_dirs[0]
os.makedirs(self._write_dir, exist_ok=True)
if XDG_RUNTIME_DIR and os.path.commonpath([XDG_RUNTIME_DIR, self._write_dir]):
if sys.platform == 'linux':
# set the sticky bit to prevent removal during cleanup
os.chmod(self._write_dir, 0o1700)
LOGGER.debug('data in %s (within XDG_RUNTIME_DIR)', self._write_dir)
Expand Down