From 7d37f5015bde123a8dae780f65a66207615628ab Mon Sep 17 00:00:00 2001 From: Robin Karlsson <61623634+robinkar@users.noreply.github.com> Date: Tue, 1 Oct 2024 16:07:23 +0300 Subject: [PATCH] Check if handle_upload returns a Transfer (#3838) PosixTransfer will return the result of Pathname.chown (number of files affected by operation) in directories with setgid bit set, which will be considered a true value, but can not be used for render "transfer/show". --- apps/dashboard/app/controllers/files_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/dashboard/app/controllers/files_controller.rb b/apps/dashboard/app/controllers/files_controller.rb index 81d14a77e9..72dbd662e5 100644 --- a/apps/dashboard/app/controllers/files_controller.rb +++ b/apps/dashboard/app/controllers/files_controller.rb @@ -156,7 +156,7 @@ def upload request.env[Rack::RACK_TEMPFILES].reject! { |f| f.path == params[:file].tempfile.path } unless posix_file? @transfer = @path.handle_upload(params[:file].tempfile) - if @transfer + if @transfer.kind_of?(Transfer) render 'transfers/show' else render json: {}