diff options
author | Robert Speicher <robert@gitlab.com> | 2017-01-23 21:55:34 +0000 |
---|---|---|
committer | Robert Speicher <robert@gitlab.com> | 2017-01-23 21:55:34 +0000 |
commit | d2db3649993b5ad3708d737c88998dc3e4d7ad80 (patch) | |
tree | e5ee1f52bd9e537feedd1ff4431ccca34239d5fe /app | |
parent | 2d3fcf904869ae38edab5ddd49fcb5881b3f47ab (diff) | |
parent | 76deb55f5602ffb137d6e1daf17212e36efb52bf (diff) | |
download | gitlab-ce-d2db3649993b5ad3708d737c88998dc3e4d7ad80.tar.gz |
Merge branch 'rs-pick-security-fixes' into 'master'
Pick security fixes from 8.16.1 et al into master
Closes #26813, #26249, #26259, #26243, #26242
See merge request !8724
Diffstat (limited to 'app')
-rw-r--r-- | app/models/namespace.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/app/models/namespace.rb b/app/models/namespace.rb index d41833de66f..dd33975731f 100644 --- a/app/models/namespace.rb +++ b/app/models/namespace.rb @@ -130,6 +130,8 @@ class Namespace < ActiveRecord::Base Gitlab::UploadsTransfer.new.rename_namespace(path_was, path) + remove_exports! + # If repositories moved successfully we need to # send update instructions to users. # However we cannot allow rollback since we moved namespace dir @@ -214,6 +216,8 @@ class Namespace < ActiveRecord::Base GitlabShellWorker.perform_in(5.minutes, :rm_namespace, repository_storage_path, new_path) end end + + remove_exports! end def refresh_access_of_projects_invited_groups @@ -226,4 +230,20 @@ class Namespace < ActiveRecord::Base def full_path_changed? path_changed? || parent_id_changed? end + + def remove_exports! + Gitlab::Popen.popen(%W(find #{export_path} -not -path #{export_path} -delete)) + end + + def export_path + File.join(Gitlab::ImportExport.storage_path, full_path_was) + end + + def full_path_was + if parent + parent.full_path + '/' + path_was + else + path_was + end + end end |