diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-29 17:16:15 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-29 17:16:15 +0300 |
commit | 5370ec1c3d27d646be672039e78161d22b1e2a80 (patch) | |
tree | 1c0ed695576be5560bb4399082f0642bc214f3f1 /spec/lib/gitlab | |
parent | a5baa12bfff6c41f6c9cf156edcf8e621f71848e (diff) |
Add latest changes from gitlab-org/security/gitlab@15-1-stable-ee
Diffstat (limited to 'spec/lib/gitlab')
-rw-r--r-- | spec/lib/gitlab/import_export/decompressed_archive_size_validator_spec.rb | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/spec/lib/gitlab/import_export/decompressed_archive_size_validator_spec.rb b/spec/lib/gitlab/import_export/decompressed_archive_size_validator_spec.rb index dea584e5019..fe3b638d20f 100644 --- a/spec/lib/gitlab/import_export/decompressed_archive_size_validator_spec.rb +++ b/spec/lib/gitlab/import_export/decompressed_archive_size_validator_spec.rb @@ -86,65 +86,6 @@ RSpec.describe Gitlab::ImportExport::DecompressedArchiveSizeValidator do include_examples 'logs raised exception and terminates validator process group' end end - - context 'archive path validation' do - let(:filesize) { nil } - - before do - expect(Gitlab::Import::Logger) - .to receive(:info) - .with( - import_upload_archive_path: filepath, - import_upload_archive_size: filesize, - message: error_message - ) - end - - context 'when archive path is traversed' do - let(:filepath) { '/foo/../bar' } - let(:error_message) { 'Invalid path' } - - it 'returns false' do - expect(subject.valid?).to eq(false) - end - end - - context 'when archive path is not a string' do - let(:filepath) { 123 } - let(:error_message) { 'Archive path is not a string' } - - it 'returns false' do - expect(subject.valid?).to eq(false) - end - end - - context 'which archive path is a symlink' do - let(:filepath) { File.join(Dir.tmpdir, 'symlink') } - let(:error_message) { 'Archive path is a symlink' } - - before do - FileUtils.ln_s(filepath, filepath, force: true) - end - - it 'returns false' do - expect(subject.valid?).to eq(false) - end - end - - context 'when archive path is not a file' do - let(:filepath) { Dir.mktmpdir } - let(:filesize) { File.size(filepath) } - let(:error_message) { 'Archive path is not a file' } - - after do - FileUtils.rm_rf(filepath) - end - - it 'returns false' do - expect(subject.valid?).to eq(false) - end - end - end end def create_compressed_file |