passenger 2.1.2 → 2.1.3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of passenger might be problematic. Click here for more details.

Files changed (244) hide show
  1. data/Rakefile +7 -5
  2. data/doc/Architectural overview.html +729 -1
  3. data/doc/Architectural overview.txt +0 -5
  4. data/doc/Security of user switching support.html +605 -1
  5. data/doc/Users guide.html +110 -106
  6. data/doc/Users guide.txt +49 -0
  7. data/doc/cxxapi/ApplicationPoolServer_8h-source.html +400 -372
  8. data/doc/cxxapi/ApplicationPool_8h-source.html +1 -1
  9. data/doc/cxxapi/Application_8h-source.html +1 -1
  10. data/doc/cxxapi/Bucket_8h-source.html +1 -1
  11. data/doc/cxxapi/CachedFileStat_8h-source.html +56 -65
  12. data/doc/cxxapi/Configuration_8h-source.html +40 -32
  13. data/doc/cxxapi/DirectoryMapper_8h-source.html +1 -1
  14. data/doc/cxxapi/DummySpawnManager_8h-source.html +1 -1
  15. data/doc/cxxapi/Exceptions_8h-source.html +1 -1
  16. data/doc/cxxapi/FileChecker_8h-source.html +29 -30
  17. data/doc/cxxapi/Hooks_8h-source.html +1 -1
  18. data/doc/cxxapi/Logging_8h-source.html +1 -1
  19. data/doc/cxxapi/MessageChannel_8h-source.html +1 -1
  20. data/doc/cxxapi/PoolOptions_8h-source.html +1 -1
  21. data/doc/cxxapi/SpawnManager_8h-source.html +225 -219
  22. data/doc/cxxapi/StandardApplicationPool_8h-source.html +451 -445
  23. data/doc/cxxapi/SystemTime_8h-source.html +1 -1
  24. data/doc/cxxapi/Utils_8h-source.html +201 -140
  25. data/doc/cxxapi/annotated.html +2 -2
  26. data/doc/cxxapi/classClient-members.html +1 -1
  27. data/doc/cxxapi/classClient.html +1 -1
  28. data/doc/cxxapi/classHooks-members.html +1 -1
  29. data/doc/cxxapi/classHooks.html +1 -1
  30. data/doc/cxxapi/classPassenger_1_1Application-members.html +1 -1
  31. data/doc/cxxapi/classPassenger_1_1Application.html +1 -1
  32. data/doc/cxxapi/classPassenger_1_1ApplicationPool-members.html +1 -1
  33. data/doc/cxxapi/classPassenger_1_1ApplicationPool.html +1 -1
  34. data/doc/cxxapi/classPassenger_1_1ApplicationPoolServer-members.html +1 -1
  35. data/doc/cxxapi/classPassenger_1_1ApplicationPoolServer.html +1 -1
  36. data/doc/cxxapi/classPassenger_1_1ApplicationPool__inherit__graph.png +0 -0
  37. data/doc/cxxapi/classPassenger_1_1Application_1_1Session-members.html +1 -1
  38. data/doc/cxxapi/classPassenger_1_1Application_1_1Session.html +1 -1
  39. data/doc/cxxapi/{classPassenger_1_1TempFile-members.html → classPassenger_1_1BufferedUpload-members.html} +5 -5
  40. data/doc/cxxapi/{classPassenger_1_1TempFile.html → classPassenger_1_1BufferedUpload.html} +33 -43
  41. data/doc/cxxapi/classPassenger_1_1BusyException-members.html +1 -1
  42. data/doc/cxxapi/classPassenger_1_1BusyException.html +1 -1
  43. data/doc/cxxapi/classPassenger_1_1ConfigurationException-members.html +1 -1
  44. data/doc/cxxapi/classPassenger_1_1ConfigurationException.html +1 -1
  45. data/doc/cxxapi/classPassenger_1_1DirectoryMapper-members.html +1 -1
  46. data/doc/cxxapi/classPassenger_1_1DirectoryMapper.html +1 -1
  47. data/doc/cxxapi/classPassenger_1_1DummySpawnManager-members.html +1 -1
  48. data/doc/cxxapi/classPassenger_1_1DummySpawnManager.html +1 -1
  49. data/doc/cxxapi/classPassenger_1_1FileChecker-members.html +1 -1
  50. data/doc/cxxapi/classPassenger_1_1FileChecker.html +2 -2
  51. data/doc/cxxapi/classPassenger_1_1FileNotFoundException-members.html +1 -1
  52. data/doc/cxxapi/classPassenger_1_1FileNotFoundException.html +1 -1
  53. data/doc/cxxapi/classPassenger_1_1FileNotFoundException__inherit__graph.png +0 -0
  54. data/doc/cxxapi/classPassenger_1_1FileSystemException-members.html +1 -1
  55. data/doc/cxxapi/classPassenger_1_1FileSystemException.html +1 -1
  56. data/doc/cxxapi/classPassenger_1_1FileSystemException__inherit__graph.png +0 -0
  57. data/doc/cxxapi/classPassenger_1_1IOException-members.html +1 -1
  58. data/doc/cxxapi/classPassenger_1_1IOException.html +1 -1
  59. data/doc/cxxapi/classPassenger_1_1IOException__inherit__graph.png +0 -0
  60. data/doc/cxxapi/classPassenger_1_1MessageChannel-members.html +1 -1
  61. data/doc/cxxapi/classPassenger_1_1MessageChannel.html +1 -1
  62. data/doc/cxxapi/classPassenger_1_1RuntimeException-members.html +1 -1
  63. data/doc/cxxapi/classPassenger_1_1RuntimeException.html +1 -1
  64. data/doc/cxxapi/classPassenger_1_1SpawnException-members.html +1 -1
  65. data/doc/cxxapi/classPassenger_1_1SpawnException.html +1 -1
  66. data/doc/cxxapi/classPassenger_1_1SpawnManager-members.html +1 -1
  67. data/doc/cxxapi/classPassenger_1_1SpawnManager.html +1 -1
  68. data/doc/cxxapi/classPassenger_1_1StandardApplicationPool-members.html +1 -1
  69. data/doc/cxxapi/classPassenger_1_1StandardApplicationPool.html +1 -1
  70. data/doc/cxxapi/classPassenger_1_1StandardApplicationPool__inherit__graph.png +0 -0
  71. data/doc/cxxapi/classPassenger_1_1SystemException-members.html +1 -1
  72. data/doc/cxxapi/classPassenger_1_1SystemException.html +1 -1
  73. data/doc/cxxapi/classPassenger_1_1SystemException__inherit__graph.png +0 -0
  74. data/doc/cxxapi/classPassenger_1_1SystemTime-members.html +1 -1
  75. data/doc/cxxapi/classPassenger_1_1SystemTime.html +1 -1
  76. data/doc/cxxapi/definitions_8h-source.html +1 -1
  77. data/doc/cxxapi/files.html +1 -1
  78. data/doc/cxxapi/functions.html +12 -11
  79. data/doc/cxxapi/functions_func.html +9 -7
  80. data/doc/cxxapi/functions_type.html +1 -1
  81. data/doc/cxxapi/functions_vars.html +2 -4
  82. data/doc/cxxapi/graph_legend.html +1 -1
  83. data/doc/cxxapi/graph_legend.png +0 -0
  84. data/doc/cxxapi/group__Configuration.html +3 -3
  85. data/doc/cxxapi/group__Configuration.png +0 -0
  86. data/doc/cxxapi/group__Core.html +1 -1
  87. data/doc/cxxapi/group__Core.png +0 -0
  88. data/doc/cxxapi/group__Exceptions.html +1 -1
  89. data/doc/cxxapi/group__Hooks.html +1 -1
  90. data/doc/cxxapi/group__Hooks.png +0 -0
  91. data/doc/cxxapi/group__Support.html +33 -16
  92. data/doc/cxxapi/hierarchy.html +2 -2
  93. data/doc/cxxapi/inherit__graph__0.png +0 -0
  94. data/doc/cxxapi/inherit__graph__1.png +0 -0
  95. data/doc/cxxapi/inherit__graph__10.map +1 -1
  96. data/doc/cxxapi/inherit__graph__10.md5 +1 -1
  97. data/doc/cxxapi/inherit__graph__10.png +0 -0
  98. data/doc/cxxapi/inherit__graph__11.map +1 -1
  99. data/doc/cxxapi/inherit__graph__11.md5 +1 -1
  100. data/doc/cxxapi/inherit__graph__11.png +0 -0
  101. data/doc/cxxapi/inherit__graph__12.map +1 -2
  102. data/doc/cxxapi/inherit__graph__12.md5 +1 -1
  103. data/doc/cxxapi/inherit__graph__12.png +0 -0
  104. data/doc/cxxapi/inherit__graph__13.map +2 -1
  105. data/doc/cxxapi/inherit__graph__13.md5 +1 -1
  106. data/doc/cxxapi/inherit__graph__13.png +0 -0
  107. data/doc/cxxapi/inherit__graph__14.map +1 -1
  108. data/doc/cxxapi/inherit__graph__14.md5 +1 -1
  109. data/doc/cxxapi/inherit__graph__14.png +0 -0
  110. data/doc/cxxapi/inherit__graph__15.map +1 -1
  111. data/doc/cxxapi/inherit__graph__15.md5 +1 -1
  112. data/doc/cxxapi/inherit__graph__15.png +0 -0
  113. data/doc/cxxapi/inherit__graph__16.map +1 -1
  114. data/doc/cxxapi/inherit__graph__16.md5 +1 -1
  115. data/doc/cxxapi/inherit__graph__16.png +0 -0
  116. data/doc/cxxapi/inherit__graph__17.map +1 -1
  117. data/doc/cxxapi/inherit__graph__17.md5 +1 -1
  118. data/doc/cxxapi/inherit__graph__17.png +0 -0
  119. data/doc/cxxapi/inherit__graph__18.map +1 -1
  120. data/doc/cxxapi/inherit__graph__18.md5 +1 -1
  121. data/doc/cxxapi/inherit__graph__18.png +0 -0
  122. data/doc/cxxapi/inherit__graph__19.map +1 -2
  123. data/doc/cxxapi/inherit__graph__19.md5 +1 -1
  124. data/doc/cxxapi/inherit__graph__19.png +0 -0
  125. data/doc/cxxapi/inherit__graph__2.png +0 -0
  126. data/doc/cxxapi/inherit__graph__20.map +2 -1
  127. data/doc/cxxapi/inherit__graph__20.md5 +1 -1
  128. data/doc/cxxapi/inherit__graph__20.png +0 -0
  129. data/doc/cxxapi/inherit__graph__21.map +1 -1
  130. data/doc/cxxapi/inherit__graph__21.md5 +1 -1
  131. data/doc/cxxapi/inherit__graph__21.png +0 -0
  132. data/doc/cxxapi/inherit__graph__3.png +0 -0
  133. data/doc/cxxapi/inherit__graph__4.png +0 -0
  134. data/doc/cxxapi/inherit__graph__5.png +0 -0
  135. data/doc/cxxapi/inherit__graph__6.png +0 -0
  136. data/doc/cxxapi/inherit__graph__7.map +1 -1
  137. data/doc/cxxapi/inherit__graph__7.md5 +1 -1
  138. data/doc/cxxapi/inherit__graph__7.png +0 -0
  139. data/doc/cxxapi/inherit__graph__8.map +1 -1
  140. data/doc/cxxapi/inherit__graph__8.md5 +1 -1
  141. data/doc/cxxapi/inherit__graph__8.png +0 -0
  142. data/doc/cxxapi/inherit__graph__9.map +1 -1
  143. data/doc/cxxapi/inherit__graph__9.md5 +1 -1
  144. data/doc/cxxapi/inherit__graph__9.png +0 -0
  145. data/doc/cxxapi/inherits.html +18 -18
  146. data/doc/cxxapi/main.html +1 -1
  147. data/doc/cxxapi/modules.html +1 -1
  148. data/doc/cxxapi/structPassenger_1_1AnythingToString-members.html +1 -1
  149. data/doc/cxxapi/structPassenger_1_1AnythingToString.html +1 -1
  150. data/doc/cxxapi/structPassenger_1_1AnythingToString_3_01vector_3_01string_01_4_01_4-members.html +1 -1
  151. data/doc/cxxapi/structPassenger_1_1AnythingToString_3_01vector_3_01string_01_4_01_4.html +1 -1
  152. data/doc/cxxapi/structPassenger_1_1PoolOptions-members.html +1 -1
  153. data/doc/cxxapi/structPassenger_1_1PoolOptions.html +1 -1
  154. data/doc/cxxapi/tree.html +4 -4
  155. data/doc/rdoc/classes/ConditionVariable.html +58 -58
  156. data/doc/rdoc/classes/Exception.html +11 -11
  157. data/doc/rdoc/classes/GC.html +4 -4
  158. data/doc/rdoc/classes/IO.html +14 -14
  159. data/doc/rdoc/classes/PhusionPassenger.html +11 -11
  160. data/doc/rdoc/classes/PhusionPassenger/AdminTools.html +1 -1
  161. data/doc/rdoc/classes/PhusionPassenger/AdminTools/ControlProcess.html +40 -39
  162. data/doc/rdoc/classes/PhusionPassenger/Application.html +14 -14
  163. data/doc/rdoc/classes/PhusionPassenger/HTMLTemplate.html +12 -12
  164. data/doc/rdoc/classes/PhusionPassenger/Railz.html +1 -1
  165. data/doc/rdoc/classes/PhusionPassenger/Utils.html +15 -8
  166. data/doc/rdoc/classes/PlatformInfo.html +257 -253
  167. data/doc/rdoc/classes/RakeExtensions.html +2 -2
  168. data/doc/rdoc/classes/Signal.html +26 -26
  169. data/doc/rdoc/created.rid +1 -1
  170. data/doc/rdoc/files/DEVELOPERS_TXT.html +1 -1
  171. data/doc/rdoc/files/README.html +1 -1
  172. data/doc/rdoc/files/ext/phusion_passenger/native_support_c.html +1 -1
  173. data/doc/rdoc/files/lib/phusion_passenger/abstract_request_handler_rb.html +1 -1
  174. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_collection_rb.html +1 -1
  175. data/doc/rdoc/files/lib/phusion_passenger/abstract_server_rb.html +1 -1
  176. data/doc/rdoc/files/lib/phusion_passenger/admin_tools/control_process_rb.html +1 -1
  177. data/doc/rdoc/files/lib/phusion_passenger/admin_tools_rb.html +1 -1
  178. data/doc/rdoc/files/lib/phusion_passenger/application_rb.html +1 -1
  179. data/doc/rdoc/files/lib/phusion_passenger/console_text_template_rb.html +1 -1
  180. data/doc/rdoc/files/lib/phusion_passenger/constants_rb.html +1 -1
  181. data/doc/rdoc/files/lib/phusion_passenger/dependencies_rb.html +1 -1
  182. data/doc/rdoc/files/lib/phusion_passenger/events_rb.html +1 -1
  183. data/doc/rdoc/files/lib/phusion_passenger/exceptions_rb.html +1 -1
  184. data/doc/rdoc/files/lib/phusion_passenger/html_template_rb.html +1 -1
  185. data/doc/rdoc/files/lib/phusion_passenger/message_channel_rb.html +1 -1
  186. data/doc/rdoc/files/lib/phusion_passenger/platform_info_rb.html +1 -1
  187. data/doc/rdoc/files/lib/phusion_passenger/rack/application_spawner_rb.html +1 -1
  188. data/doc/rdoc/files/lib/phusion_passenger/rack/request_handler_rb.html +1 -1
  189. data/doc/rdoc/files/lib/phusion_passenger/railz/application_spawner_rb.html +1 -1
  190. data/doc/rdoc/files/lib/phusion_passenger/railz/cgi_fixed_rb.html +1 -1
  191. data/doc/rdoc/files/lib/phusion_passenger/railz/framework_spawner_rb.html +1 -1
  192. data/doc/rdoc/files/lib/phusion_passenger/railz/request_handler_rb.html +1 -1
  193. data/doc/rdoc/files/lib/phusion_passenger/simple_benchmarking_rb.html +1 -1
  194. data/doc/rdoc/files/lib/phusion_passenger/spawn_manager_rb.html +1 -1
  195. data/doc/rdoc/files/lib/phusion_passenger/utils_rb.html +9 -9
  196. data/doc/rdoc/files/lib/phusion_passenger/wsgi/application_spawner_rb.html +1 -1
  197. data/doc/rdoc/files/{lib → misc}/rake/extensions_rb.html +2 -2
  198. data/doc/rdoc/fr_file_index.html +1 -1
  199. data/doc/rdoc/fr_method_index.html +22 -22
  200. data/ext/apache2/ApplicationPoolServer.h +43 -15
  201. data/ext/apache2/ApplicationPoolServerExecutable.cpp +27 -52
  202. data/ext/apache2/CachedFileStat.h +7 -16
  203. data/ext/apache2/Configuration.h +9 -1
  204. data/ext/apache2/FileChecker.h +4 -5
  205. data/ext/apache2/Hooks.cpp +20 -22
  206. data/ext/apache2/SpawnManager.h +6 -0
  207. data/ext/apache2/StandardApplicationPool.h +6 -0
  208. data/ext/apache2/Utils.cpp +174 -16
  209. data/ext/apache2/Utils.h +99 -38
  210. data/ext/boost/cstdint.hpp +2 -1
  211. data/ext/oxt/system_calls.cpp +20 -2
  212. data/ext/oxt/system_calls.hpp +2 -0
  213. data/lib/phusion_passenger/abstract_request_handler.rb +5 -1
  214. data/lib/phusion_passenger/admin_tools.rb +1 -1
  215. data/lib/phusion_passenger/admin_tools/control_process.rb +2 -1
  216. data/lib/phusion_passenger/dependencies.rb +7 -4
  217. data/lib/phusion_passenger/platform_info.rb +8 -2
  218. data/lib/phusion_passenger/rack/application_spawner.rb +1 -1
  219. data/lib/phusion_passenger/templates/version_not_found.html.erb +9 -0
  220. data/lib/phusion_passenger/utils.rb +13 -6
  221. data/lib/phusion_passenger/wsgi/application_spawner.rb +1 -1
  222. data/{lib → misc}/rake/cplusplus.rb +0 -0
  223. data/{lib → misc}/rake/extensions.rb +0 -0
  224. data/{lib → misc}/rake/gempackagetask.rb +0 -0
  225. data/{lib → misc}/rake/packagetask.rb +0 -0
  226. data/{lib → misc}/rake/rdoctask.rb +0 -0
  227. data/misc/render_error_pages.rb +6 -5
  228. data/test/CxxTestMain.cpp +109 -7
  229. data/test/UtilsTest.cpp +61 -51
  230. data/test/config.yml.example +6 -2
  231. data/test/integration_tests.rb +4 -0
  232. data/test/ruby/abstract_request_handler_spec.rb +9 -3
  233. data/test/ruby/rack/application_spawner_spec.rb +3 -2
  234. data/test/ruby/rails/application_spawner_spec.rb +15 -4
  235. data/test/ruby/rails/framework_spawner_spec.rb +4 -2
  236. data/test/ruby/rails/spawner_error_handling_spec.rb +4 -4
  237. data/test/ruby/spawn_manager_spec.rb +22 -9
  238. data/test/ruby/utils_spec.rb +18 -12
  239. data/test/ruby/wsgi/application_spawner_spec.rb +16 -7
  240. data/test/stub/apache2/httpd.conf.erb +1 -0
  241. data/test/stub/wsgi/passenger_wsgi.pyc +0 -0
  242. metadata +1064 -1090
  243. data/doc/Users guide Apache.html +0 -3127
  244. data/doc/Users guide Nginx.html +0 -1458
