Skip to content
Snippets Groups Projects

Raise if path isn't a string

Merged Dominic Couture requested to merge dcouture-path-traversal-check-type into master
All threads resolved!
4 files
+ 18
4
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -87,7 +87,6 @@ def validate
@@ -87,7 +87,6 @@ def validate
def validate_archive_path
def validate_archive_path
Gitlab::Utils.check_path_traversal!(@archive_path)
Gitlab::Utils.check_path_traversal!(@archive_path)
raise(ServiceError, 'Archive path is not a string') unless @archive_path.is_a?(String)
raise(ServiceError, 'Archive path is a symlink') if File.lstat(@archive_path).symlink?
raise(ServiceError, 'Archive path is a symlink') if File.lstat(@archive_path).symlink?
raise(ServiceError, 'Archive path is not a file') unless File.file?(@archive_path)
raise(ServiceError, 'Archive path is not a file') unless File.file?(@archive_path)
end
end
Loading