gst-plugins-good: rtpmanager: don't reveal the user's username, hostname or real name by default

Tim Müller tpm at kemper.freedesktop.org
Mon Jan 23 05:48:11 PST 2012


Module: gst-plugins-good
Branch: master
Commit: a476d529d2f2d6a2c4a7008387de7cd427581b5f
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=a476d529d2f2d6a2c4a7008387de7cd427581b5f

Author: Tim-Philipp Müller <tim.muller at collabora.co.uk>
Date:   Mon Jan 23 13:15:46 2012 +0000

rtpmanager: don't reveal the user's username, hostname or real name by default

Send a randomly made-up user at hostname as CNAME and don't
send a NAME at all by default.

https://bugzilla.gnome.org/show_bug.cgi?id=668320

---

 gst/rtpmanager/gstrtpbin.c  |   10 ++++------
 gst/rtpmanager/rtpsession.c |   13 ++++++++++---
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/gst/rtpmanager/gstrtpbin.c b/gst/rtpmanager/gstrtpbin.c
index 621c85b..0b2167d 100644
--- a/gst/rtpmanager/gstrtpbin.c
+++ b/gst/rtpmanager/gstrtpbin.c
@@ -1883,7 +1883,7 @@ gst_rtp_bin_class_init (GstRtpBinClass * klass)
 static void
 gst_rtp_bin_init (GstRtpBin * rtpbin, GstRtpBinClass * klass)
 {
-  gchar *str;
+  gchar *cname;
 
   rtpbin->priv = GST_RTP_BIN_GET_PRIVATE (rtpbin);
   rtpbin->priv->bin_lock = g_mutex_new ();
@@ -1901,12 +1901,10 @@ gst_rtp_bin_init (GstRtpBin * rtpbin, GstRtpBinClass * klass)
   rtpbin->use_pipeline_clock = DEFAULT_USE_PIPELINE_CLOCK;
 
   /* some default SDES entries */
-  str = g_strdup_printf ("%s@%s", g_get_user_name (), g_get_host_name ());
+  cname = g_strdup_printf ("user%u at x-%u.net", g_random_int (), g_random_int ());
   rtpbin->sdes = gst_structure_new ("application/x-rtp-source-sdes",
-      "cname", G_TYPE_STRING, str,
-      "name", G_TYPE_STRING, g_get_real_name (),
-      "tool", G_TYPE_STRING, "GStreamer", NULL);
-  g_free (str);
+      "cname", G_TYPE_STRING, cname, "tool", G_TYPE_STRING, "GStreamer", NULL);
+  g_free (cname);
 }
 
 static void
diff --git a/gst/rtpmanager/rtpsession.c b/gst/rtpmanager/rtpsession.c
index eed96ac..72849a7 100644
--- a/gst/rtpmanager/rtpsession.c
+++ b/gst/rtpmanager/rtpsession.c
@@ -556,12 +556,19 @@ rtp_session_init (RTPSession * sess)
   sess->mtu = DEFAULT_RTCP_MTU;
 
   /* some default SDES entries */
-  str = g_strdup_printf ("%s@%s", g_get_user_name (), g_get_host_name ());
+
+  /* we do not want to leak details like the username or hostname here */
+  str = g_strdup_printf ("user%u at x-%u.net", g_random_int (), g_random_int ());
   rtp_source_set_sdes_string (sess->source, GST_RTCP_SDES_CNAME, str);
   g_free (str);
 
-  rtp_source_set_sdes_string (sess->source, GST_RTCP_SDES_NAME,
-      g_get_real_name ());
+#if 0
+  /* we do not want to leak the user's real name here */
+  str = g_strdup_printf ("Anon%u", g_random_int ());
+  rtp_source_set_sdes_string (sess->source, GST_RTCP_SDES_NAME, str);
+  g_free (str);
+#endif
+
   rtp_source_set_sdes_string (sess->source, GST_RTCP_SDES_TOOL, "GStreamer");
 
   sess->first_rtcp = TRUE;



More information about the gstreamer-commits mailing list