Skip to content

Commit

Permalink
rescue chown in case it fails
Browse files Browse the repository at this point in the history
  • Loading branch information
johrstrom committed Oct 7, 2024
1 parent cfa871f commit 4d74234
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion apps/dashboard/app/models/posix_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,13 @@ def handle_upload(tempfile)
FileUtils.mv tempfile, path.to_s
File.chmod(mode, path.to_s)

path.chown(nil, path.parent.stat.gid) if path.parent.setgid?
begin
path.chown(nil, path.parent.stat.gid) if path.parent.setgid?
rescue StandardError => e
Rails.logger.info("cannot chown #{path} because of error: #{e}")
end

nil
end

def can_download_as_zip?(timeout: Configuration.file_download_dir_timeout, download_directory_size_limit: Configuration.file_download_dir_max)
Expand Down

0 comments on commit 4d74234

Please sign in to comment.