mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Add potential fix for windows admin lockout
This commit is contained in:
parent
a6b380152a
commit
79284a9094
@ -16,6 +16,7 @@ import pathlib
|
|||||||
import shutil
|
import shutil
|
||||||
from requests import get
|
from requests import get
|
||||||
from contextlib import suppress
|
from contextlib import suppress
|
||||||
|
import ctypes
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from socket import gethostname
|
from socket import gethostname
|
||||||
@ -339,6 +340,12 @@ class Helpers:
|
|||||||
return False
|
return False
|
||||||
|
|
||||||
def checkRoot(self):
|
def checkRoot(self):
|
||||||
|
if helper.is_os_windows():
|
||||||
|
if ctypes.windll.shell32.IsUserAnAdmin() == 0:
|
||||||
|
return True
|
||||||
|
else:
|
||||||
|
return False
|
||||||
|
else:
|
||||||
if os.geteuid() == 0:
|
if os.geteuid() == 0:
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user