@@ -97,7 +97,7 @@
97
97
  <a name="l00081"></a>00081
98
98
  <a name="l00082"></a>00082 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_SYSTEM_TIME_H_ */</span>
99
99
  </pre></div></div>
100
- <hr size="1"><address style="text-align: right;"><small>Generated on Fri Mar 13 19:24:32 2009 for Passenger by&nbsp;
100
+ <hr size="1"><address style="text-align: right;"><small>Generated on Tue Mar 31 14:00:28 2009 for Passenger by&nbsp;
101
101
  <a href="http://www.doxygen.org/index.html">
102
102
  <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
103
103
  </body>
@@ -235,152 +235,213 @@
235
235
  <a name="l00219"></a>00219 <span class="keywordtype">string</span> <a class="code" href="group__Support.html#ge74addedf73782a1eb1f6dd48d6fce06" title="Escape the given raw string into an XML value.">escapeForXml</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &amp;input);
236
236
  <a name="l00220"></a>00220 <span class="comment"></span>
237
237
  <a name="l00221"></a>00221 <span class="comment">/**</span>
238
- <a name="l00222"></a>00222 <span class="comment"> * Return the path name for the directory in which temporary files are</span>
239
- <a name="l00223"></a>00223 <span class="comment"> * to be stored.</span>
240
- <a name="l00224"></a>00224 <span class="comment"> *</span>
241
- <a name="l00225"></a>00225 <span class="comment"> * @ensure result != NULL</span>
242
- <a name="l00226"></a>00226 <span class="comment"> * @ingroup Support</span>
238
+ <a name="l00222"></a>00222 <span class="comment"> * Given a username that's supposed to be the "lowest user" in the user switching mechanism,</span>
239
+ <a name="l00223"></a>00223 <span class="comment"> * checks whether this username exists. If so, this users's UID and GID will be stored into</span>
240
+ <a name="l00224"></a>00224 <span class="comment"> * the arguments of the same names. If not, &lt;em&gt;uid&lt;/em&gt; and &lt;em&gt;gid&lt;/em&gt; will be set to</span>
241
+ <a name="l00225"></a>00225 <span class="comment"> * the UID and GID of the "nobody" user. If that user doesn't exist either, then &lt;em&gt;uid&lt;/em&gt;</span>
242
+ <a name="l00226"></a>00226 <span class="comment"> * and &lt;em&gt;gid&lt;/em&gt; will be set to -1.</span>
243
243
  <a name="l00227"></a>00227 <span class="comment"> */</span>
