char *private_key_passphrase_type;
char *phase2;
char *passphrase;
+ gboolean from_fs;
};
struct connman_config {
static GIOChannel *inotify_channel = NULL;
static uint inotify_watch = 0;
+#define NONFS_CONFIG_NAME "internal"
+
/* Definition of possible strings in the .config files */
#define CONFIG_KEY_NAME "Name"
#define CONFIG_KEY_DESC "Description"
service->passphrase = str;
}
+ if (g_strcmp0(config->ident, NONFS_CONFIG_NAME) != 0)
+ service->from_fs = TRUE;
+ else
+ service->from_fs = FALSE;
+
if (service_created)
g_hash_table_insert(config->service_table, service->ident,
service);
return 0;
}
+static struct connman_config *create_config(const char *ident);
+
+int __connman_config_load_service(GKeyFile *keyfile, const char *group)
+{
+ struct connman_config *config = g_hash_table_lookup(config_table,
+ NONFS_CONFIG_NAME);
+
+ if (config == NULL) {
+ config = create_config(NONFS_CONFIG_NAME);
+ if (config == NULL)
+ return -ENOMEM;
+ }
+
+ return load_service(keyfile, group, config);
+}
+
static int load_config(struct connman_config *config)
{
GKeyFile *keyfile;
if (ident == NULL)
continue;
+ if (g_str_equal(ident, NONFS_CONFIG_NAME) == TRUE)
+ continue;
+
str = g_string_new_len(file, ident - file);
if (str == NULL)
continue;
*ext = '\0';
+ if (g_str_equal(ident, NONFS_CONFIG_NAME) == TRUE)
+ continue;
+
if (connman_dbus_validate_ident(ident) == FALSE)
continue;
if (memcmp(config->ssid, ssid, ssid_len) != 0)
return;
- __connman_service_set_immutable(service, TRUE);
+ /* do not provision immutable services with non-fs originated configs */
+ if (config->from_fs == FALSE &&
+ __connman_service_get_immutable(service) == TRUE)
+ return;
+
+ /* only lock services with a config originated from the filesystem */
+ if (config->from_fs == TRUE)
+ __connman_service_set_immutable(service, TRUE);
+
__connman_service_set_favorite(service, TRUE);
if (config->eap != NULL)