passenger 5.1.0 → 5.1.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG +16 -2
- data/build/packaging.rb +5 -4
- data/src/agent/Core/CoreMain.cpp +3 -0
- data/src/agent/Core/SecurityUpdateChecker.h +15 -3
- data/src/agent/Core/SpawningKit/SmartSpawner.h +2 -2
- data/src/agent/Core/SpawningKit/Spawner.h +1 -1
- data/src/cxx_supportlib/Constants.h +1 -1
- data/src/cxx_supportlib/UnionStationFilterSupport.h +2 -3
- data/src/cxx_supportlib/Utils/BufferedIO.h +1 -1
- data/src/cxx_supportlib/Utils/Curl.h +46 -1
- data/src/helper-scripts/node-loader.js +26 -12
- data/src/ruby_supportlib/phusion_passenger.rb +1 -1
- data/src/ruby_supportlib/phusion_passenger/utils/unseekable_socket.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e732defdfa61deaff680b48bf2fd783134050c1b
|
4
|
+
data.tar.gz: f8d8c05559321f7f6d6059789be3d6623993b58d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa29f680f64378dacedb351de1f1674b731a01233da13347c932bf83d38157782d2451dc4b64f966c402d7f265c01bf53cef7863ab58a57618e89f95ad1c33bb
|
7
|
+
data.tar.gz: dba2a004f2557967fcf5c49680af2487a654e4d0c843f2e5fe12c49e93d2839ae4fa6ae68463f61051886f586a79ccde5bd1ece95941cbf3787e7a78862b8fdc
|
data/CHANGELOG
CHANGED
@@ -1,5 +1,19 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
Release 5.1.1
|
2
|
+
-------------
|
3
|
+
|
4
|
+
* The precompiled version of the PassengerAgent binary (used for e.g. gem installs) now configures (statically linked) libcurl with system keystore, so that the new security update check can successfully validate certs.
|
5
|
+
* Fixes some false positives (logging) from the new Node and Meteor cluster warning system. Logging is less repetitive and has extra debug info. Closes GH-1905.
|
6
|
+
* Updates the upload-progress module in the Nginx Debian package. The module version that we linked against in 5.1.0 was 0.9.2, but due to a bug in that version the module didn't work.
|
7
|
+
* The security update check now reports whether libcurl + SSL backend are statically linked to Passenger, in which case the check also needs to warn about relevant OpenSSL vulnerabilities in the linked library.
|
8
|
+
* Increases the allowed line lengths emmited by apps at startup.
|
9
|
+
* Adds support for the unary 'not' operator in the Union Station filter language.
|
10
|
+
* [Enterprise] Add missing flying-passenger integration mode to security update check.
|
11
|
+
* Fixes support for Rails 5.0.1 Action Cable. Specifically, we now support the `options` argument in the `write_nonblock` method in hijacked Rack IO sockets.
|
12
|
+
* [Apache] Introduces a small delay to prevent running the Security Update Checker twice at startup.
|
13
|
+
|
14
|
+
|
15
|
+
Release 5.1.0
|
16
|
+
--------------
|
3
17
|
|
4
18
|
* Upgrades union_station_hooks_core to version 2.1.2.
|
5
19
|
* [Enterprise] When running a Rails app in multithreaded mode, Passenger Enterprise automatically tags Rails logs with the current thread number. This makes it possible to distinguish logs generated by different threads.
|
data/build/packaging.rb
CHANGED
@@ -404,7 +404,7 @@ task 'package:initiate_binaries_building' do
|
|
404
404
|
request = Net::HTTP::Post.new(uri.request_uri)
|
405
405
|
request.set_form_data("token" => jenkins_token)
|
406
406
|
response = http.request(request)
|
407
|
-
if response.code !=
|
407
|
+
if response.code != 201
|
408
408
|
abort "*** ERROR: Cannot initiate building of binaries:\n" +
|
409
409
|
"Status: #{response.code}\n\n" +
|
410
410
|
response.body
|
@@ -451,7 +451,7 @@ task 'package:initiate_debian_building' do
|
|
451
451
|
request = Net::HTTP::Post.new(uri.request_uri)
|
452
452
|
request.set_form_data("token" => jenkins_token)
|
453
453
|
response = http.request(request)
|
454
|
-
if response.code !=
|
454
|
+
if response.code != 201
|
455
455
|
abort "*** ERROR: Cannot initiate building of Debian packages:\n" +
|
456
456
|
"Status: #{response.code}\n\n" +
|
457
457
|
response.body
|
@@ -498,7 +498,7 @@ task 'package:initiate_rpm_building' do
|
|
498
498
|
request = Net::HTTP::Post.new(uri.request_uri)
|
499
499
|
request.set_form_data("token" => jenkins_token)
|
500
500
|
response = http.request(request)
|
501
|
-
if response.code !=
|
501
|
+
if response.code != 201
|
502
502
|
abort "*** ERROR: Cannot initiate building of RPM packages:\n" +
|
503
503
|
"Status: #{response.code}\n\n" +
|
504
504
|
response.body
|
@@ -507,7 +507,8 @@ task 'package:initiate_rpm_building' do
|
|
507
507
|
end
|
508
508
|
|
509
509
|
task 'package:build_osx_binaries' do
|
510
|
-
sh "env ENTERPRISE=#{is_enterprise?} TESTING=false " \
|
510
|
+
sh "env ENTERPRISE=#{!!is_enterprise?} TESTING=false " \
|
511
|
+
"PASSENGER_ROOT=#{Shellwords.shellescape Dir.pwd} " \
|
511
512
|
"./packaging/binaries/integration/publish/macos.sh"
|
512
513
|
end
|
513
514
|
|
data/src/agent/Core/CoreMain.cpp
CHANGED
@@ -787,6 +787,9 @@ initializeSecurityUpdateChecker() {
|
|
787
787
|
if (!standaloneEngine.empty()) {
|
788
788
|
serverIntegration.append(" " + standaloneEngine);
|
789
789
|
}
|
790
|
+
if (options.get("server_software").find(FLYING_PASSENGER_NAME) != string::npos) {
|
791
|
+
serverIntegration.append(" flying");
|
792
|
+
}
|
790
793
|
string serverVersion = options.get("server_version", false); // not set in case of standalone / builtin
|
791
794
|
|
792
795
|
workingObjects->securityUpdateChecker = new SecurityUpdateChecker(workingObjects->resourceLocator, proxy, serverIntegration, serverVersion);
|
@@ -57,6 +57,8 @@ private:
|
|
57
57
|
|
58
58
|
void threadMain() {
|
59
59
|
TRACE_POINT();
|
60
|
+
// Sleep for a short while to allow interruption during the Apache integration double startup procedure, this prevents running the update check twice
|
61
|
+
boost::this_thread::sleep_for(boost::chrono::seconds(2));
|
60
62
|
while (!this_thread::interruption_requested()) {
|
61
63
|
UPDATE_TRACE_POINT();
|
62
64
|
int backoffMin = 0;
|
@@ -117,7 +119,7 @@ private:
|
|
117
119
|
case CURLE_SSL_CACERT_BADFILE:
|
118
120
|
error.append(" while connecting to " CHECK_URL_DEFAULT " " +
|
119
121
|
(proxyAddress.empty() ? "" : "using proxy " + proxyAddress) + "; this might happen if the nss backend "
|
120
|
-
"is installed for libcurl instead of
|
122
|
+
"is installed for libcurl instead of GnuTLS or OpenSSL. If the problem persists, you can also try upgrading "
|
121
123
|
"or reinstalling " SHORT_PROGRAM_NAME);
|
122
124
|
break;
|
123
125
|
|
@@ -191,9 +193,9 @@ private:
|
|
191
193
|
*/
|
192
194
|
CURLcode prepareCurlPOST(CURL *curl, string &bodyJsonString, string *responseData, struct curl_slist **chunk) {
|
193
195
|
CURLcode code;
|
194
|
-
|
196
|
+
|
195
197
|
// Hint for advanced debugging: curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
|
196
|
-
|
198
|
+
|
197
199
|
if (CURLE_OK != (code = curl_easy_setopt(curl, CURLOPT_NOSIGNAL, 1))) {
|
198
200
|
return code;
|
199
201
|
}
|
@@ -389,6 +391,7 @@ public:
|
|
389
391
|
|
390
392
|
bodyJson["server_integration"] = serverIntegration;
|
391
393
|
bodyJson["server_version"] = serverVersion;
|
394
|
+
bodyJson["curl_static"] = isCurlStaticallyLinked();
|
392
395
|
|
393
396
|
string nonce;
|
394
397
|
if (!fillNonce(nonce)) {
|
@@ -416,6 +419,12 @@ public:
|
|
416
419
|
logUpdateFail("File not readable: " + clientCertPath);
|
417
420
|
break;
|
418
421
|
}
|
422
|
+
|
423
|
+
if (CURLE_OK != (code = setCurlDefaultCaInfo(curl))) {
|
424
|
+
logUpdateFailCurl(code);
|
425
|
+
break;
|
426
|
+
}
|
427
|
+
|
419
428
|
// string localApprovedCert = "/your/ca.crt"; // for testing against a local server
|
420
429
|
// curl_easy_setopt(curl, CURLOPT_CAINFO, localApprovedCert.c_str());
|
421
430
|
|
@@ -431,6 +440,7 @@ public:
|
|
431
440
|
break;
|
432
441
|
}
|
433
442
|
|
443
|
+
P_DEBUG("sending: " << bodyJsonString);
|
434
444
|
if (CURLE_OK != (code = sendAndReceive(curl, &responseData, &responseCode))) {
|
435
445
|
logUpdateFailCurl(code);
|
436
446
|
break;
|
@@ -448,6 +458,7 @@ public:
|
|
448
458
|
logUpdateFailResponse("json parse", responseData);
|
449
459
|
break;
|
450
460
|
}
|
461
|
+
P_DEBUG("received: " << responseData);
|
451
462
|
|
452
463
|
// 3b. Verify response: signature
|
453
464
|
if (!responseJson.isObject() || !responseJson["data"].isString() || !responseJson["signature"].isString()) {
|
@@ -490,6 +501,7 @@ public:
|
|
490
501
|
logUpdateFailResponse("unparseable data", responseData);
|
491
502
|
break;
|
492
503
|
}
|
504
|
+
P_DEBUG("data content (signature OK): " << responseDataJson.toStyledString());
|
493
505
|
|
494
506
|
if (!responseDataJson.isObject() || !responseDataJson["update"].isInt() || !responseDataJson["nonce"].isString()) {
|
495
507
|
logUpdateFailResponse("missing data fields", responseData);
|
@@ -684,12 +684,12 @@ private:
|
|
684
684
|
}
|
685
685
|
writeExact(fd, "\n", &timeout);
|
686
686
|
|
687
|
-
result = io.readLine(1024, &timeout);
|
687
|
+
result = io.readLine(1024 * 8, &timeout);
|
688
688
|
if (result == "OK\n") {
|
689
689
|
UPDATE_TRACE_POINT();
|
690
690
|
pid_t spawnedPid;
|
691
691
|
|
692
|
-
spawnedPid = atoi(io.readLine(1024, &timeout).c_str());
|
692
|
+
spawnedPid = atoi(io.readLine(1024 * 8, &timeout).c_str());
|
693
693
|
if (spawnedPid <= 0) {
|
694
694
|
BackgroundIOCapturerPtr stderrCapturer;
|
695
695
|
throwPreloaderSpawnException("An error occurred while starting "
|
@@ -691,7 +691,7 @@ protected:
|
|
691
691
|
string readMessageLine(Details &details) {
|
692
692
|
TRACE_POINT();
|
693
693
|
while (true) {
|
694
|
-
string result = details.io.readLine(1024 *
|
694
|
+
string result = details.io.readLine(1024 * 16, &details.timeout);
|
695
695
|
string line = result;
|
696
696
|
if (!line.empty() && line[line.size() - 1] == '\n') {
|
697
697
|
line.erase(line.size() - 1, 1);
|
@@ -80,7 +80,7 @@
|
|
80
80
|
#define PASSENGER_API_VERSION_MAJOR 0
|
81
81
|
#define PASSENGER_API_VERSION_MINOR 3
|
82
82
|
#define PASSENGER_DEFAULT_USER "nobody"
|
83
|
-
#define PASSENGER_VERSION "5.1.
|
83
|
+
#define PASSENGER_VERSION "5.1.1"
|
84
84
|
#define POOL_HELPER_THREAD_STACK_SIZE 262144
|
85
85
|
#define PROCESS_SHUTDOWN_TIMEOUT 60
|
86
86
|
#define PROCESS_SHUTDOWN_TIMEOUT_DISPLAY "1 minute"
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
* Phusion Passenger - https://www.phusionpassenger.com/
|
3
|
-
* Copyright (c) 2011-
|
3
|
+
* Copyright (c) 2011-2016 Phusion Holding B.V.
|
4
4
|
*
|
5
5
|
* "Passenger", "Phusion Passenger" and "Union Station" are registered
|
6
6
|
* trademarks of Phusion Holding B.V.
|
@@ -197,8 +197,7 @@ private:
|
|
197
197
|
case '=':
|
198
198
|
return matchToken(NOT_EQUALS, 2);
|
199
199
|
default:
|
200
|
-
|
201
|
-
return Token(); // Shut up compiler warning.
|
200
|
+
return matchToken(NOT, 1);
|
202
201
|
};
|
203
202
|
}
|
204
203
|
|
@@ -221,7 +221,7 @@ public:
|
|
221
221
|
* @throws SecurityException
|
222
222
|
* @throws boost::thread_interrupted
|
223
223
|
*/
|
224
|
-
string readLine(unsigned int max = 1024, unsigned long long *timeout = NULL) {
|
224
|
+
string readLine(unsigned int max = 1024 * 8, unsigned long long *timeout = NULL) {
|
225
225
|
string output;
|
226
226
|
readUntil(
|
227
227
|
boost::bind(newlineFound,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
/*
|
2
2
|
* Phusion Passenger - https://www.phusionpassenger.com/
|
3
|
-
* Copyright (c) 2013 Phusion Holding B.V.
|
3
|
+
* Copyright (c) 2013-2016 Phusion Holding B.V.
|
4
4
|
*
|
5
5
|
* "Passenger", "Phusion Passenger" and "Union Station" are registered
|
6
6
|
* trademarks of Phusion Holding B.V.
|
@@ -198,6 +198,51 @@ setCurlProxy(CURL *curl, const CurlProxyInfo &proxyInfo) {
|
|
198
198
|
}
|
199
199
|
}
|
200
200
|
|
201
|
+
inline bool
|
202
|
+
isCurlStaticallyLinked() {
|
203
|
+
#ifdef CURL_IS_STATICALLY_LINKED
|
204
|
+
return true;
|
205
|
+
#else
|
206
|
+
return false;
|
207
|
+
#endif
|
208
|
+
}
|
209
|
+
|
210
|
+
inline CURLcode
|
211
|
+
setCurlDefaultCaInfo(CURL *curl) {
|
212
|
+
#ifdef CURL_IS_STATICALLY_LINKED
|
213
|
+
static const char *candidates[] = {
|
214
|
+
// Debian, Ubuntu
|
215
|
+
"/etc/ssl/certs/ca-certificates.crt",
|
216
|
+
// Red Hat, CentOS, Fedora
|
217
|
+
"/etc/pki/tls/certs/ca-bundle.crt",
|
218
|
+
// Older Red Hat
|
219
|
+
"/usr/share/ssl/certs/ca-bundle.crt",
|
220
|
+
// FreeBSD
|
221
|
+
"/usr/local/share/certs/ca-root-nss.crt",
|
222
|
+
// OpenBSD, FreeBSD (symlink)
|
223
|
+
"/etc/ssl/cert.pem",
|
224
|
+
// SUSE
|
225
|
+
"/etc/ssl/certs"
|
226
|
+
};
|
227
|
+
unsigned int i;
|
228
|
+
|
229
|
+
for (i = 0; i < sizeof(candidates) / sizeof(const char *); i++) {
|
230
|
+
switch (getFileType(candidates[i])) {
|
231
|
+
case FT_REGULAR:
|
232
|
+
return curl_easy_setopt(curl, CURLOPT_CAINFO, candidates[i]);
|
233
|
+
case FT_DIRECTORY:
|
234
|
+
return curl_easy_setopt(curl, CURLOPT_CAPATH, candidates[i]);
|
235
|
+
default:
|
236
|
+
break;
|
237
|
+
}
|
238
|
+
}
|
239
|
+
|
240
|
+
return CURLE_SSL_CACERT_BADFILE;
|
241
|
+
#else
|
242
|
+
return CURLE_OK;
|
243
|
+
#endif
|
244
|
+
}
|
245
|
+
|
201
246
|
} // namespace Passenger
|
202
247
|
|
203
248
|
#endif /* _PASSENGER_UTILS_CURL_H_ */
|
@@ -30,13 +30,29 @@ var os = require('os');
|
|
30
30
|
var fs = require('fs');
|
31
31
|
var net = require('net');
|
32
32
|
var http = require('http');
|
33
|
+
var util = require('util');
|
34
|
+
|
35
|
+
var nodeClusterErrCount = 0;
|
36
|
+
var meteorClusterErrCount = 0;
|
33
37
|
|
34
38
|
function badPackageError(packageName) {
|
35
39
|
return "You required the " + packageName + ", which is incompatible with Passenger, a non-functional shim was returned and your app may still work. However, please remove the related code as soon as possible.";
|
36
40
|
}
|
37
41
|
|
38
|
-
|
39
|
-
|
42
|
+
// Logs failure to install shim + extended debug info, but with strict spamming protection.
|
43
|
+
function errorMockingRequire(packageName, error, args, count) {
|
44
|
+
if (count > 2) {
|
45
|
+
return; // spam protect against repeated warnings
|
46
|
+
}
|
47
|
+
var msg = "Failed to install shim to guard against the " + packageName + ". Due to: " + error.message + ". Your can safely ignore this warning if you are not using " + packageName;
|
48
|
+
msg += "\n\tNode version: " + process.version + "\tArguments: " + args.length;
|
49
|
+
for (i = 0; i < args.length; i++) {
|
50
|
+
if (i > 9) { // limit the amount of array elements we log
|
51
|
+
break;
|
52
|
+
}
|
53
|
+
msg += "\n\t[" + i + "] " + util.inspect(args[i]).substr(0, 200); // limit the characters per array element
|
54
|
+
};
|
55
|
+
console.error(msg);
|
40
56
|
}
|
41
57
|
|
42
58
|
//Mock out Node Cluster Module
|
@@ -45,7 +61,7 @@ var originalRequire = Module.prototype.require;
|
|
45
61
|
Module.prototype.require = function() {
|
46
62
|
try {
|
47
63
|
if (arguments['0'] == 'cluster') {
|
48
|
-
console.
|
64
|
+
console.trace(badPackageError("Node Cluster module"));
|
49
65
|
return {
|
50
66
|
disconnect : function(){return false;},
|
51
67
|
fork : function(){return false;},
|
@@ -57,13 +73,12 @@ Module.prototype.require = function() {
|
|
57
73
|
worker : false,
|
58
74
|
workers : false,
|
59
75
|
};
|
60
|
-
} else {
|
61
|
-
return originalRequire.apply(this, arguments);
|
62
76
|
}
|
63
77
|
} catch (e) {
|
64
|
-
|
65
|
-
|
78
|
+
nodeClusterErrCount++;
|
79
|
+
errorMockingRequire("Node Cluster module", e, arguments, nodeClusterErrCount);
|
66
80
|
}
|
81
|
+
return originalRequire.apply(this, arguments);
|
67
82
|
};
|
68
83
|
|
69
84
|
//Mock out Meteor Cluster Module
|
@@ -76,7 +91,7 @@ vm.runInThisContext = function() {
|
|
76
91
|
scriptPath = scriptPath['filename'];
|
77
92
|
}
|
78
93
|
if (scriptPath.indexOf('meteorhacks_cluster') != -1) {
|
79
|
-
console.
|
94
|
+
console.trace(badPackageError("Meteorhacks cluster package"));
|
80
95
|
return (function() {
|
81
96
|
Package['meteorhacks:cluster'] = {
|
82
97
|
Cluster: {
|
@@ -93,13 +108,12 @@ vm.runInThisContext = function() {
|
|
93
108
|
}
|
94
109
|
};
|
95
110
|
});
|
96
|
-
} else {
|
97
|
-
return orig_func.apply(this, arguments);
|
98
111
|
}
|
99
112
|
} catch (e) {
|
100
|
-
|
101
|
-
|
113
|
+
meteorClusterErrCount++;
|
114
|
+
errorMockingRequire("Meteorhacks Cluster package", e, arguments, meteorClusterErrCount);
|
102
115
|
}
|
116
|
+
return orig_func.apply(this, arguments);
|
103
117
|
};
|
104
118
|
|
105
119
|
var LineReader = require('phusion_passenger/line_reader').LineReader;
|
@@ -31,7 +31,7 @@ module PhusionPassenger
|
|
31
31
|
|
32
32
|
PACKAGE_NAME = 'passenger'
|
33
33
|
# Run 'rake src/cxx_supportlib/Constants.h' after changing this number.
|
34
|
-
VERSION_STRING = '5.1.
|
34
|
+
VERSION_STRING = '5.1.1'
|
35
35
|
|
36
36
|
PREFERRED_NGINX_VERSION = '1.10.2'
|
37
37
|
NGINX_SHA256_CHECKSUM = '1045ac4987a396e2fa5d0011daf8987b612dd2f05181b67507da68cbe7d765c2'
|
@@ -117,8 +117,8 @@ module PhusionPassenger
|
|
117
117
|
raise annotate(e)
|
118
118
|
end
|
119
119
|
|
120
|
-
def write_nonblock(string)
|
121
|
-
@socket.write_nonblock(string)
|
120
|
+
def write_nonblock(string, *args)
|
121
|
+
@socket.write_nonblock(string, *args)
|
122
122
|
rescue => e
|
123
123
|
raise annotate(e)
|
124
124
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: passenger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.1.
|
4
|
+
version: 5.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Phusion - http://www.phusion.nl/
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|