244
- <a name="l00228"></a>00228 <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__Support.html#ga073519b32c6dd784125c01fd6588b8e" title="Return the path name for the directory in which temporary files are to be stored...">getTempDir</a>();
244
+ <a name="l00228"></a>00228 <span class="keywordtype">void</span> determineLowestUserAndGroup(<span class="keyword">const</span> <span class="keywordtype">string</span> &amp;user, uid_t &amp;uid, gid_t &amp;gid);
245
245
  <a name="l00229"></a>00229 <span class="comment"></span>
246
246
  <a name="l00230"></a>00230 <span class="comment">/**</span>
247
- <a name="l00231"></a>00231 <span class="comment"> * Return the path name for the directory in which Phusion Passenger-specific</span>
248
- <a name="l00232"></a>00232 <span class="comment"> * temporary files are to be stored. This directory is unique for this instance</span>
249
- <a name="l00233"></a>00233 <span class="comment"> * of the web server in which Phusion Passenger is running.</span>
247
+ <a name="l00231"></a>00231 <span class="comment"> * Return the path name for the directory in which the system stores general</span>
248
+ <a name="l00232"></a>00232 <span class="comment"> * temporary files. This is usually "/tmp", but might be something else depending</span>
249
+ <a name="l00233"></a>00233 <span class="comment"> * on some environment variables.</span>
250
250
  <a name="l00234"></a>00234 <span class="comment"> *</span>
251
- <a name="l00235"></a>00235 <span class="comment"> * The result will be cached into the PHUSION_PASSENGER_TMP environment variable,</span>
252
- <a name="l00236"></a>00236 <span class="comment"> * which will be used for future calls to this function. To bypass this cache,</span>
253
- <a name="l00237"></a>00237 <span class="comment"> * set 'bypassCache' to true.</span>
254
- <a name="l00238"></a>00238 <span class="comment"> *</span>
255
- <a name="l00239"></a>00239 <span class="comment"> * @ensure !result.empty()</span>
256
- <a name="l00240"></a>00240 <span class="comment"> * @ingroup Support</span>
257
- <a name="l00241"></a>00241 <span class="comment"> */</span>
258
- <a name="l00242"></a>00242 <span class="keywordtype">string</span> <a class="code" href="group__Support.html#g5d3a5c5fe2944a898e425e30b53ac0ac" title="Return the path name for the directory in which Phusion Passenger-specific temporary...">getPassengerTempDir</a>(<span class="keywordtype">bool</span> bypassCache = <span class="keyword">false</span>);
259
- <a name="l00243"></a>00243
260
- <a name="l00244"></a>00244 <span class="comment">/* Create a temp folder for storing Phusion Passenger-specific temp files,</span>
261
- <a name="l00245"></a>00245 <span class="comment"> * such as temporarily buffered uploads, sockets for backend processes, etc.</span>
262
- <a name="l00246"></a>00246 <span class="comment"> * This call also sets the PHUSION_PASSENGER_TMP environment variable, which</span>
263
- <a name="l00247"></a>00247 <span class="comment"> * allows backend processes to find this temp folder.</span>
251
+ <a name="l00235"></a>00235 <span class="comment"> * @ensure result != NULL</span>
252
+ <a name="l00236"></a>00236 <span class="comment"> * @ingroup Support</span>
253
+ <a name="l00237"></a>00237 <span class="comment"> */</span>
254
+ <a name="l00238"></a>00238 <span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__Support.html#g68f4105c5a8e510520b5ea3eecb66213" title="Return the path name for the directory in which the system stores general temporary...">getSystemTempDir</a>();
255
+ <a name="l00239"></a>00239 <span class="comment"></span>
256
+ <a name="l00240"></a>00240 <span class="comment">/**</span>
257
+ <a name="l00241"></a>00241 <span class="comment"> * Return the path name for the directory in which Phusion Passenger-specific</span>
258
+ <a name="l00242"></a>00242 <span class="comment"> * temporary files are to be stored. This directory is unique for this instance</span>
259
+ <a name="l00243"></a>00243 <span class="comment"> * of the web server in which Phusion Passenger is running.</span>
260
+ <a name="l00244"></a>00244 <span class="comment"> *</span>
261
+ <a name="l00245"></a>00245 <span class="comment"> * If the environment variable PASSENGER_INSTANCE_TEMP_DIR is set, then that value</span>
262
+ <a name="l00246"></a>00246 <span class="comment"> * will be returned. If this environment variable is not set, then it will be set</span>
263
+ <a name="l00247"></a>00247 <span class="comment"> * with the return value.</span>
264
264
  <a name="l00248"></a>00248 <span class="comment"> *</span>
265
- <a name="l00249"></a>00249 <span class="comment"> * Does nothing if this folder already exists.</span>
266
- <a name="l00250"></a>00250 <span class="comment"> *</span>
267
- <a name="l00251"></a>00251 <span class="comment"> * @throws IOException Something went wrong.</span>
268
- <a name="l00252"></a>00252 <span class="comment"> * @throws SystemException Something went wrong.</span>
269
- <a name="l00253"></a>00253 <span class="comment"> */</span>
270
- <a name="l00254"></a>00254 <span class="keywordtype">void</span> createPassengerTempDir();
271
- <a name="l00255"></a>00255 <span class="comment"></span>
272
- <a name="l00256"></a>00256 <span class="comment">/**</span>
273
- <a name="l00257"></a>00257 <span class="comment"> * Create the directory at the given path, creating intermediate directories</span>
274
- <a name="l00258"></a>00258 <span class="comment"> * if necessary. The created directories' permissions are as specified by the</span>
275
- <a name="l00259"></a>00259 <span class="comment"> * 'mode' parameter.</span>
276
- <a name="l00260"></a>00260 <span class="comment"> *</span>
277
- <a name="l00261"></a>00261 <span class="comment"> * If 'path' already exists, then nothing will happen.</span>
278
- <a name="l00262"></a>00262 <span class="comment"> *</span>
279
- <a name="l00263"></a>00263 <span class="comment"> * @throws IOException Something went wrong.</span>
280
- <a name="l00264"></a>00264 <span class="comment"> * @throws SystemException Something went wrong.</span>
281
- <a name="l00265"></a>00265 <span class="comment"> */</span>
282
- <a name="l00266"></a>00266 <span class="keywordtype">void</span> makeDirTree(<span class="keyword">const</span> <span class="keywordtype">char</span> *path, <span class="keyword">const</span> <span class="keywordtype">char</span> *mode = <span class="stringliteral">"u=rwx,g=,o="</span>);
283
- <a name="l00267"></a>00267 <span class="comment"></span>
284
- <a name="l00268"></a>00268 <span class="comment">/**</span>
285
- <a name="l00269"></a>00269 <span class="comment"> * Remove an entire directory tree recursively.</span>
286
- <a name="l00270"></a>00270 <span class="comment"> *</span>
287
- <a name="l00271"></a>00271 <span class="comment"> * @throws SystemException Something went wrong.</span>
288
- <a name="l00272"></a>00272 <span class="comment"> */</span>
289
- <a name="l00273"></a>00273 <span class="keywordtype">void</span> removeDirTree(<span class="keyword">const</span> <span class="keywordtype">char</span> *path);
290
- <a name="l00274"></a>00274 <span class="comment"></span>
291
- <a name="l00275"></a>00275 <span class="comment">/**</span>
292
- <a name="l00276"></a>00276 <span class="comment"> * Check whether the specified directory is a valid Ruby on Rails</span>
293
- <a name="l00277"></a>00277 <span class="comment"> * application root directory.</span>
294
- <a name="l00278"></a>00278 <span class="comment"> *</span>
295
- <a name="l00279"></a>00279 <span class="comment"> * @param mstat A CachedMultiFileStat object, if you want to use cached statting.</span>
296
- <a name="l00280"></a>00280 <span class="comment"> * @param throttleRate A throttle rate for mstat. Only applicable if mstat is not NULL.</span>
297
- <a name="l00281"></a>00281 <span class="comment"> * @throws FileSystemException Unable to check because of a system error.</span>
298
- <a name="l00282"></a>00282 <span class="comment"> * @ingroup Support</span>
299
- <a name="l00283"></a>00283 <span class="comment"> */</span>
300
- <a name="l00284"></a>00284 <span class="keywordtype">bool</span> <a class="code" href="group__Support.html#g02c80bd02d38cea295f24250ca8e2502" title="Check whether the specified directory is a valid Ruby on Rails application root directory...">verifyRailsDir</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &amp;dir, CachedMultiFileStat *mstat = 0,
301
- <a name="l00285"></a>00285 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> throttleRate = 0);
302
- <a name="l00286"></a>00286 <span class="comment"></span>
303
- <a name="l00287"></a>00287 <span class="comment">/**</span>
304
- <a name="l00288"></a>00288 <span class="comment"> * Check whether the specified directory is a valid Rack application</span>
305
- <a name="l00289"></a>00289 <span class="comment"> * root directory.</span>
306
- <a name="l00290"></a>00290 <span class="comment"> *</span>
307
- <a name="l00291"></a>00291 <span class="comment"> * @param mstat A CachedMultiFileStat object, if you want to use cached statting.</span>
308
- <a name="l00292"></a>00292 <span class="comment"> * @param throttleRate A throttle rate for mstat. Only applicable if mstat is not NULL.</span>
309
- <a name="l00293"></a>00293 <span class="comment"> * @throws FileSystemException Unable to check because of a filesystem error.</span>
310
- <a name="l00294"></a>00294 <span class="comment"> * @ingroup Support</span>
311
- <a name="l00295"></a>00295 <span class="comment"> */</span>
312
- <a name="l00296"></a>00296 <span class="keywordtype">bool</span> <a class="code" href="group__Support.html#g7bb22ba786fa3c88dbbd9f84aaaed59a" title="Check whether the specified directory is a valid Rack application root directory...">verifyRackDir</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &amp;dir, CachedMultiFileStat *mstat = 0,
313
- <a name="l00297"></a>00297 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> throttleRate = 0);
314
- <a name="l00298"></a>00298 <span class="comment"></span>
315
- <a name="l00299"></a>00299 <span class="comment">/**</span>
316
- <a name="l00300"></a>00300 <span class="comment"> * Check whether the specified directory is a valid WSGI application</span>
317
- <a name="l00301"></a>00301 <span class="comment"> * root directory.</span>
318
- <a name="l00302"></a>00302 <span class="comment"> *</span>
319
- <a name="l00303"></a>00303 <span class="comment"> * @param mstat A CachedMultiFileStat object, if you want to use cached statting.</span>
320
- <a name="l00304"></a>00304 <span class="comment"> * @param throttleRate A throttle rate for mstat. Only applicable if mstat is not NULL.</span>
321
- <a name="l00305"></a>00305 <span class="comment"> * @throws FileSystemException Unable to check because of a filesystem error.</span>
322
- <a name="l00306"></a>00306 <span class="comment"> * @ingroup Support</span>
323
- <a name="l00307"></a>00307 <span class="comment"> */</span>
324
- <a name="l00308"></a>00308 <span class="keywordtype">bool</span> <a class="code" href="group__Support.html#g8bfea2692733dfd80703707a120bce86" title="Check whether the specified directory is a valid WSGI application root directory...">verifyWSGIDir</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &amp;dir, CachedMultiFileStat *mstat = 0,
325
- <a name="l00309"></a>00309 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> throttleRate = 0);
326
- <a name="l00310"></a>00310 <span class="comment"></span>
327
- <a name="l00311"></a>00311 <span class="comment">/**</span>
328
- <a name="l00312"></a>00312 <span class="comment"> * Represents a temporary file. The associated file is automatically</span>
329
- <a name="l00313"></a>00313 <span class="comment"> * deleted upon object destruction.</span>
330
- <a name="l00314"></a>00314 <span class="comment"> *</span>
331
- <a name="l00315"></a>00315 <span class="comment"> * @ingroup Support</span>
332
- <a name="l00316"></a>00316 <span class="comment"> */</span>
333
- <a name="l00317"></a><a class="code" href="classPassenger_1_1TempFile.html">00317</a> <span class="keyword">class </span><a class="code" href="classPassenger_1_1TempFile.html" title="Represents a temporary file.">TempFile</a> {
334
- <a name="l00318"></a>00318 <span class="keyword">public</span>:<span class="comment"></span>
335
- <a name="l00319"></a>00319 <span class="comment"> /** The filename. If this temp file is anonymous, then the filename is an empty string. */</span>
336
- <a name="l00320"></a><a class="code" href="classPassenger_1_1TempFile.html#5e3ad620abbd79a289e44057e241de6b">00320</a> <span class="keywordtype">string</span> <a class="code" href="classPassenger_1_1TempFile.html#5e3ad620abbd79a289e44057e241de6b" title="The filename.">filename</a>;<span class="comment"></span>
337
- <a name="l00321"></a>00321 <span class="comment"> /** The file handle. */</span>
338
- <a name="l00322"></a><a class="code" href="classPassenger_1_1TempFile.html#e78d0a63165ed1e5a083c1947db2ea14">00322</a> FILE *<a class="code" href="classPassenger_1_1TempFile.html#e78d0a63165ed1e5a083c1947db2ea14" title="The file handle.">handle</a>;
339
- <a name="l00323"></a>00323 <span class="comment"></span>
340
- <a name="l00324"></a>00324 <span class="comment"> /**</span>
341
- <a name="l00325"></a>00325 <span class="comment"> * Create an empty, temporary file, and open it for reading and writing.</span>
342
- <a name="l00326"></a>00326 <span class="comment"> *</span>
343
- <a name="l00327"></a>00327 <span class="comment"> * @param anonymous Set to true if this temp file should be unlinked</span>
344
- <a name="l00328"></a>00328 <span class="comment"> * immediately. Anonymous temp files are useful if one just wants</span>
345
- <a name="l00329"></a>00329 <span class="comment"> * a big not-in-memory buffer to work with.</span>
346
- <a name="l00330"></a>00330 <span class="comment"> * @throws SystemException Something went wrong.</span>
347
- <a name="l00331"></a>00331 <span class="comment"> */</span>
348
- <a name="l00332"></a><a class="code" href="classPassenger_1_1TempFile.html#64623aebacdfb78b63e43ad1f29673f1">00332</a> <a class="code" href="classPassenger_1_1TempFile.html#64623aebacdfb78b63e43ad1f29673f1" title="Create an empty, temporary file, and open it for reading and writing.">TempFile</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *identifier = <span class="stringliteral">"temp"</span>, <span class="keywordtype">bool</span> anonymous = <span class="keyword">true</span>) {
349
- <a name="l00333"></a>00333 <span class="keywordtype">char</span> templ[PATH_MAX];
350
- <a name="l00334"></a>00334 <span class="keywordtype">int</span> fd;
351
- <a name="l00335"></a>00335
352
- <a name="l00336"></a>00336 snprintf(templ, <span class="keyword">sizeof</span>(templ), <span class="stringliteral">"%s/%s.XXXXXX"</span>, <a class="code" href="group__Support.html#g5d3a5c5fe2944a898e425e30b53ac0ac" title="Return the path name for the directory in which Phusion Passenger-specific temporary...">getPassengerTempDir</a>().c_str(), identifier);
353
- <a name="l00337"></a>00337 templ[<span class="keyword">sizeof</span>(templ) - 1] = <span class="charliteral">'\0'</span>;
354
- <a name="l00338"></a>00338 fd = mkstemp(templ);
355
- <a name="l00339"></a>00339 <span class="keywordflow">if</span> (fd == -1) {
356
- <a name="l00340"></a>00340 <span class="keywordtype">char</span> message[1024];
357
- <a name="l00341"></a>00341 snprintf(message, <span class="keyword">sizeof</span>(message), <span class="stringliteral">"Cannot create a temporary file '%s'"</span>, templ);
358
- <a name="l00342"></a>00342 message[<span class="keyword">sizeof</span>(message) - 1] = <span class="charliteral">'\0'</span>;
359
- <a name="l00343"></a>00343 <span class="keywordflow">throw</span> <a class="code" href="classPassenger_1_1SystemException.html" title="Represents an error returned by a system call or a standard library call.">SystemException</a>(message, errno);
360
- <a name="l00344"></a>00344 }
361
- <a name="l00345"></a>00345 <span class="keywordflow">if</span> (anonymous) {
362
- <a name="l00346"></a>00346 fchmod(fd, 0000);
363
- <a name="l00347"></a>00347 unlink(templ);
364
- <a name="l00348"></a>00348 } <span class="keywordflow">else</span> {
365
- <a name="l00349"></a>00349 <a class="code" href="classPassenger_1_1TempFile.html#5e3ad620abbd79a289e44057e241de6b" title="The filename.">filename</a>.assign(templ);
366
- <a name="l00350"></a>00350 }
367
- <a name="l00351"></a>00351 <a class="code" href="classPassenger_1_1TempFile.html#e78d0a63165ed1e5a083c1947db2ea14" title="The file handle.">handle</a> = fdopen(fd, <span class="stringliteral">"w+"</span>);
368
- <a name="l00352"></a>00352 }
369
- <a name="l00353"></a>00353
370
- <a name="l00354"></a>00354 ~<a class="code" href="classPassenger_1_1TempFile.html" title="Represents a temporary file.">TempFile</a>() {
371
- <a name="l00355"></a>00355 fclose(<a class="code" href="classPassenger_1_1TempFile.html#e78d0a63165ed1e5a083c1947db2ea14" title="The file handle.">handle</a>);
372
- <a name="l00356"></a>00356 <span class="keywordflow">if</span> (!<a class="code" href="classPassenger_1_1TempFile.html#5e3ad620abbd79a289e44057e241de6b" title="The filename.">filename</a>.empty()) {
373
- <a name="l00357"></a>00357 unlink(<a class="code" href="classPassenger_1_1TempFile.html#5e3ad620abbd79a289e44057e241de6b" title="The filename.">filename</a>.c_str());
374
- <a name="l00358"></a>00358 }
375
- <a name="l00359"></a>00359 }
376
- <a name="l00360"></a>00360 };
377
- <a name="l00361"></a>00361
378
- <a name="l00362"></a>00362 } <span class="comment">// namespace Passenger</span>
379
- <a name="l00363"></a>00363
380
- <a name="l00364"></a>00364 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_UTILS_H_ */</span>
381
- <a name="l00365"></a>00365
265
+ <a name="l00249"></a>00249 <span class="comment"> * To bypass the usage of the PASSENGER_INSTANCE_TEMP_DIR environment variable,</span>
266
+ <a name="l00250"></a>00250 <span class="comment"> * set 'bypassCache' to true.</span>
267
+ <a name="l00251"></a>00251 <span class="comment"> *</span>
268
+ <a name="l00252"></a>00252 <span class="comment"> * @param bypassCache Whether PASSENGER_INSTANCE_TEMP_DIR should be bypassed.</span>
269
+ <a name="l00253"></a>00253 <span class="comment"> * @param systemTempDir The directory under which the Phusion Passenger-specific</span>
270
+ <a name="l00254"></a>00254 <span class="comment"> * temp directory should be located. If set to the empty string,</span>
271
+ <a name="l00255"></a>00255 <span class="comment"> * then the return value of getSystemTempDir() will be used.</span>
272
+ <a name="l00256"></a>00256 <span class="comment"> * @ensure !result.empty()</span>
273
+ <a name="l00257"></a>00257 <span class="comment"> * @ingroup Support</span>
274
+ <a name="l00258"></a>00258 <span class="comment"> */</span>
275
+ <a name="l00259"></a>00259 <span class="keywordtype">string</span> <a class="code" href="group__Support.html#g69deb6b299b45039dc24b60ad9175541" title="Return the path name for the directory in which Phusion Passenger-specific temporary...">getPassengerTempDir</a>(<span class="keywordtype">bool</span> bypassCache = <span class="keyword">false</span>, <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;systemTempDir = <span class="stringliteral">""</span>);
276
+ <a name="l00260"></a>00260
277
+ <a name="l00261"></a>00261 <span class="comment">/* Create a temp directory under &lt;em&gt;systemTempDir&lt;/em&gt;, for storing Phusion</span>
278
+ <a name="l00262"></a>00262 <span class="comment"> * Passenger-specific temp files, such as temporarily buffered uploads,</span>
279
+ <a name="l00263"></a>00263 <span class="comment"> * sockets for backend processes, etc. This call also sets the</span>
280
+ <a name="l00264"></a>00264 <span class="comment"> * PASSENGER_INSTANCE_TEMP_DIR environment variable, which allows subprocesses</span>
281
+ <a name="l00265"></a>00265 <span class="comment"> * to find this temp directory.</span>
282
+ <a name="l00266"></a>00266 <span class="comment"> *</span>
283
+ <a name="l00267"></a>00267 <span class="comment"> * The created temp directory will have several subdirectories:</span>
284
+ <a name="l00268"></a>00268 <span class="comment"> * - webserver_private - for storing the web server's buffered uploads.</span>
285
+ <a name="l00269"></a>00269 <span class="comment"> * - info - for storing files that allow external tools to query information</span>
286
+ <a name="l00270"></a>00270 <span class="comment"> * about a running Phusion Passenger instance.</span>
287
+ <a name="l00271"></a>00271 <span class="comment"> * - backends - for storing Unix sockets created by backend processes.</span>
288
+ <a name="l00272"></a>00272 <span class="comment"> * - var - for storing all other kinds of temp files that the backend processes</span>
289
+ <a name="l00273"></a>00273 <span class="comment"> * create.</span>
290
+ <a name="l00274"></a>00274 <span class="comment"> *</span>
291
+ <a name="l00275"></a>00275 <span class="comment"> * If a (sub)directory already exists, then it will not result in an error.</span>
292
+ <a name="l00276"></a>00276 <span class="comment"> *</span>
293
+ <a name="l00277"></a>00277 <span class="comment"> * The &lt;em&gt;userSwitching&lt;/em&gt; and &lt;em&gt;lowestUser&lt;/em&gt; arguments passed to</span>
294
+ <a name="l00278"></a>00278 <span class="comment"> * this method are used for determining the optimal permissions for the</span>
295
+ <a name="l00279"></a>00279 <span class="comment"> * (sub)directories. The permissions will be set as tightly as possible based</span>
296
+ <a name="l00280"></a>00280 <span class="comment"> * on the values. The &lt;em&gt;workerUid&lt;/em&gt; and &lt;em&gt;workerGid&lt;/em&gt; arguments</span>
297
+ <a name="l00281"></a>00281 <span class="comment"> * will be used for determining the owner of certain subdirectories.</span>
298
+ <a name="l00282"></a>00282 <span class="comment"> *</span>
299
+ <a name="l00283"></a>00283 <span class="comment"> * @note You should only call this method inside the web server's master</span>
300
+ <a name="l00284"></a>00284 <span class="comment"> * process. In case of Apache, this is the Apache control process,</span>
301
+ <a name="l00285"></a>00285 <span class="comment"> * the one that tends to run as root. This is because this function</span>
302
+ <a name="l00286"></a>00286 <span class="comment"> * will set directory permissions and owners/groups, which may require</span>
303
+ <a name="l00287"></a>00287 <span class="comment"> * root privileges.</span>
304
+ <a name="l00288"></a>00288 <span class="comment"> *</span>
305
+ <a name="l00289"></a>00289 <span class="comment"> * @param systemTempDir The directory under which the Phusion Passenger-specific</span>
306
+ <a name="l00290"></a>00290 <span class="comment"> * temp directory should be created. You should normally</span>
307
+ <a name="l00291"></a>00291 <span class="comment"> * specify the return value of getSystemTempDir().</span>
308
+ <a name="l00292"></a>00292 <span class="comment"> * @param userSwitching Whether user switching is turned on.</span>
309
+ <a name="l00293"></a>00293 <span class="comment"> * @param lowestUser The user that the spawn manager and the pool server will</span>
310
+ <a name="l00294"></a>00294 <span class="comment"> * run as, if user switching is turned off.</span>
311
+ <a name="l00295"></a>00295 <span class="comment"> * @param workerUid The UID that the web server's worker processes are running</span>
312
+ <a name="l00296"></a>00296 <span class="comment"> * as. On Apache, this is the UID that's associated with the</span>
313
+ <a name="l00297"></a>00297 <span class="comment"> * 'User' directive.</span>
314
+ <a name="l00298"></a>00298 <span class="comment"> * @param workerGid The GID that the web server's worker processes are running</span>
315
+ <a name="l00299"></a>00299 <span class="comment"> * as. On Apache, this is the GID that's associated with the</span>
316
+ <a name="l00300"></a>00300 <span class="comment"> * 'Group' directive.</span>
317
+ <a name="l00301"></a>00301 <span class="comment"> * @throws IOException Something went wrong.</span>
318
+ <a name="l00302"></a>00302 <span class="comment"> * @throws SystemException Something went wrong.</span>
319
+ <a name="l00303"></a>00303 <span class="comment"> * @throws FileSystemException Something went wrong.</span>
320
+ <a name="l00304"></a>00304 <span class="comment"> */</span>
321
+ <a name="l00305"></a>00305 <span class="keywordtype">void</span> createPassengerTempDir(<span class="keyword">const</span> <span class="keywordtype">string</span> &amp;systemTempDir, <span class="keywordtype">bool</span> userSwitching,
322
+ <a name="l00306"></a>00306 <span class="keyword">const</span> <span class="keywordtype">string</span> &amp;lowestUser,
323
+ <a name="l00307"></a>00307 uid_t workerUid, gid_t workerGid);
324
+ <a name="l00308"></a>00308 <span class="comment"></span>
325
+ <a name="l00309"></a>00309 <span class="comment">/**</span>
326
+ <a name="l00310"></a>00310 <span class="comment"> * Create the directory at the given path, creating intermediate directories</span>
327
+ <a name="l00311"></a>00311 <span class="comment"> * if necessary. The created directories' permissions are as specified by the</span>
328
+ <a name="l00312"></a>00312 <span class="comment"> * 'mode' parameter. You can specify this directory's owner and group through</span>
329
+ <a name="l00313"></a>00313 <span class="comment"> * the 'owner' and 'group' parameters. A value of -1 for 'owner' or 'group'</span>
330
+ <a name="l00314"></a>00314 <span class="comment"> * means that the owner/group should not be changed.</span>
331
+ <a name="l00315"></a>00315 <span class="comment"> *</span>
332
+ <a name="l00316"></a>00316 <span class="comment"> * If 'path' already exists, then nothing will happen.</span>
333
+ <a name="l00317"></a>00317 <span class="comment"> *</span>
334
+ <a name="l00318"></a>00318 <span class="comment"> * @throws IOException Something went wrong.</span>
335
+ <a name="l00319"></a>00319 <span class="comment"> * @throws SystemException Something went wrong.</span>
336
+ <a name="l00320"></a>00320 <span class="comment"> * @throws FileSystemException Something went wrong.</span>
337
+ <a name="l00321"></a>00321 <span class="comment"> */</span>
338
+ <a name="l00322"></a>00322 <span class="keywordtype">void</span> makeDirTree(<span class="keyword">const</span> <span class="keywordtype">string</span> &amp;path, <span class="keyword">const</span> <span class="keywordtype">char</span> *mode = <span class="stringliteral">"u=rwx,g=,o="</span>, uid_t owner = -1, gid_t group = -1);
339
+ <a name="l00323"></a>00323 <span class="comment"></span>
340
+ <a name="l00324"></a>00324 <span class="comment">/**</span>
341
+ <a name="l00325"></a>00325 <span class="comment"> * Remove an entire directory tree recursively.</span>
342
+ <a name="l00326"></a>00326 <span class="comment"> *</span>
343
+ <a name="l00327"></a>00327 <span class="comment"> * @throws FileSystemException Something went wrong.</span>
344
+ <a name="l00328"></a>00328 <span class="comment"> */</span>
345
+ <a name="l00329"></a>00329 <span class="keywordtype">void</span> removeDirTree(<span class="keyword">const</span> <span class="keywordtype">string</span> &amp;path);
346
+ <a name="l00330"></a>00330 <span class="comment"></span>
347
+ <a name="l00331"></a>00331 <span class="comment">/**</span>
348
+ <a name="l00332"></a>00332 <span class="comment"> * Check whether the specified directory is a valid Ruby on Rails</span>
349
+ <a name="l00333"></a>00333 <span class="comment"> * application root directory.</span>
350
+ <a name="l00334"></a>00334 <span class="comment"> *</span>
351
+ <a name="l00335"></a>00335 <span class="comment"> * @param mstat A CachedMultiFileStat object, if you want to use cached statting.</span>
352
+ <a name="l00336"></a>00336 <span class="comment"> * @param throttleRate A throttle rate for mstat. Only applicable if mstat is not NULL.</span>
353
+ <a name="l00337"></a>00337 <span class="comment"> * @throws FileSystemException Unable to check because of a system error.</span>
354
+ <a name="l00338"></a>00338 <span class="comment"> * @ingroup Support</span>
355
+ <a name="l00339"></a>00339 <span class="comment"> */</span>
356
+ <a name="l00340"></a>00340 <span class="keywordtype">bool</span> <a class="code" href="group__Support.html#g02c80bd02d38cea295f24250ca8e2502" title="Check whether the specified directory is a valid Ruby on Rails application root directory...">verifyRailsDir</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &amp;dir, CachedMultiFileStat *mstat = 0,
357
+ <a name="l00341"></a>00341 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> throttleRate = 0);
358
+ <a name="l00342"></a>00342 <span class="comment"></span>
359
+ <a name="l00343"></a>00343 <span class="comment">/**</span>
360
+ <a name="l00344"></a>00344 <span class="comment"> * Check whether the specified directory is a valid Rack application</span>
361
+ <a name="l00345"></a>00345 <span class="comment"> * root directory.</span>
362
+ <a name="l00346"></a>00346 <span class="comment"> *</span>
363
+ <a name="l00347"></a>00347 <span class="comment"> * @param mstat A CachedMultiFileStat object, if you want to use cached statting.</span>
364
+ <a name="l00348"></a>00348 <span class="comment"> * @param throttleRate A throttle rate for mstat. Only applicable if mstat is not NULL.</span>
365
+ <a name="l00349"></a>00349 <span class="comment"> * @throws FileSystemException Unable to check because of a filesystem error.</span>
366
+ <a name="l00350"></a>00350 <span class="comment"> * @ingroup Support</span>
367
+ <a name="l00351"></a>00351 <span class="comment"> */</span>
368
+ <a name="l00352"></a>00352 <span class="keywordtype">bool</span> <a class="code" href="group__Support.html#g7bb22ba786fa3c88dbbd9f84aaaed59a" title="Check whether the specified directory is a valid Rack application root directory...">verifyRackDir</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &amp;dir, CachedMultiFileStat *mstat = 0,
369
+ <a name="l00353"></a>00353 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> throttleRate = 0);
370
+ <a name="l00354"></a>00354 <span class="comment"></span>
371
+ <a name="l00355"></a>00355 <span class="comment">/**</span>
372
+ <a name="l00356"></a>00356 <span class="comment"> * Check whether the specified directory is a valid WSGI application</span>
373
+ <a name="l00357"></a>00357 <span class="comment"> * root directory.</span>
374
+ <a name="l00358"></a>00358 <span class="comment"> *</span>
375
+ <a name="l00359"></a>00359 <span class="comment"> * @param mstat A CachedMultiFileStat object, if you want to use cached statting.</span>
376
+ <a name="l00360"></a>00360 <span class="comment"> * @param throttleRate A throttle rate for mstat. Only applicable if mstat is not NULL.</span>
377
+ <a name="l00361"></a>00361 <span class="comment"> * @throws FileSystemException Unable to check because of a filesystem error.</span>
378
+ <a name="l00362"></a>00362 <span class="comment"> * @ingroup Support</span>
379
+ <a name="l00363"></a>00363 <span class="comment"> */</span>
380
+ <a name="l00364"></a>00364 <span class="keywordtype">bool</span> <a class="code" href="group__Support.html#g8bfea2692733dfd80703707a120bce86" title="Check whether the specified directory is a valid WSGI application root directory...">verifyWSGIDir</a>(<span class="keyword">const</span> <span class="keywordtype">string</span> &amp;dir, CachedMultiFileStat *mstat = 0,
381
+ <a name="l00365"></a>00365 <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> throttleRate = 0);
382
+ <a name="l00366"></a>00366 <span class="comment"></span>
383
+ <a name="l00367"></a>00367 <span class="comment">/**</span>
384
+ <a name="l00368"></a>00368 <span class="comment"> * Represents a buffered upload file.</span>
385
+ <a name="l00369"></a>00369 <span class="comment"> *</span>
386
+ <a name="l00370"></a>00370 <span class="comment"> * @ingroup Support</span>
387
+ <a name="l00371"></a>00371 <span class="comment"> */</span>
388
+ <a name="l00372"></a><a class="code" href="classPassenger_1_1BufferedUpload.html">00372</a> <span class="keyword">class </span><a class="code" href="classPassenger_1_1BufferedUpload.html" title="Represents a buffered upload file.">BufferedUpload</a> {
389
+ <a name="l00373"></a>00373 <span class="keyword">public</span>:<span class="comment"></span>
390
+ <a name="l00374"></a>00374 <span class="comment"> /** The file handle. */</span>
391
+ <a name="l00375"></a><a class="code" href="classPassenger_1_1BufferedUpload.html#0a340f2d972ae791f56f893901109dac">00375</a> FILE *<a class="code" href="classPassenger_1_1BufferedUpload.html#0a340f2d972ae791f56f893901109dac" title="The file handle.">handle</a>;
392
+ <a name="l00376"></a>00376 <span class="comment"></span>
393
+ <a name="l00377"></a>00377 <span class="comment"> /**</span>
394
+ <a name="l00378"></a>00378 <span class="comment"> * Create an empty upload bufer file, and open it for reading and writing.</span>
395
+ <a name="l00379"></a>00379 <span class="comment"> *</span>
396
+ <a name="l00380"></a>00380 <span class="comment"> * @throws SystemException Something went wrong.</span>
397
+ <a name="l00381"></a>00381 <span class="comment"> */</span>
398
+ <a name="l00382"></a><a class="code" href="classPassenger_1_1BufferedUpload.html#b85f5986340242fd2389b81ce4304e6b">00382</a> <a class="code" href="classPassenger_1_1BufferedUpload.html#b85f5986340242fd2389b81ce4304e6b" title="Create an empty upload bufer file, and open it for reading and writing.">BufferedUpload</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *identifier = <span class="stringliteral">"temp"</span>) {
399
+ <a name="l00383"></a>00383 <span class="keywordtype">char</span> templ[PATH_MAX];
400
+ <a name="l00384"></a>00384 <span class="keywordtype">int</span> fd;
401
+ <a name="l00385"></a>00385
402
+ <a name="l00386"></a>00386 snprintf(templ, <span class="keyword">sizeof</span>(templ), <span class="stringliteral">"%s/%s.XXXXXX"</span>, <a class="code" href="classPassenger_1_1BufferedUpload.html#fab496fee959db6320d909069ca6c2b9" title="Returns the directory in which upload buffer files are stored.">getDir</a>().c_str(), identifier);
403
+ <a name="l00387"></a>00387 templ[<span class="keyword">sizeof</span>(templ) - 1] = <span class="charliteral">'\0'</span>;
404
+ <a name="l00388"></a>00388 fd = mkstemp(templ);
405
+ <a name="l00389"></a>00389 <span class="keywordflow">if</span> (fd == -1) {
406
+ <a name="l00390"></a>00390 <span class="keywordtype">char</span> message[1024];
407
+ <a name="l00391"></a>00391 <span class="keywordtype">int</span> e = errno;
408
+ <a name="l00392"></a>00392
409
+ <a name="l00393"></a>00393 snprintf(message, <span class="keyword">sizeof</span>(message), <span class="stringliteral">"Cannot create a temporary file '%s'"</span>, templ);
410
+ <a name="l00394"></a>00394 message[<span class="keyword">sizeof</span>(message) - 1] = <span class="charliteral">'\0'</span>;
411
+ <a name="l00395"></a>00395 <span class="keywordflow">throw</span> <a class="code" href="classPassenger_1_1SystemException.html" title="Represents an error returned by a system call or a standard library call.">SystemException</a>(message, e);
412
+ <a name="l00396"></a>00396 }
413
+ <a name="l00397"></a>00397
414
+ <a name="l00398"></a>00398 <span class="comment">/* We use a POSIX trick here: the file's permissions are set to "u=,g=,o="</span>
415
+ <a name="l00399"></a>00399 <span class="comment"> * and the file is deleted immediately from the filesystem, while we</span>
416
+ <a name="l00400"></a>00400 <span class="comment"> * keep its file handle open. The result is that no other processes</span>
417
+ <a name="l00401"></a>00401 <span class="comment"> * will be able to access this file's contents anymore, except us.</span>
418
+ <a name="l00402"></a>00402 <span class="comment"> * We now have an anonymous disk-backed buffer.</span>
419
+ <a name="l00403"></a>00403 <span class="comment"> */</span>
420
+ <a name="l00404"></a>00404 fchmod(fd, 0000);
421
+ <a name="l00405"></a>00405 unlink(templ);
422
+ <a name="l00406"></a>00406
423
+ <a name="l00407"></a>00407 <a class="code" href="classPassenger_1_1BufferedUpload.html#0a340f2d972ae791f56f893901109dac" title="The file handle.">handle</a> = fdopen(fd, <span class="stringliteral">"w+"</span>);
424
+ <a name="l00408"></a>00408 }
425
+ <a name="l00409"></a>00409
426
+ <a name="l00410"></a>00410 ~<a class="code" href="classPassenger_1_1BufferedUpload.html" title="Represents a buffered upload file.">BufferedUpload</a>() {
427
+ <a name="l00411"></a>00411 fclose(<a class="code" href="classPassenger_1_1BufferedUpload.html#0a340f2d972ae791f56f893901109dac" title="The file handle.">handle</a>);
428
+ <a name="l00412"></a>00412 }
429
+ <a name="l00413"></a>00413 <span class="comment"></span>
430
+ <a name="l00414"></a>00414 <span class="comment"> /**</span>
431
+ <a name="l00415"></a>00415 <span class="comment"> * Returns the directory in which upload buffer files are stored.</span>
432
+ <a name="l00416"></a>00416 <span class="comment"> * This is a subdirectory of the directory returned by getPassengerTempDir(). </span>
433
+ <a name="l00417"></a>00417 <span class="comment"> */</span>
434
+ <a name="l00418"></a><a class="code" href="classPassenger_1_1BufferedUpload.html#fab496fee959db6320d909069ca6c2b9">00418</a> <span class="keyword">static</span> <span class="keywordtype">string</span> <a class="code" href="classPassenger_1_1BufferedUpload.html#fab496fee959db6320d909069ca6c2b9" title="Returns the directory in which upload buffer files are stored.">getDir</a>() {
435
+ <a name="l00419"></a>00419 <span class="keywordflow">return</span> <a class="code" href="group__Support.html#g69deb6b299b45039dc24b60ad9175541" title="Return the path name for the directory in which Phusion Passenger-specific temporary...">getPassengerTempDir</a>() + <span class="stringliteral">"/webserver_private"</span>;
436
+ <a name="l00420"></a>00420 }
437
+ <a name="l00421"></a>00421 };
438
+ <a name="l00422"></a>00422
439
+ <a name="l00423"></a>00423 } <span class="comment">// namespace Passenger</span>
440
+ <a name="l00424"></a>00424
441
+ <a name="l00425"></a>00425 <span class="preprocessor">#endif </span><span class="comment">/* _PASSENGER_UTILS_H_ */</span>
442
+ <a name="l00426"></a>00426
382
443
  </pre></div></div>
