Skip to content

Commit

Permalink
rgw_sal_motr: [CORTX-28057] Fix IAM user deletion logic (#105)
Browse files Browse the repository at this point in the history
Delete email entry from email index during user deletion

Signed-off-by: Sanal Kaarthikeyan <sanal.kaarthikeyan@seagate.com>
  • Loading branch information
sanalpk authored and andriytk committed Apr 1, 2022
1 parent d309fbd commit cf8c727
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/rgw/rgw_sal_motr.cc
Original file line number Diff line number Diff line change
Expand Up @@ -491,6 +491,15 @@ int MotrUser::remove_user(const DoutPrefixProvider* dpp, optional_yield y)
}
}
}

//Delete email id
if (!info.user_email.empty()) {
rc = store->do_idx_op_by_name(RGW_IAM_MOTR_EMAIL_KEY,
M0_IC_DEL, info.user_email, bl);
if (rc < 0 && rc != -ENOENT) {
ldpp_dout(dpp, 0) << "Unable to delete email id " << rc << dendl;
}
}

// Delete user info index
string user_info_iname = "motr.rgw.user.info." + info.user_id.to_str();
Expand Down

0 comments on commit cf8c727

Please sign in to comment.