From 23aea08b10f5067a6f303941db9cc45277af8ba0 Mon Sep 17 00:00:00 2001 From: Tom Clegg Date: Sat, 1 Nov 2014 15:44:23 -0400 Subject: [PATCH] 4389: Fix infinite loop when ownership trail terminates at a self-owning user. --- apps/workbench/app/controllers/application_controller.rb | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/workbench/app/controllers/application_controller.rb b/apps/workbench/app/controllers/application_controller.rb index 4f5d8fdcd2..f52c24d9cb 100644 --- a/apps/workbench/app/controllers/application_controller.rb +++ b/apps/workbench/app/controllers/application_controller.rb @@ -810,6 +810,12 @@ class ApplicationController < ActionController::Base crumbs = [] current = @name_link || @object while current + # Halt if a group ownership loop is detected. API should refuse + # to produce this state, but it could still arise from a race + # condition when group ownership changes between our find() + # queries. + break if crumbs.collect(&:uuid).include? current.uuid + if current.is_a?(Group) and current.group_class == 'project' crumbs.prepend current end -- 2.39.5