383
- <hr size="1"><address style="text-align: right;"><small>Generated on Fri Mar 13 19:24:32 2009 for Passenger by&nbsp;
444
+ <hr size="1"><address style="text-align: right;"><small>Generated on Tue Mar 31 14:00:28 2009 for Passenger by&nbsp;
384
445
  <a href="http://www.doxygen.org/index.html">
385
446
  <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
386
447
  </body>
@@ -30,6 +30,7 @@
30
30
  <tr><td class="indexkey"><a class="el" href="classPassenger_1_1Application_1_1Session.html">Passenger::Application::Session</a></td><td class="indexvalue">Represents the life time of a single request/response pair of a Ruby on Rails or Rack application </td></tr>
31
31
  <tr><td class="indexkey"><a class="el" href="classPassenger_1_1ApplicationPool.html">Passenger::ApplicationPool</a></td><td class="indexvalue">A persistent pool of Applications </td></tr>
32
32
  <tr><td class="indexkey"><a class="el" href="classPassenger_1_1ApplicationPoolServer.html">Passenger::ApplicationPoolServer</a></td><td class="indexvalue">Multi-process usage support for <a class="el" href="classPassenger_1_1ApplicationPool.html" title="A persistent pool of Applications.">ApplicationPool</a> </td></tr>
