From 26adb4d8189ddad7d33a74ba2f356ea97c288fd8 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Sun, 24 Nov 2024 22:52:36 +0100 Subject: Dont allow running the program as the root user --- src/main.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') 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); -- cgit v1.2.3