login_manager: Fix X server VT-switching regression.

The XServerRunner code added by 9009cb84 left SIGUSR1
blocked in the forked process that it uses to exec the X
server. This broke X's VT-switching code (e.g. Ctrl-Alt-F2),
which interestingly depends on SIGUSR1 (see
kbdLinuxVTSignalHandler() in hw/dmx/input/lnx-keyboard.c).

Also simplify some ugly code in XServerRunner and add an
explanation of how it works to its header.

BUG=chromium:380713
TEST=manually checked that ctrl-alt-f2 works again in dev
     mode and updated unit tests to check that no signals
     are blocked

Change-Id: Ib8c0b0552b1d5421cdea51fe782f845698ade7ae
Reviewed-on: https://chromium-review.googlesource.com/202591
Tested-by: Daniel Erat <derat@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Daniel Erat <derat@chromium.org>
3 files changed
tree: 0f9c9a9641aa0997e7e87752b46a6cdf3385c0db
  1. init/
  2. COMMIT-QUEUE.ini
  3. LICENSE
  4. Makefile
  5. OWNERS
  6. PRESUBMIT.cfg
  7. SessionManager.conf
  8. WATCHLISTS
  9. browser_job.cc
  10. browser_job.h
  11. browser_job_unittest.cc
  12. child_exit_handler.cc
  13. child_exit_handler.h
  14. child_exit_handler_unittest.cc
  15. child_job.cc
  16. child_job.h
  17. chrome_dev.conf
  18. chrome_setup.cc
  19. chrome_setup.h
  20. chromium_command_builder.cc
  21. chromium_command_builder.h
  22. chromium_command_builder_unittest.cc
  23. common.mk
  24. dbus_error_types.h
  25. dbus_signal_emitter.cc
  26. dbus_signal_emitter.h
  27. default_proxy
  28. device_local_account_policy_service.cc
  29. device_local_account_policy_service.h
  30. device_local_account_policy_service_unittest.cc
  31. device_policy_service.cc
  32. device_policy_service.h
  33. device_policy_service_unittest.cc
  34. fake_browser_job.cc
  35. fake_browser_job.h
  36. fake_child_process.cc
  37. fake_child_process.h
  38. fake_generated_key_handler.cc
  39. fake_generated_key_handler.h
  40. fake_generator_job.cc
  41. fake_generator_job.h
  42. file_checker.cc
  43. file_checker.h
  44. generator_job.cc
  45. generator_job.h
  46. inherit-review-settings-ok
  47. job_manager.h
  48. key_generator.cc
  49. key_generator.h
  50. key_generator_unittest.cc
  51. keygen.cc
  52. keygen_worker.cc
  53. keygen_worker.h
  54. liveness_checker.h
  55. liveness_checker_impl.cc
  56. liveness_checker_impl.h
  57. liveness_checker_impl_unittest.cc
  58. login_metrics.cc
  59. login_metrics.h
  60. login_metrics_unittest.cc
  61. matchers.h
  62. mock_constructors.cc
  63. mock_dbus_signal_emitter.h
  64. mock_device_policy_service.h
  65. mock_file_checker.h
  66. mock_key_generator.h
  67. mock_liveness_checker.h
  68. mock_metrics.h
  69. mock_mitigator.h
  70. mock_nss_util.cc
  71. mock_nss_util.h
  72. mock_object_proxy.h
  73. mock_policy_key.h
  74. mock_policy_service.h
  75. mock_policy_store.h
  76. mock_process_manager_service.h
  77. mock_server.key
  78. mock_server.pem
  79. mock_session_manager.h
  80. mock_system_utils.cc
  81. mock_system_utils.h
  82. mock_user_policy_service_factory.h
  83. nss_util.cc
  84. nss_util.h
  85. nss_util_unittest.cc
  86. org.chromium.SessionManagerInterface.xml
  87. owner_key_loss_mitigator.cc
  88. owner_key_loss_mitigator.h
  89. policy_key.cc
  90. policy_key.h
  91. policy_key_unittest.cc
  92. policy_service.cc
  93. policy_service.h
  94. policy_service_unittest.cc
  95. policy_store.cc
  96. policy_store.h
  97. policy_store_unittest.cc
  98. process_manager_service_interface.h
  99. regen_mitigator.cc
  100. regen_mitigator.h
  101. regen_mitigator_unittest.cc
  102. server_backed_state_key_generator.cc
  103. server_backed_state_key_generator.h
  104. server_backed_state_key_generator_unittest.cc
  105. session_manager_dbus_adaptor.cc
  106. session_manager_dbus_adaptor.h
  107. session_manager_impl.cc
  108. session_manager_impl.h
  109. session_manager_impl_unittest.cc
  110. session_manager_interface.h
  111. session_manager_main.cc
  112. session_manager_process_unittest.cc
  113. session_manager_service.cc
  114. session_manager_service.h
  115. session_manager_setup.sh
  116. session_manager_testrunner.cc
  117. stub_upstart_signal_emitter.h
  118. system_utils.h
  119. system_utils_impl.cc
  120. system_utils_impl.h
  121. system_utils_unittest.cc
  122. termination_handler.cc
  123. termination_handler.h
  124. termination_handler_unittest.cc
  125. upstart_signal_emitter.cc
  126. upstart_signal_emitter.h
  127. user_policy_service.cc
  128. user_policy_service.h
  129. user_policy_service_factory.cc
  130. user_policy_service_factory.h
  131. user_policy_service_unittest.cc
  132. util.cc
  133. util.h
  134. x_server_runner.cc
  135. x_server_runner.h
  136. x_server_runner_unittest.cc