[update_engine] Fix file creation mask to be 0600

In addition to changing the write() call in utils.cc, I also set the umask
of the process to be 177 -- meaning that files will be AT MOST -rw-------

I do this _after_ we initialize logging, so that we don't create log files
with unnecessarily restrictive permissions.

BUG=chromium-os:6581
TEST=Unit tests,

Change-Id: Id6b805a1524af391755bc1df69ec0f6c382154c2

[update_engine] Ensure that created files have restrictive permissions

Change-Id: If93e043465083f7c48619d0e7163dd73f8c46090

Review URL: http://codereview.chromium.org/3495002
5 files changed
tree: c850ff14983cf3f3485de24883a918305cbadcfb
  1. .gitignore
  2. action.h
  3. action_mock.h
  4. action_pipe.h
  5. action_pipe_unittest.cc
  6. action_processor.cc
  7. action_processor.h
  8. action_processor_mock.h
  9. action_processor_unittest.cc
  10. action_unittest.cc
  11. buffered_file_writer.cc
  12. buffered_file_writer.h
  13. buffered_file_writer_unittest.cc
  14. bzip.cc
  15. bzip.h
  16. bzip_extent_writer.cc
  17. bzip_extent_writer.h
  18. bzip_extent_writer_unittest.cc
  19. cycle_breaker.cc
  20. cycle_breaker.h
  21. cycle_breaker_unittest.cc
  22. dbus_constants.h
  23. dbus_service.cc
  24. dbus_service.h
  25. decompressing_file_writer.cc
  26. decompressing_file_writer.h
  27. decompressing_file_writer_unittest.cc
  28. delta_diff_generator.cc
  29. delta_diff_generator.h
  30. delta_diff_generator_unittest.cc
  31. delta_performer.cc
  32. delta_performer.h
  33. delta_performer_unittest.cc
  34. download_action.cc
  35. download_action.h
  36. download_action_unittest.cc
  37. extent_mapper.cc
  38. extent_mapper.h
  39. extent_mapper_unittest.cc
  40. extent_writer.cc
  41. extent_writer.h
  42. extent_writer_unittest.cc
  43. file_writer.cc
  44. file_writer.h
  45. file_writer_mock.h
  46. file_writer_unittest.cc
  47. filesystem_copier_action.cc
  48. filesystem_copier_action.h
  49. filesystem_copier_action_unittest.cc
  50. filesystem_iterator.cc
  51. filesystem_iterator.h
  52. filesystem_iterator_unittest.cc
  53. gen_coverage_html.sh
  54. generate_delta_main.cc
  55. graph_types.h
  56. graph_utils.cc
  57. graph_utils.h
  58. graph_utils_unittest.cc
  59. gzip.cc
  60. gzip.h
  61. http_fetcher.h
  62. http_fetcher_unittest.cc
  63. inherit-review-settings-ok
  64. install_plan.h
  65. integration_unittest.cc
  66. libcurl_http_fetcher.cc
  67. libcurl_http_fetcher.h
  68. LICENSE
  69. local_coverage_rate.sh
  70. main.cc
  71. marshal.list
  72. mock_file_writer.h
  73. mock_http_fetcher.cc
  74. mock_http_fetcher.h
  75. omaha_hash_calculator.cc
  76. omaha_hash_calculator.h
  77. omaha_hash_calculator_unittest.cc
  78. omaha_request_action.cc
  79. omaha_request_action.h
  80. omaha_request_action_unittest.cc
  81. omaha_request_params.cc
  82. omaha_request_params.h
  83. omaha_request_params_unittest.cc
  84. omaha_response_handler_action.cc
  85. omaha_response_handler_action.h
  86. omaha_response_handler_action_unittest.cc
  87. org.chromium.UpdateEngine.service
  88. payload_signer.cc
  89. payload_signer.h
  90. payload_signer_unittest.cc
  91. postinstall_runner_action.cc
  92. postinstall_runner_action.h
  93. postinstall_runner_action_unittest.cc
  94. prefs.cc
  95. prefs.h
  96. prefs_interface.h
  97. prefs_mock.h
  98. prefs_unittest.cc
  99. SConstruct
  100. set_bootable_flag_action.cc
  101. set_bootable_flag_action.h
  102. set_bootable_flag_action_unittest.cc
  103. setup_dev_packages
  104. simple_key_value_store.cc
  105. simple_key_value_store.h
  106. simple_key_value_store_unittest.cc
  107. split_file_writer.cc
  108. split_file_writer.h
  109. split_file_writer_unittest.cc
  110. subprocess.cc
  111. subprocess.h
  112. subprocess_unittest.cc
  113. tarjan.cc
  114. tarjan.h
  115. tarjan_unittest.cc
  116. test_http_server.cc
  117. test_http_server.py
  118. test_utils.cc
  119. test_utils.h
  120. testrunner.cc
  121. topological_sort.cc
  122. topological_sort.h
  123. topological_sort_unittest.cc
  124. unittest_key.pem
  125. update_attempter.cc
  126. update_attempter.h
  127. update_attempter_mock.h
  128. update_attempter_unittest.cc
  129. update_check_scheduler.cc
  130. update_check_scheduler.h
  131. update_check_scheduler_unittest.cc
  132. update_engine.xml
  133. update_engine_client.cc
  134. update_metadata.proto
  135. UpdateEngine.conf
  136. utils.cc
  137. utils.h
  138. utils_unittest.cc
  139. WATCHLISTS
  140. zip_unittest.cc