Commit 7435544a authored by Adrian DC's avatar Adrian DC
Browse files

fix: resolve #152: avoid sudoer access from root user

parent cdd8da7a
Loading
Loading
Loading
Loading
+3 −1
Changes for gitlabci_local/system/platform.py: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
#!/usr/bin/env python3

# Standard libraries
from os import environ, sep
from os import access, environ, R_OK, sep
from os.path import expanduser
from pathlib import Path, PurePosixPath
from sys import platform, stdin, stdout
@@ -50,6 +50,8 @@ class Platform:
        # Elevated home
        if Platform.IS_USER_SUDO:
            home = Path(expanduser('~%s' % (Platform.USER_SUDO)))
            if not access(home, R_OK):
                home = None

        # Default home
        if not home or not home.is_dir():