From e38df594b79345a08433d79291380187bc007b19 Mon Sep 17 00:00:00 2001 From: Samuel Ortiz Date: Wed, 29 Sep 2010 19:19:14 +0200 Subject: [PATCH] Export __connman_service_set_passphrase() to ConnMan core --- src/connman.h | 3 +++ src/service.c | 9 ++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/connman.h b/src/connman.h index 15ab36d..55e72ec 100644 --- a/src/connman.h +++ b/src/connman.h @@ -498,6 +498,9 @@ const char *__connman_service_get_nameserver(struct connman_service *service); void __connman_service_set_proxy_autoconfig(struct connman_service *service, const char *url); +void __connman_service_set_passphrase(struct connman_service *service, + const char* passphrase); + void __connman_service_notify(struct connman_ipconfig *ipconfig, unsigned int rx_packets, unsigned int tx_packets, unsigned int rx_bytes, unsigned int tx_bytes, diff --git a/src/service.c b/src/service.c index 2db12b9..6a2b19d 100644 --- a/src/service.c +++ b/src/service.c @@ -1423,9 +1423,12 @@ const char *connman_service_get_proxy_autoconfig(struct connman_service *service return __connman_ipconfig_get_proxy_autoconfig(service->ipconfig); } -static void connman_service_set_passphrase(struct connman_service *service, +void __connman_service_set_passphrase(struct connman_service *service, const char* passphrase) { + if (service->immutable == TRUE) + return; + g_free(service->passphrase); service->passphrase = g_strdup(passphrase); @@ -1510,7 +1513,7 @@ static DBusMessage *set_property(DBusConnection *conn, dbus_message_iter_get_basic(&value, &passphrase); - connman_service_set_passphrase(service, passphrase); + __connman_service_set_passphrase(service, passphrase); } else if (g_str_equal(name, "APN") == TRUE) { const char *apn; @@ -1929,7 +1932,7 @@ static void request_input_cb (struct connman_service *service, if (passphrase == NULL) return; - connman_service_set_passphrase(service, passphrase); + __connman_service_set_passphrase(service, passphrase); __connman_service_connect(service); } -- 2.7.4