From f18f2619e1a91008ec683355afb41b0419e7432e Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 15 Jul 2013 16:47:07 +0200 Subject: [PATCH] auth: add default authorizations When no auth module is specified, use our table of defaults to look up the default value of the check instead of always allowing everything. This was we can disallow client settings by default. --- gst/rtsp-server/rtsp-auth.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/gst/rtsp-server/rtsp-auth.c b/gst/rtsp-server/rtsp-auth.c index deea3eb..8b4866f 100644 --- a/gst/rtsp-server/rtsp-auth.c +++ b/gst/rtsp-server/rtsp-auth.c @@ -468,6 +468,19 @@ default_check (GstRTSPAuth * auth, GstRTSPClientState * state, return res; } +static gboolean +no_auth_check (const gchar * check) +{ + gboolean res; + + if (g_str_equal (check, GST_RTSP_AUTH_CHECK_TRANSPORT_CLIENT_SETTINGS)) + res = FALSE; + else + res = TRUE; + + return res; +} + /** * gst_rtsp_auth_check: * @check: the item to check @@ -491,7 +504,7 @@ gst_rtsp_auth_check (const gchar * check) /* no auth, we don't need to check */ if (!(auth = state->auth)) - return TRUE; + return no_auth_check (check); klass = GST_RTSP_AUTH_GET_CLASS (auth); -- 2.7.4