aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-11-24 22:52:36 +0100
committerdec05eba <dec05eba@protonmail.com>2024-11-24 22:52:36 +0100
commit26adb4d8189ddad7d33a74ba2f356ea97c288fd8 (patch)
tree3021285016a63fbea14432975e275da553c5220a
parentc08811c0f3234f834479c6eeb1fffaccc29b7f8e (diff)
Dont allow running the program as the root userHEADmaster
-rw-r--r--README.md3
-rw-r--r--src/main.cpp5
2 files changed, 7 insertions, 1 deletions
diff --git a/README.md b/README.md
index 8072785..de53c23 100644
--- a/README.md
+++ b/README.md
@@ -17,7 +17,8 @@ These are the dependencies needed to build GPU Screen Recorder GTK:
* gtk3
* libx11
-* ayatana-appindicator3-0.1c
+* ayatana-appindicator3-0.1
+* desktop-file-utils
## Runtime dependencies
There are also additional dependencies needed at runtime:
diff --git a/src/main.cpp b/src/main.cpp
index 18ff526..39ed481 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -4323,6 +4323,11 @@ static void activate(GtkApplication *app, gpointer) {
int main(int argc, char **argv) {
setlocale(LC_ALL, "C");
+ if(geteuid() == 0) {
+ fprintf(stderr, "Error: don't run gpu-screen-recorder-gtk as the root user\n");
+ return 1;
+ }
+
dpy = XOpenDisplay(NULL);
gsr_info_exit_status = get_gpu_screen_recorder_info(&gsr_info);