capability: accept new ownerdata for existing caps

This commit is contained in:
Ed Kellett 2020-06-02 16:08:40 +01:00
parent c7561f03ef
commit 1e221ac32e
No known key found for this signature in database
GPG Key ID: CB9986DEF342FABC
1 changed files with 5 additions and 0 deletions

View File

@ -67,6 +67,11 @@ capability_put(struct CapabilityIndex *idx, const char *cap, void *ownerdata)
if ((entry = rb_dictionary_retrieve(idx->cap_dict, cap)) != NULL)
{
entry->flags &= ~CAP_ORPHANED;
if (ownerdata != NULL)
{
s_assert(entry->ownerdata == NULL);
entry->ownerdata = ownerdata;
}
return (1 << entry->value);
}