summaryrefslogtreecommitdiffstats
path: root/src/gsm_gnomesu.cpp
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:59:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:59:44 +0000
commitfb31765cbe33890f325a87015507364156741321 (patch)
tree0c5cd12aee0a0a6a6e2d542520df5846859bd40d /src/gsm_gnomesu.cpp
parentInitial commit. (diff)
downloadgnome-system-monitor-fb31765cbe33890f325a87015507364156741321.tar.xz
gnome-system-monitor-fb31765cbe33890f325a87015507364156741321.zip
Adding upstream version 42.0.upstream/42.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/gsm_gnomesu.cpp')
-rw-r--r--src/gsm_gnomesu.cpp41
1 files changed, 41 insertions, 0 deletions
diff --git a/src/gsm_gnomesu.cpp b/src/gsm_gnomesu.cpp
new file mode 100644
index 0000000..31b8645
--- /dev/null
+++ b/src/gsm_gnomesu.cpp
@@ -0,0 +1,41 @@
+/* -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+#include <config.h>
+
+#include <glib.h>
+
+#include "application.h"
+#include "gsm_gnomesu.h"
+#include "util.h"
+
+gboolean (*gnomesu_exec)(const char *commandline);
+
+
+static void
+load_gnomesu(void)
+{
+ static gboolean init;
+
+ if (init)
+ return;
+
+ init = TRUE;
+
+ load_symbols("libgnomesu.so.0",
+ "gnomesu_exec", &gnomesu_exec,
+ NULL);
+}
+
+
+gboolean
+gsm_gnomesu_create_root_password_dialog(const char *command)
+{
+ return gnomesu_exec(command);
+}
+
+
+gboolean
+procman_has_gnomesu(void)
+{
+ load_gnomesu();
+ return gnomesu_exec != NULL;
+}