From 0dd6156eaf461a25781a9f0b7dd727e03c6172b0 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 6 Jan 2009 20:27:15 +0100 Subject: [PATCH] Protect Connect and Disconnect with security policy --- src/network.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/network.c b/src/network.c index 99bb40b..4af71c3 100644 --- a/src/network.c +++ b/src/network.c @@ -185,6 +185,9 @@ static DBusMessage *do_connect(DBusConnection *conn, DBG("conn %p", conn); + if (__connman_security_check_privileges(msg) < 0) + return __connman_error_permission_denied(msg); + if (network->connected == TRUE) return __connman_error_failed(msg); @@ -206,6 +209,9 @@ static DBusMessage *do_disconnect(DBusConnection *conn, DBG("conn %p", conn); + if (__connman_security_check_privileges(msg) < 0) + return __connman_error_permission_denied(msg); + if (network->connected == FALSE) return __connman_error_failed(msg); -- 2.7.4