Use ${TMPDIR} as the default working directory.

This patch uses ${TMPDIR} as the default working directory, falling back
to the old behaviour is /tmp was not set. This also passes the desired
working directory to delta_generator as a TMPDIR env variable.

Bug: 34250932
Test: `strace -e trace=open -f -- brillo_update_payload generate --payload pay.bin --target_image tf.zip --work_dir /tmp/foobar 2>&1 | grep tmp` only shows access to /tmp/foobar, not /tmp
Change-Id: I4972a4010d7eed73b2fd1cc9c782b0775509b50c
1 file changed
tree: a84e830302f12eb9d6a30cdecf2c8316c8cf7898
  1. binder_bindings/
  2. client_library/
  3. common/
  4. dbus_bindings/
  5. include/
  6. init/
  7. payload_consumer/
  8. payload_generator/
  9. sample_images/
  10. scripts/
  11. update_manager/
  12. update_payload_key/
  13. weaved/
  14. .gitignore
  15. Android.mk
  16. binder_service_android.cc
  17. binder_service_android.h
  18. binder_service_brillo.cc
  19. binder_service_brillo.h
  20. boot_control_android.cc
  21. boot_control_android.h
  22. boot_control_chromeos.cc
  23. boot_control_chromeos.h
  24. boot_control_chromeos_unittest.cc
  25. boot_control_recovery.cc
  26. boot_control_recovery.h
  27. boot_control_recovery_stub.cc
  28. certificate_checker.cc
  29. certificate_checker.h
  30. certificate_checker_unittest.cc
  31. chrome_browser_proxy_resolver.cc
  32. chrome_browser_proxy_resolver.h
  33. chrome_browser_proxy_resolver_unittest.cc
  34. common_service.cc
  35. common_service.h
  36. common_service_unittest.cc
  37. connection_manager.cc
  38. connection_manager.h
  39. connection_manager_android.cc
  40. connection_manager_android.h
  41. connection_manager_interface.h
  42. connection_manager_unittest.cc
  43. connection_utils.cc
  44. connection_utils.h
  45. daemon.cc
  46. daemon.h
  47. daemon_state_android.cc
  48. daemon_state_android.h
  49. daemon_state_interface.h
  50. dbus_connection.cc
  51. dbus_connection.h
  52. dbus_service.cc
  53. dbus_service.h
  54. dbus_test_utils.h
  55. fake_file_writer.h
  56. fake_p2p_manager.h
  57. fake_p2p_manager_configuration.h
  58. fake_shill_proxy.cc
  59. fake_shill_proxy.h
  60. fake_system_state.cc
  61. fake_system_state.h
  62. generate_pc_file.sh
  63. hardware_android.cc
  64. hardware_android.h
  65. hardware_chromeos.cc
  66. hardware_chromeos.h
  67. hardware_chromeos_unittest.cc
  68. image_properties.h
  69. image_properties_android.cc
  70. image_properties_chromeos.cc
  71. image_properties_chromeos_unittest.cc
  72. libcros_proxy.cc
  73. libcros_proxy.h
  74. libcurl_http_fetcher.cc
  75. libcurl_http_fetcher.h
  76. libupdate_engine-client-test.pc.in
  77. libupdate_engine-client.pc.in
  78. local_coverage_rate
  79. main.cc
  80. metrics.cc
  81. metrics.h
  82. metrics_utils.cc
  83. metrics_utils.h
  84. metrics_utils_unittest.cc
  85. mock_certificate_checker.h
  86. mock_connection_manager.h
  87. mock_file_writer.h
  88. mock_omaha_request_params.h
  89. mock_p2p_manager.h
  90. mock_payload_state.h
  91. mock_power_manager.h
  92. mock_proxy_resolver.h
  93. mock_update_attempter.h
  94. MODULE_LICENSE_APACHE2
  95. network_selector.h
  96. network_selector_android.cc
  97. network_selector_android.h
  98. network_selector_interface.h
  99. network_selector_stub.cc
  100. network_selector_stub.h
  101. NOTICE
  102. omaha_request_action.cc
  103. omaha_request_action.h
  104. omaha_request_action_unittest.cc
  105. omaha_request_params.cc
  106. omaha_request_params.h
  107. omaha_request_params_unittest.cc
  108. omaha_response.h
  109. omaha_response_handler_action.cc
  110. omaha_response_handler_action.h
  111. omaha_response_handler_action_unittest.cc
  112. omaha_utils.cc
  113. omaha_utils.h
  114. omaha_utils_unittest.cc
  115. OWNERS
  116. p2p_manager.cc
  117. p2p_manager.h
  118. p2p_manager_unittest.cc
  119. parcelable_update_engine_status.cc
  120. parcelable_update_engine_status.h
  121. payload_state.cc
  122. payload_state.h
  123. payload_state_interface.h
  124. payload_state_unittest.cc
  125. power_manager_android.cc
  126. power_manager_android.h
  127. power_manager_chromeos.cc
  128. power_manager_chromeos.h
  129. power_manager_interface.h
  130. PRESUBMIT.cfg
  131. proxy_resolver.cc
  132. proxy_resolver.h
  133. real_system_state.cc
  134. real_system_state.h
  135. run_unittests
  136. sample_omaha_v3_response.xml
  137. service_delegate_android_interface.h
  138. service_observer_interface.h
  139. shill_proxy.cc
  140. shill_proxy.h
  141. shill_proxy_interface.h
  142. sideload_main.cc
  143. system_state.h
  144. tar_bunzip2.gypi
  145. test_http_server.cc
  146. test_subprocess.cc
  147. testrunner.cc
  148. unittest_key.pem
  149. unittest_key2.pem
  150. update_attempter.cc
  151. update_attempter.h
  152. update_attempter_android.cc
  153. update_attempter_android.h
  154. update_attempter_unittest.cc
  155. update_engine-client.gyp
  156. update_engine.conf
  157. update_engine.gyp
  158. update_engine.rc
  159. update_engine_client.cc
  160. update_engine_client_android.cc
  161. update_metadata.proto
  162. update_status_utils.cc
  163. update_status_utils.h
  164. UpdateEngine.conf
  165. utils_android.cc
  166. utils_android.h
  167. WATCHLISTS
  168. weave_service.cc
  169. weave_service.h
  170. weave_service_factory.cc
  171. weave_service_factory.h
  172. weave_service_interface.h