Commit 4bf70413 authored by Steven Murray's avatar Steven Murray
Browse files

RFE: CASTOR 2.1.15-x should not allow writes to owner-less tape pools

Fixed in writetp
parent b095b1b3
......@@ -291,6 +291,19 @@ void castor::tape::tpcp::WriteTpCommand::checkUserHasTapeWritePermission(
// A pool has no owner if either its user or group ID is 0
// There is no such concept as a pool owned by the user root or the group root
const bool poolHasOwner = 0 != poolUserId && 0 != poolGroupId;
if(!poolHasOwner) {
castor::exception::Exception ex;
ex.getMessage() <<
"User can write to tape"
": Cannot write to a tape belonging to an owner-less tape-pool";
throw ex;
const bool userOwnsPool = userId == poolUserId && groupId == poolGroupId;
if(userOwnsPool) {
Supports Markdown
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