Fixes: 3ec32f9975f2 (2022-07-20; "subordinateio: also compare the owner ID")
Closes: <https://github.com/shadow-maint/shadow/issues/1339>
Link: <https://github.com/cri-o/cri-o/issues/9416>
Reported-by: Anatolii Bazko <abazko@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
commonio_rewind(db);
while (NULL != (range = commonio_next(db))) {
- if (streq(range->owner, owner)) {
- if (!append_range(&ranges, range, count++)) {
- free(ranges);
- ranges = NULL;
- count = -1;
- goto out;
- }
- }
-
- // Let's also compare with the ID
- if (have_owner_id == true && streq(range->owner, id)) {
+ if ( streq(range->owner, owner)
+ || (have_owner_id && streq(range->owner, id)))
+ {
if (!append_range(&ranges, range, count++)) {
free(ranges);
ranges = NULL;