Merge "@fix: Disconnect Reason code was not getting reset" into tizen
authortaesub kim <taesub.kim@samsung.com>
Wed, 11 Oct 2017 01:54:18 +0000 (01:54 +0000)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Wed, 11 Oct 2017 01:54:18 +0000 (01:54 +0000)
packaging/connman.spec
scripts/500.connman_upgrade.sh [new file with mode: 0644]
vpn/plugins/ipsec.c
vpn/plugins/vici-client.c

index 0888d9d..4238f16 100755 (executable)
@@ -41,6 +41,9 @@ Provides:       %{name}-profile_common = %{version}-%{release}
 Provides:       %{name}-profile_mobile = %{version}-%{release}
 Provides:       %{name}-profile_wearable = %{version}-%{release}
 
+%define upgrade_script_filename 500.connman_upgrade.sh
+%define upgrade_script_path /usr/share/upgrade/scripts
+
 %description
 Connection Manager provides a daemon for managing Internet connections
 within embedded devices running the Linux operating system.
@@ -218,6 +221,10 @@ cp src/connman.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/
 cp vpn/vpn-dbus.conf %{buildroot}%{_sysconfdir}/dbus-1/system.d/connman-vpn-dbus.conf
 %endif
 
+#OS Upgrade
+mkdir -p %{buildroot}%{upgrade_script_path}
+cp -f scripts/%{upgrade_script_filename} %{buildroot}%{upgrade_script_path}
+
 %post
 #chsmack -a 'System' /%{_localstatedir}/lib/connman
 #chsmack -a 'System' /%{_localstatedir}/lib/connman/settings
@@ -251,6 +258,7 @@ systemctl daemon-reload
 %attr(644,root,root) %{_libdir}/systemd/system/sockets.target.wants/connman.socket
 %endif
 %license COPYING
+%{upgrade_script_path}/%{upgrade_script_filename}
 
 %files test
 %manifest connman.manifest
diff --git a/scripts/500.connman_upgrade.sh b/scripts/500.connman_upgrade.sh
new file mode 100644 (file)
index 0000000..a21336e
--- /dev/null
@@ -0,0 +1,9 @@
+#!/bin/sh
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+#------------------------------------------------------------#
+# connman patch script for upgrade (3.0 -> the latest tizen) #
+#------------------------------------------------------------#
+
+chmod 755 /var/lib/connman
+chown -R network_fw:network_fw /var/lib/connman
index fa9dc7a..617830c 100644 (file)
@@ -796,6 +796,12 @@ static char *load_file_from_path(const char *path)
        }
 
        fd = fileno(fp);
+       if (fd == -1) {
+               connman_error("fp is not a valid stream");
+               fclose(fp);
+               return NULL;
+       }
+
        fstat(fd, &st);
        file_size = st.st_size;
        file_buff = g_try_malloc0(sizeof(char)*st.st_size);
index dc651cf..5fcc3c5 100644 (file)
@@ -280,6 +280,12 @@ static char *load_cert_from_path(const char *path)
        }
 
        fd = fileno(fp);
+       if (fd == -1) {
+               connman_error("fp is not a valid stream");
+               fclose(fp);
+               return NULL;
+       }
+
        fstat(fd, &st);
        file_size = st.st_size;
        file_buff = g_try_malloc0(sizeof(char)*st.st_size);
@@ -743,7 +749,6 @@ static void debug_vici_message(char *buf, unsigned int size)
                        pos++;
                        g_strlcpy(temp + key_len + 1, (const gchar *)&buf[pos], value_len + 1);
                        pos += value_len;
-                       len = key_len + 1 + value_len;
                }
                        break;
                case VICI_LIST_START: