Skip to content
This repository was archived by the owner on Aug 8, 2025. It is now read-only.

Commit 1664a6f

Browse files
committed
Block program start with admin
1 parent 3503ba2 commit 1664a6f

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

components/shellbridge.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import shutil
55
import time
66
from PyQt6.QtCore import QThread, pyqtSignal
7-
from components.statusInfo import checkSpotifyRunning
7+
from components.statusInfo import checkSpotifyRunning,checkAdminPrivileges
88

99
# Installer task for both windows and linux/mac with progress and error handling
1010

components/statusInfo.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,3 +179,12 @@ def checkInternetConnection():
179179
return False
180180
except:
181181
return False
182+
183+
def checkAdminPrivileges():
184+
try:
185+
if os.getuid() == 0:
186+
return True
187+
else:
188+
return False
189+
except:
190+
return False

main.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,10 @@ def __init__(self):
9696
# Execute once window is loaded before listeners are enabled
9797

9898
def InitWindow(self):
99+
if checkAdminPrivileges():
100+
#close app with error mesage
101+
errorDialog("NEVER run sussy programms like this with admin privileges !!")
102+
sys.exit(0)
99103
movie = QMovie(os.path.join(
100104
os.path.dirname(__file__), "res", "retroflicker.gif"))
101105
self.background_graphics.setMovie(movie)

0 commit comments

Comments
 (0)