diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-05-26 16:53:11 +0200 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-05-26 16:53:11 +0200 |
commit | 07c6e523b1c1bec7997c65927ba43e393dc8f5f0 (patch) | |
tree | d0bbe862b3eeff70ba7a98bedd3526a31b0ef197 /core | |
parent | 8ec292c8b3416334153faa220e7903ab72d585c3 (diff) | |
parent | bc6d17ed74a20c35ddb21f5f6b7b644664e5275c (diff) | |
download | nextcloud-server-07c6e523b1c1bec7997c65927ba43e393dc8f5f0.tar.gz nextcloud-server-07c6e523b1c1bec7997c65927ba43e393dc8f5f0.zip |
Merge pull request #16565 from owncloud/add-urandom-check
Add check for availability of /dev/urandom
Diffstat (limited to 'core')
-rw-r--r-- | core/js/setupchecks.js | 5 | ||||
-rw-r--r-- | core/js/tests/specs/setupchecksSpec.js | 22 |
2 files changed, 24 insertions, 3 deletions
diff --git a/core/js/setupchecks.js b/core/js/setupchecks.js index 9bb3face751..5d9f1863ef7 100644 --- a/core/js/setupchecks.js +++ b/core/js/setupchecks.js @@ -64,6 +64,11 @@ t('core', 'No memory cache has been configured. To enhance your performance please configure a memcache if available. Further information can be found in our <a href="{docLink}">documentation</a>.', {docLink: data.memcacheDocs}) ); } + if(!data.isUrandomAvailable) { + messages.push( + t('core', '/dev/urandom is not readable by PHP which is highly discouraged for security reasons. Further information can be found in our <a href="{docLink}">documentation</a>.', {docLink: data.securityDocs}) + ); + } } else { messages.push(t('core', 'Error occurred while checking server setup')); } diff --git a/core/js/tests/specs/setupchecksSpec.js b/core/js/tests/specs/setupchecksSpec.js index 3e6382603f5..65de3d0321d 100644 --- a/core/js/tests/specs/setupchecksSpec.js +++ b/core/js/tests/specs/setupchecksSpec.js @@ -66,7 +66,7 @@ describe('OC.SetupChecks tests', function() { { 'Content-Type': 'application/json' }, - JSON.stringify({serverHasInternetConnection: false, memcacheDocs: 'https://doc.owncloud.org/server/go.php?to=admin-performance'}) + JSON.stringify({isUrandomAvailable: true, serverHasInternetConnection: false, memcacheDocs: 'https://doc.owncloud.org/server/go.php?to=admin-performance'}) ); async.done(function( data, s, x ){ @@ -83,7 +83,7 @@ describe('OC.SetupChecks tests', function() { { 'Content-Type': 'application/json' }, - JSON.stringify({serverHasInternetConnection: false, dataDirectoryProtected: false, memcacheDocs: 'https://doc.owncloud.org/server/go.php?to=admin-performance'}) + JSON.stringify({isUrandomAvailable: true, serverHasInternetConnection: false, dataDirectoryProtected: false, memcacheDocs: 'https://doc.owncloud.org/server/go.php?to=admin-performance'}) ); async.done(function( data, s, x ){ @@ -100,7 +100,7 @@ describe('OC.SetupChecks tests', function() { { 'Content-Type': 'application/json', }, - JSON.stringify({serverHasInternetConnection: false, dataDirectoryProtected: false, isMemcacheConfigured: true}) + JSON.stringify({isUrandomAvailable: true, serverHasInternetConnection: false, dataDirectoryProtected: false, isMemcacheConfigured: true}) ); async.done(function( data, s, x ){ @@ -109,6 +109,22 @@ describe('OC.SetupChecks tests', function() { }); }); + it('should return an error if /dev/urandom is not accessible', function(done) { + var async = OC.SetupChecks.checkSetup(); + + suite.server.requests[0].respond( + 200, + { + 'Content-Type': 'application/json', + }, + JSON.stringify({isUrandomAvailable: false, securityDocs: 'https://docs.owncloud.org/myDocs.html', serverHasInternetConnection: true, dataDirectoryProtected: true, isMemcacheConfigured: true}) + ); + + async.done(function( data, s, x ){ + expect(data).toEqual(['/dev/urandom is not readable by PHP which is highly discouraged for security reasons. Further information can be found in our <a href="https://docs.owncloud.org/myDocs.html">documentation</a>.']); + done(); + }); + }); it('should return an error if the response has no statuscode 200', function(done) { var async = OC.SetupChecks.checkSetup(); |