technology: Do not apply Powered setting change if hardblock is on
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
Wed, 3 Oct 2012 10:29:13 +0000 (13:29 +0300)
committerPatrik Flykt <patrik.flykt@linux.intel.com>
Wed, 3 Oct 2012 10:45:20 +0000 (13:45 +0300)
src/technology.c

index 502cd60..e94e3b9 100644 (file)
@@ -650,7 +650,12 @@ static DBusMessage *set_powered(struct connman_technology *technology,
                                DBusMessage *msg, connman_bool_t powered)
 {
        DBusMessage *reply = NULL;
-       int err;
+       int err = 0;
+
+       if (technology->hardblocked == TRUE) {
+               err = -EACCES;
+               goto make_reply;
+       }
 
        if (powered == TRUE)
                err = technology_enable(technology, FALSE);
@@ -662,6 +667,7 @@ static DBusMessage *set_powered(struct connman_technology *technology,
                technology_save(technology);
        }
 
+make_reply:
        if (err == -EINPROGRESS) {
                technology->pending_reply = dbus_message_ref(msg);
                technology->pending_timeout = g_timeout_add_seconds(10,