Skip to content

Commit

Permalink
B #6331: Disable chown for Apps from public market (#2752)
Browse files Browse the repository at this point in the history
  • Loading branch information
paczerny authored Sep 25, 2023
1 parent 2efd976 commit 5b68006
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/rm/RequestManagerChown.cc
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,25 @@ void RequestManagerChown::request_execute(xmlrpc_c::paramList const& paramList,
{
vms = static_cast<VirtualRouter *>(object.get())->get_vms();
}
else if (auth_object == PoolObjectSQL::MARKETPLACEAPP)
{
auto app = static_cast<MarketPlaceApp*>(object.get());

auto market_id = app->get_market_id();

auto mpool = Nebula::instance().get_marketpool();

auto market = mpool->get_ro(market_id);

if (market && market->is_public())
{
att.resp_msg = "App " + to_string(oid) +
": Changing the ownership for an App from the public Marketplace is not permitted";
failure_response(INTERNAL, att);

return;
}
}
}

if ( object == nullptr )
Expand Down

0 comments on commit 5b68006

Please sign in to comment.