From c7c1dcd346500484ca417d7d1408b3350476a93c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 4 Jun 2015 18:32:14 +0200 Subject: [PATCH] ptp-helper: Make sure that we are running setuid root if configured that way --- libs/gst/helpers/gst-ptp-helper.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libs/gst/helpers/gst-ptp-helper.c b/libs/gst/helpers/gst-ptp-helper.c index ab803aefd8..1473cf74c9 100644 --- a/libs/gst/helpers/gst-ptp-helper.c +++ b/libs/gst/helpers/gst-ptp-helper.c @@ -619,6 +619,11 @@ main (gint argc, gchar ** argv) GMainLoop *loop; GError *err = NULL; +#ifdef HAVE_PTP_HELPER_SETUID + if (setuid (0) < 0) + g_error ("not running with superuser privileges"); +#endif + opt_ctx = g_option_context_new ("- GStreamer PTP helper process"); g_option_context_add_main_entries (opt_ctx, opt_entries, NULL); if (!g_option_context_parse (opt_ctx, &argc, &argv, &err))