update_engine: check type when reading Services property of
connection manager.

Before reading the first element of the Services array, verify that the
value is, in fact, an array of the correct type. This prevents a crash in
the case where the new connection manager (shill) sends the Services as an
array of D-Bus strings, rather than an array of D-Bus object paths.

BUG=chromium-os:27987
TEST=manual, unit tests

Manual testing: ran image_to_live with DUT running flimflam and shill. With
flimflam, update_engine behaves as before patch. With shill, the patch
resolves a crash that would occur when copying the first element of the
Services property into |out_path|.

Change-Id: I4e1d02b5ae471dce9d8b87a0c7a4f2d859c88df7
Reviewed-on: https://gerrit.chromium.org/gerrit/18508
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: mukesh agrawal <quiche@chromium.org>
3 files changed
tree: d874db12e4397463feca1a6bbeb83fca0c0c540c
  1. .gitignore
  2. 99-gpio-dutflag.rules
  3. action.h
  4. action_mock.h
  5. action_pipe.h
  6. action_pipe_unittest.cc
  7. action_processor.cc
  8. action_processor.h
  9. action_processor_mock.h
  10. action_processor_unittest.cc
  11. action_unittest.cc
  12. bzip.cc
  13. bzip.h
  14. bzip_extent_writer.cc
  15. bzip_extent_writer.h
  16. bzip_extent_writer_unittest.cc
  17. certificate_checker.cc
  18. certificate_checker.h
  19. certificate_checker_mock.h
  20. certificate_checker_unittest.cc
  21. chrome_browser_proxy_resolver.cc
  22. chrome_browser_proxy_resolver.h
  23. chrome_browser_proxy_resolver_unittest.cc
  24. chrome_proxy_resolver.cc
  25. chrome_proxy_resolver.h
  26. chrome_proxy_resolver_unittest.cc
  27. cycle_breaker.cc
  28. cycle_breaker.h
  29. cycle_breaker_unittest.cc
  30. dbus_constants.h
  31. dbus_interface.h
  32. dbus_service.cc
  33. dbus_service.h
  34. delta_diff_generator.cc
  35. delta_diff_generator.h
  36. delta_diff_generator_unittest.cc
  37. delta_performer.cc
  38. delta_performer.h
  39. delta_performer_unittest.cc
  40. download_action.cc
  41. download_action.h
  42. download_action_unittest.cc
  43. extent_mapper.cc
  44. extent_mapper.h
  45. extent_mapper_unittest.cc
  46. extent_ranges.cc
  47. extent_ranges.h
  48. extent_ranges_unittest.cc
  49. extent_writer.cc
  50. extent_writer.h
  51. extent_writer_unittest.cc
  52. file_writer.cc
  53. file_writer.h
  54. file_writer_mock.h
  55. file_writer_unittest.cc
  56. filesystem_copier_action.cc
  57. filesystem_copier_action.h
  58. filesystem_copier_action_unittest.cc
  59. filesystem_iterator.cc
  60. filesystem_iterator.h
  61. filesystem_iterator_unittest.cc
  62. flimflam_proxy.cc
  63. flimflam_proxy.h
  64. flimflam_proxy_unittest.cc
  65. full_update_generator.cc
  66. full_update_generator.h
  67. full_update_generator_unittest.cc
  68. gen_coverage_html.sh
  69. generate_delta_main.cc
  70. gpio_handler.cc
  71. gpio_handler.h
  72. graph_types.h
  73. graph_utils.cc
  74. graph_utils.h
  75. graph_utils_unittest.cc
  76. http_common.cc
  77. http_common.h
  78. http_fetcher.cc
  79. http_fetcher.h
  80. http_fetcher_unittest.cc
  81. http_fetcher_unittest.h
  82. inherit-review-settings-ok
  83. install_plan.h
  84. integration_unittest.cc
  85. libcurl_http_fetcher.cc
  86. libcurl_http_fetcher.h
  87. LICENSE
  88. local_coverage_rate.sh
  89. main.cc
  90. marshal.list
  91. metadata.cc
  92. metadata.h
  93. metadata_unittest.cc
  94. mock_dbus_interface.h
  95. mock_file_writer.h
  96. mock_http_fetcher.cc
  97. mock_http_fetcher.h
  98. multi_range_http_fetcher.cc
  99. multi_range_http_fetcher.h
  100. omaha_hash_calculator.cc
  101. omaha_hash_calculator.h
  102. omaha_hash_calculator_unittest.cc
  103. omaha_request_action.cc
  104. omaha_request_action.h
  105. omaha_request_action_unittest.cc
  106. omaha_request_params.cc
  107. omaha_request_params.h
  108. omaha_request_params_unittest.cc
  109. omaha_response_handler_action.cc
  110. omaha_response_handler_action.h
  111. omaha_response_handler_action_unittest.cc
  112. org.chromium.UpdateEngine.service
  113. payload_signer.cc
  114. payload_signer.h
  115. payload_signer_unittest.cc
  116. postinstall_runner_action.cc
  117. postinstall_runner_action.h
  118. postinstall_runner_action_unittest.cc
  119. prefs.cc
  120. prefs.h
  121. prefs_interface.h
  122. prefs_mock.h
  123. prefs_unittest.cc
  124. proxy_resolver.cc
  125. proxy_resolver.h
  126. SConstruct
  127. setup_dev_packages
  128. simple_key_value_store.cc
  129. simple_key_value_store.h
  130. simple_key_value_store_unittest.cc
  131. subprocess.cc
  132. subprocess.h
  133. subprocess_unittest.cc
  134. tarjan.cc
  135. tarjan.h
  136. tarjan_unittest.cc
  137. terminator.cc
  138. terminator.h
  139. terminator_unittest.cc
  140. test_http_server.cc
  141. test_utils.cc
  142. test_utils.h
  143. testrunner.cc
  144. topological_sort.cc
  145. topological_sort.h
  146. topological_sort_unittest.cc
  147. unittest_key.pem
  148. unittest_key2.pem
  149. update_attempter.cc
  150. update_attempter.h
  151. update_attempter_mock.h
  152. update_attempter_unittest.cc
  153. update_check_scheduler.cc
  154. update_check_scheduler.h
  155. update_check_scheduler_unittest.cc
  156. update_engine.xml
  157. update_engine_client.cc
  158. update_metadata.proto
  159. UpdateEngine.conf
  160. utils.cc
  161. utils.h
  162. utils_unittest.cc
  163. WATCHLISTS
  164. zip_unittest.cc