33
+ <tr><td class="indexkey"><a class="el" href="classPassenger_1_1BufferedUpload.html">Passenger::BufferedUpload</a></td><td class="indexvalue">Represents a buffered upload file </td></tr>
33
34
  <tr><td class="indexkey"><a class="el" href="classPassenger_1_1BusyException.html">Passenger::BusyException</a></td><td class="indexvalue">The application pool is too busy and cannot fulfill a get() request </td></tr>
34
35
  <tr><td class="indexkey"><a class="el" href="classClient.html">Client</a></td><td class="indexvalue">Represents a single ApplicationPool client, connected to this server </td></tr>
35
36
  <tr><td class="indexkey"><a class="el" href="classPassenger_1_1ConfigurationException.html">Passenger::ConfigurationException</a></td><td class="indexvalue">Thrown when an invalid configuration is given </td></tr>
@@ -48,10 +49,9 @@
48
49
  <tr><td class="indexkey"><a class="el" href="classPassenger_1_1StandardApplicationPool.html">Passenger::StandardApplicationPool</a></td><td class="indexvalue">A standard implementation of <a class="el" href="classPassenger_1_1ApplicationPool.html" title="A persistent pool of Applications.">ApplicationPool</a> for single-process environments </td></tr>
49
50
  <tr><td class="indexkey"><a class="el" href="classPassenger_1_1SystemException.html">Passenger::SystemException</a></td><td class="indexvalue">Represents an error returned by a system call or a standard library call </td></tr>
