]> cat aescling's git repositories - mastodon.git/commitdiff
Add entropy to download filenames (#6811)
authornightpool <eg1290@gmail.com>
Sat, 17 Mar 2018 16:39:28 +0000 (12:39 -0400)
committerEugen Rochko <eugen@zeonfederated.com>
Sat, 17 Mar 2018 16:39:28 +0000 (17:39 +0100)
pretty quick fix, and with the 1 week expiration i don't think we need to be too worried about the existing files

closes #6798

app/services/backup_service.rb

index fadc24a82c783a8b2b5b9ff246654d29a4ef9cf8..8492c11176364d49ff87e6af12059cc75fcbcb40 100644 (file)
@@ -49,7 +49,7 @@ class BackupService < BaseService
       end
     end
 
-    archive_filename = ['archive', Time.now.utc.strftime('%Y%m%d%H%M%S'), SecureRandom.hex(2)].join('-') + '.tar.gz'
+    archive_filename = ['archive', Time.now.utc.strftime('%Y%m%d%H%M%S'), SecureRandom.hex(16)].join('-') + '.tar.gz'
 
     @backup.dump      = ActionDispatch::Http::UploadedFile.new(tempfile: tmp_file, filename: archive_filename)
     @backup.processed = true