fixed Android product string
authorAndreas Steffen <andreas.steffen@strongswan.org>
Wed, 7 Nov 2012 13:57:41 +0000 (14:57 +0100)
committerAndreas Steffen <andreas.steffen@strongswan.org>
Wed, 7 Nov 2012 13:57:41 +0000 (14:57 +0100)
src/libimcv/plugins/imv_os/imv_os.c
src/libimcv/plugins/imv_os/imv_os_database.c

index 6d71678..c1af31f 100644 (file)
@@ -354,8 +354,7 @@ static TNC_Result receive_message(imv_state_t *state, imv_msg_t *in_msg)
                {
                        ita_attr_get_settings_t *attr_cast;
 
-                       DBG1(DBG_IMV, "requesting installed packages for '%s'",
-                                                  product_info);
+                       /* requesting installed packages */
                        os_state->set_package_request(os_state, TRUE);
                        attr = ietf_attr_attr_request_create(PEN_IETF,
                                                                IETF_ATTR_INSTALLED_PACKAGES);
index 1a34b16..e209331 100644 (file)
@@ -57,18 +57,18 @@ METHOD(imv_os_database_t, check_packages, status_t,
        if (os_type == OS_TYPE_ANDROID)
        {
                /*no package dependency on Android version */
-               os_version_len = 0;
+               product = strdup(enum_to_name(os_type_names, os_type));
        }
        else
        {
                /* remove appended platform info */
                pos = memchr(os_version.ptr, ' ', os_version.len);
                os_version_len = pos ? (pos - os_version.ptr) : os_version.len;
+               product = malloc(os_name.len + 1 + os_version_len + 1);
+               sprintf(product, "%.*s %.*s", os_name.len, os_name.ptr,
+                                                                         os_version_len, os_version.ptr); 
        }
-
-       product = malloc(os_name.len + 1 + os_version_len + 1);
-       sprintf(product, "%.*s %.*s", os_name.len, os_name.ptr,
-                                                                 os_version_len, os_version.ptr); 
+       DBG1(DBG_IMV, "processing installed '%s' packages", product);
 
        /* Get primary key of product */
        e = this->db->query(this->db,