50
51
  <tr><td class="indexkey"><a class="el" href="classPassenger_1_1SystemTime.html">Passenger::SystemTime</a></td><td class="indexvalue">This class allows one to obtain the system time, similar to time() </td></tr>
51
- <tr><td class="indexkey"><a class="el" href="classPassenger_1_1TempFile.html">Passenger::TempFile</a></td><td class="indexvalue">Represents a temporary file </td></tr>
52
52
  </table>
53
53
  </div>
54
- <hr size="1"><address style="text-align: right;"><small>Generated on Fri Mar 13 19:24:33 2009 for Passenger by&nbsp;
54
+ <hr size="1"><address style="text-align: right;"><small>Generated on Tue Mar 31 14:00:28 2009 for Passenger by&nbsp;
55
55
  <a href="http://www.doxygen.org/index.html">
56
56
  <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
57
57
  </body>
@@ -27,7 +27,7 @@
27
27
  <tr class="memlist"><td><a class="el" href="classClient.html#e625bb32c95bde75bfa4bdfdb8ee56db">Client</a>(Server &amp;the_server, int connection)</td><td><a class="el" href="classClient.html">Client</a></td><td><code> [inline]</code></td></tr>
28
28
  <tr class="memlist"><td><a class="el" href="classClient.html#c0a8dd9e23393c045064b109355a7daf">start</a>(const weak_ptr&lt; Client &gt; self)</td><td><a class="el" href="classClient.html">Client</a></td><td><code> [inline]</code></td></tr>
