Commit ef7f6eef authored by Leigh B Stoller's avatar Leigh B Stoller
Browse files

Minor tweak to test to make sure user do not shadow system images.

parent 4db9df55
......@@ -3486,8 +3486,8 @@ sub CreateImage($)
# that they are operating in withadminprivs context. Need a credential
# to provide that, maybe later.
if (OSImage->LookupByName($imagename) &&
!($user->IsLocal() && $user->emulab_user()->admin())) {
if ($experiment->pid() ne EmulabConstants::TBOPSPID() &&
OSImage->LookupByName($imagename)) {
return GeniResponse->Create(GENIRESPONSE_FORBIDDEN, undef,
"Not allowed to shadow system images; ".
"use a different name for your image");
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment