vpn: add support for spawning VPN client programs in minijail

Spawn VPN programs in a minijail if the --jail-vpn-clients command line
flag is passed. Also update unit tests.

Also make the openvpn config dir/file world-readable so it can be created
by shill user and accessed by openvpn user. If we think this file is
sensitive and shouldn't be world-readable then we could alternatively
make shill user belong to openvpn group and have shill chgrp() on the
file to openvpn. I didn't do that here for sake of simplicity but will
make that accomodation if anyone feels strongly about this.

BUG=chromium:649417
CQ-DEPEND=CL:1086231
TEST=unit tests pass, tested as part of larger sandbox shill debug CL

Change-Id: I1037c1e3b060e53a699411c197c5961f9cbc5527
Reviewed-on: https://chromium-review.googlesource.com/1087359
Commit-Ready: Micah Morton <mortonm@chromium.org>
Tested-by: Micah Morton <mortonm@chromium.org>
Reviewed-by: Micah Morton <mortonm@chromium.org>
7 files changed
tree: 372b42890d464353547ff957acc3da0256031b8d
  1. bin/
  2. cellular/
  3. dbus/
  4. dbus_bindings/
  5. dhcp/
  6. doc/
  7. ethernet/
  8. init/
  9. mobile_operator_db/
  10. net/
  11. pppoe/
  12. setup_wifi/
  13. shims/
  14. supplicant/
  15. test-scripts/
  16. udev/
  17. upstart/
  18. vpn/
  19. wifi/
  20. wimax/
  21. .gitignore
  22. accessor_interface.h
  23. active_link_monitor.cc
  24. active_link_monitor.h
  25. active_link_monitor_unittest.cc
  26. adaptor_interfaces.h
  27. async_connection.cc
  28. async_connection.h
  29. async_connection_unittest.cc
  30. callbacks.h
  31. certificate_file.cc
  32. certificate_file.h
  33. certificate_file_unittest.cc
  34. connection.cc
  35. connection.h
  36. connection_diagnostics.cc
  37. connection_diagnostics.h
  38. connection_diagnostics_unittest.cc
  39. connection_health_checker.cc
  40. connection_health_checker.h
  41. connection_health_checker_unittest.cc
  42. connection_info.cc
  43. connection_info.h
  44. connection_info_reader.cc
  45. connection_info_reader.h
  46. connection_info_reader_unittest.cc
  47. connection_info_unittest.cc
  48. connection_tester.cc
  49. connection_tester.h
  50. connection_tester_unittest.cc
  51. connection_unittest.cc
  52. connectivity_trial.cc
  53. connectivity_trial.h
  54. connectivity_trial_unittest.cc
  55. control_interface.h
  56. crypto_des_cbc.cc
  57. crypto_des_cbc.h
  58. crypto_des_cbc_unittest.cc
  59. crypto_interface.h
  60. crypto_provider.cc
  61. crypto_provider.h
  62. crypto_provider_unittest.cc
  63. crypto_rot47.cc
  64. crypto_rot47.h
  65. crypto_rot47_unittest.cc
  66. crypto_util_proxy.cc
  67. crypto_util_proxy.h
  68. crypto_util_proxy_unittest.cc
  69. daemon_task.cc
  70. daemon_task.h
  71. daemon_task_unittest.cc
  72. dbus_properties_proxy_interface.h
  73. default_profile.cc
  74. default_profile.h
  75. default_profile_unittest.cc
  76. device.cc
  77. device.h
  78. device_claimer.cc
  79. device_claimer.h
  80. device_claimer_unittest.cc
  81. device_id.cc
  82. device_id.h
  83. device_info.cc
  84. device_info.h
  85. device_info_unittest.cc
  86. device_stub.h
  87. device_unittest.cc
  88. dns_client.cc
  89. dns_client.h
  90. dns_client_factory.cc
  91. dns_client_factory.h
  92. dns_client_unittest.cc
  93. dns_server_tester.cc
  94. dns_server_tester.h
  95. dns_server_tester_unittest.cc
  96. dns_util.cc
  97. dns_util.h
  98. dns_util_unittest.cc
  99. eap_credentials.cc
  100. eap_credentials.h
  101. eap_credentials_unittest.cc
  102. eap_listener.cc
  103. eap_listener.h
  104. eap_listener_unittest.cc
  105. eap_protocol.h
  106. ephemeral_profile.cc
  107. ephemeral_profile.h
  108. error.cc
  109. error.h
  110. error_unittest.cc
  111. event_dispatcher.cc
  112. event_dispatcher.h
  113. external_task.cc
  114. external_task.h
  115. external_task_unittest.cc
  116. fake_store.cc
  117. fake_store.h
  118. file_io.cc
  119. file_io.h
  120. file_reader.cc
  121. file_reader.h
  122. file_reader_unittest.cc
  123. geolocation_info.cc
  124. geolocation_info.h
  125. HACKING.md
  126. hook_table.cc
  127. hook_table.h
  128. hook_table_unittest.cc
  129. http_request.cc
  130. http_request.h
  131. http_request_unittest.cc
  132. http_url.cc
  133. http_url.h
  134. http_url_unittest.cc
  135. icmp.cc
  136. icmp.h
  137. icmp_session.cc
  138. icmp_session.h
  139. icmp_session_factory.cc
  140. icmp_session_factory.h
  141. icmp_session_unittest.cc
  142. icmp_unittest.cc
  143. ip_address_store.cc
  144. ip_address_store.h
  145. ip_address_store_unittest.cc
  146. ipconfig.cc
  147. ipconfig.h
  148. ipconfig_unittest.cc
  149. json_store.cc
  150. json_store.h
  151. json_store_unittest.cc
  152. key_file_store.cc
  153. key_file_store.h
  154. key_file_store_unittest.cc
  155. key_value_store.cc
  156. key_value_store.h
  157. key_value_store_unittest.cc
  158. libshill-client-test.pc.in
  159. libshill-client.pc.in
  160. link_monitor.cc
  161. link_monitor.h
  162. link_monitor_unittest.cc
  163. logging.cc
  164. logging.h
  165. manager.cc
  166. manager.h
  167. manager_unittest.cc
  168. metrics.cc
  169. metrics.h
  170. metrics_unittest.cc
  171. mock_active_link_monitor.cc
  172. mock_active_link_monitor.h
  173. mock_adaptors.cc
  174. mock_adaptors.h
  175. mock_ares.cc
  176. mock_ares.h
  177. mock_async_connection.cc
  178. mock_async_connection.h
  179. mock_certificate_file.cc
  180. mock_certificate_file.h
  181. mock_connection.cc
  182. mock_connection.h
  183. mock_connection_health_checker.cc
  184. mock_connection_health_checker.h
  185. mock_connection_info_reader.cc
  186. mock_connection_info_reader.h
  187. mock_connectivity_trial.cc
  188. mock_connectivity_trial.h
  189. mock_control.cc
  190. mock_control.h
  191. mock_crypto_util_proxy.cc
  192. mock_crypto_util_proxy.h
  193. mock_dbus_properties_proxy.cc
  194. mock_dbus_properties_proxy.h
  195. mock_device.cc
  196. mock_device.h
  197. mock_device_claimer.cc
  198. mock_device_claimer.h
  199. mock_device_info.cc
  200. mock_device_info.h
  201. mock_dns_client.cc
  202. mock_dns_client.h
  203. mock_dns_client_factory.cc
  204. mock_dns_client_factory.h
  205. mock_dns_server_tester.cc
  206. mock_dns_server_tester.h
  207. mock_eap_credentials.cc
  208. mock_eap_credentials.h
  209. mock_eap_listener.cc
  210. mock_eap_listener.h
  211. mock_event_dispatcher.cc
  212. mock_event_dispatcher.h
  213. mock_external_task.cc
  214. mock_external_task.h
  215. mock_file_io.h
  216. mock_http_request.cc
  217. mock_http_request.h
  218. mock_icmp.cc
  219. mock_icmp.h
  220. mock_icmp_session.cc
  221. mock_icmp_session.h
  222. mock_icmp_session_factory.cc
  223. mock_icmp_session_factory.h
  224. mock_ip_address_store.cc
  225. mock_ip_address_store.h
  226. mock_ipconfig.cc
  227. mock_ipconfig.h
  228. mock_link_monitor.cc
  229. mock_link_monitor.h
  230. mock_log.cc
  231. mock_log.h
  232. mock_log_unittest.cc
  233. mock_manager.cc
  234. mock_manager.h
  235. mock_metrics.cc
  236. mock_metrics.h
  237. mock_passive_link_monitor.cc
  238. mock_passive_link_monitor.h
  239. mock_pending_activation_store.cc
  240. mock_pending_activation_store.h
  241. mock_portal_detector.cc
  242. mock_portal_detector.h
  243. mock_power_manager.cc
  244. mock_power_manager.h
  245. mock_power_manager_proxy.cc
  246. mock_power_manager_proxy.h
  247. mock_ppp_device.cc
  248. mock_ppp_device.h
  249. mock_ppp_device_factory.cc
  250. mock_ppp_device_factory.h
  251. mock_process_manager.cc
  252. mock_process_manager.h
  253. mock_profile.cc
  254. mock_profile.h
  255. mock_property_store.cc
  256. mock_property_store.h
  257. mock_resolver.cc
  258. mock_resolver.h
  259. mock_routing_table.cc
  260. mock_routing_table.h
  261. mock_service.cc
  262. mock_service.h
  263. mock_socket_info_reader.cc
  264. mock_socket_info_reader.h
  265. mock_store.cc
  266. mock_store.h
  267. mock_throttler.cc
  268. mock_throttler.h
  269. mock_traffic_monitor.cc
  270. mock_traffic_monitor.h
  271. mock_virtual_device.cc
  272. mock_virtual_device.h
  273. MODULE_LICENSE_APACHE2
  274. NETLINK_MESSAGES.txt
  275. nice_mock_control.cc
  276. nice_mock_control.h
  277. NOTICE
  278. OWNERS
  279. passive_link_monitor.cc
  280. passive_link_monitor.h
  281. passive_link_monitor_unittest.cc
  282. pending_activation_store.cc
  283. pending_activation_store.h
  284. pending_activation_store_unittest.cc
  285. portal_detector.cc
  286. portal_detector.h
  287. portal_detector_unittest.cc
  288. power_manager.cc
  289. power_manager.h
  290. power_manager_proxy_interface.h
  291. power_manager_unittest.cc
  292. ppp_daemon.cc
  293. ppp_daemon.h
  294. ppp_daemon_unittest.cc
  295. ppp_device.cc
  296. ppp_device.h
  297. ppp_device_factory.cc
  298. ppp_device_factory.h
  299. ppp_device_unittest.cc
  300. PRESUBMIT.cfg
  301. process_manager.cc
  302. process_manager.h
  303. process_manager_unittest.cc
  304. profile.cc
  305. profile.h
  306. profile_unittest.cc
  307. property_accessor.h
  308. property_accessor_unittest.cc
  309. property_iterator.h
  310. property_store.cc
  311. property_store.h
  312. property_store_unittest.cc
  313. property_store_unittest.h
  314. protobuf_lite_streams.cc
  315. protobuf_lite_streams.h
  316. provider_db_unittest.bfd
  317. provider_interface.h
  318. refptr_types.h
  319. resolver.cc
  320. resolver.h
  321. resolver_unittest.cc
  322. result_aggregator.cc
  323. result_aggregator.h
  324. result_aggregator_unittest.cc
  325. routing_table.cc
  326. routing_table.h
  327. routing_table_entry.h
  328. routing_table_unittest.cc
  329. rpc_service_watcher_interface.h
  330. rpc_task.cc
  331. rpc_task.h
  332. rpc_task_unittest.cc
  333. scope_logger.cc
  334. scope_logger.h
  335. scope_logger_unittest.cc
  336. scoped_umask.cc
  337. scoped_umask.h
  338. service.cc
  339. service.h
  340. service_property_change_test.cc
  341. service_property_change_test.h
  342. service_sorter.h
  343. service_under_test.cc
  344. service_under_test.h
  345. service_unittest.cc
  346. shill-client.gyp
  347. shill.gyp
  348. shill.gypi
  349. shill_ares.cc
  350. shill_ares.h
  351. shill_config.cc
  352. shill_config.h
  353. shill_daemon.cc
  354. shill_daemon.h
  355. shill_main.cc
  356. shill_test_config.cc
  357. shill_test_config.h
  358. socket_info.cc
  359. socket_info.h
  360. socket_info_reader.cc
  361. socket_info_reader.h
  362. socket_info_reader_unittest.cc
  363. socket_info_unittest.cc
  364. static_ip_parameters.cc
  365. static_ip_parameters.h
  366. static_ip_parameters_unittest.cc
  367. store_interface.h
  368. stub_storage.h
  369. technology.cc
  370. technology.h
  371. technology_unittest.cc
  372. test_event_dispatcher.h
  373. TESTING
  374. testing.h
  375. testrunner.cc
  376. tethering.cc
  377. tethering.h
  378. throttler.cc
  379. throttler.h
  380. throttler_unittest.cc
  381. traffic_monitor.cc
  382. traffic_monitor.h
  383. traffic_monitor_unittest.cc
  384. virtual_device.cc
  385. virtual_device.h
  386. virtual_device_unittest.cc