29
29
  </table></div>
30
- <hr size="1"><address style="text-align: right;"><small>Generated on Fri Mar 13 19:24:33 2009 for Passenger by&nbsp;
30
+ <hr size="1"><address style="text-align: right;"><small>Generated on Tue Mar 31 14:00:28 2009 for Passenger by&nbsp;
31
31
  <a href="http://www.doxygen.org/index.html">
32
32
  <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
33
33
  </body>
@@ -109,7 +109,7 @@ Start the thread for handling the connection with this client.
109
109
  <hr>The documentation for this class was generated from the following file:<ul>
110
110
  <li>ApplicationPoolServerExecutable.cpp</ul>
111
111
  </div>
112
- <hr size="1"><address style="text-align: right;"><small>Generated on Fri Mar 13 19:24:33 2009 for Passenger by&nbsp;
112
+ <hr size="1"><address style="text-align: right;"><small>Generated on Tue Mar 31 14:00:28 2009 for Passenger by&nbsp;
113
113
  <a href="http://www.doxygen.org/index.html">
114
114
  <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
115
115
  </body>
@@ -29,7 +29,7 @@
29
29
  <tr class="memlist"><td><a class="el" href="classHooks.html#d6cca64be8a9075b4b92efdb4d9020a5">startBlockingModAutoIndex</a>(request_rec *r)</td><td><a class="el" href="classHooks.html">Hooks</a></td><td><code> [inline]</code></td></tr>
30
30
  <tr class="memlist"><td><a class="el" href="classHooks.html#e3091c57c95b2f8269f566099802f0ec">startBlockingModDir</a>(request_rec *r)</td><td><a class="el" href="classHooks.html">Hooks</a></td><td><code> [inline]</code></td></tr>
31
31
  </table></div>
32
- <hr size="1"><address style="text-align: right;"><small>Generated on Fri Mar 13 19:24:33 2009 for Passenger by&nbsp;
32
+ <hr size="1"><address style="text-align: right;"><small>Generated on Tue Mar 31 14:00:28 2009 for Passenger by&nbsp;
33
33
  <a href="http://www.doxygen.org/index.html">
34
34
  <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
35
35
  </body>
@@ -146,7 +146,7 @@ So in this hook method, we temporarily change some fields in the request structu
146
146
  <hr>The documentation for this class was generated from the following file:<ul>
147
147
  <li>Hooks.cpp</ul>
148
148
  </div>
149
- <hr size="1"><address style="text-align: right;"><small>Generated on Fri Mar 13 19:24:33 2009 for Passenger by&nbsp;
149
+ <hr size="1"><address style="text-align: right;"><small>Generated on Tue Mar 31 14:00:28 2009 for Passenger by&nbsp;
150
150
  <a href="http://www.doxygen.org/index.html">
151
151
  <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
152
152
  </body>
@@ -30,7 +30,7 @@
30
30
  <tr class="memlist"><td><a class="el" href="classPassenger_1_1Application.html#94d2cce1c2c1d3441325f1498a22bf02">getPid</a>() const </td><td><a class="el" href="classPassenger_1_1Application.html">Passenger::Application</a></td><td><code> [inline]</code></td></tr>
31
31
  <tr class="memlist"><td><a class="el" href="classPassenger_1_1Application.html#d14f673494991460b16246a527ad8ad9">SessionPtr</a> typedef</td><td><a class="el" href="classPassenger_1_1Application.html">Passenger::Application</a></td><td></td></tr>
32
32
  </table></div>
33
- <hr size="1"><address style="text-align: right;"><small>Generated on Fri Mar 13 19:24:34 2009 for Passenger by&nbsp;
33
+ <hr size="1"><address style="text-align: right;"><small>Generated on Tue Mar 31 14:00:30 2009 for Passenger by&nbsp;
34
34
  <a href="http://www.doxygen.org/index.html">
35
35
  <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
36
36
  </body>
@@ -221,7 +221,7 @@ You <b>must</b> close a session when you no longer need if. If you call <a class
221
221
  <hr>The documentation for this class was generated from the following file:<ul>
222
222
  <li><a class="el" href="Application_8h-source.html">Application.h</a></ul>
223
223
  </div>
224
- <hr size="1"><address style="text-align: right;"><small>Generated on Fri Mar 13 19:24:34 2009 for Passenger by&nbsp;
224
+ <hr size="1"><address style="text-align: right;"><small>Generated on Tue Mar 31 14:00:30 2009 for Passenger by&nbsp;
225
225
  <a href="http://www.doxygen.org/index.html">
226
226
  <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
227
227
  </body>
@@ -34,7 +34,7 @@
34
34
  <tr class="memlist"><td><a class="el" href="classPassenger_1_1ApplicationPool.html#0e0f21972ab130c9c0f90c2212328794">setMax</a>(unsigned int max)=0</td><td><a class="el" href="classPassenger_1_1ApplicationPool.html">Passenger::ApplicationPool</a></td><td><code> [pure virtual]</code></td></tr>
35
35
  <tr class="memlist"><td><a class="el" href="classPassenger_1_1ApplicationPool.html#b0437434c79b5444ac0faf768f1410e8">setMaxPerApp</a>(unsigned int max)=0</td><td><a class="el" href="classPassenger_1_1ApplicationPool.html">Passenger::ApplicationPool</a></td><td><code> [pure virtual]</code></td></tr>
36
36
  </table></div>
37
- <hr size="1"><address style="text-align: right;"><small>Generated on Fri Mar 13 19:24:34 2009 for Passenger by&nbsp;
37
+ <hr size="1"><address style="text-align: right;"><small>Generated on Tue Mar 31 14:00:30 2009 for Passenger by&nbsp;
38
38
  <a href="http://www.doxygen.org/index.html">
39
39
  <img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.5 </small></address>
40
40
  </body>