Don't return owner in list_owner_ranges API call.

Closes: 339

struct subordinate_range is pretty closely tied to the existing
subid code and /etc/subuid format, so it includes an owner.  Dropping
that or even renaming it is more painful than I'd first thought.
So introduce a 'struct subid_range' which is only the start and
count, leaving 'struct subordinate_range' as the owner, start and
count.

Signed-off-by: Serge Hallyn <serge@hallyn.com>
This commit is contained in:
Serge Hallyn
2021-05-16 21:47:05 -05:00
parent f9831a4a1a
commit 322db32971
7 changed files with 63 additions and 38 deletions

View File

@@ -300,8 +300,8 @@ struct subid_nss_ops {
*
* @owner - string representing username being queried
* @id_type - subuid or subgid
* @ranges - pointer to an array of struct subordinate_range pointers, or
* NULL. The returned array of struct subordinate_range and its
* @ranges - pointer to an array of struct subid_range pointers, or
* NULL. The returned array of struct subid_range and its
* members must be freed by the caller.
* @count - pointer to an integer into which the number of returned ranges
* is written.
@@ -309,7 +309,7 @@ struct subid_nss_ops {
* returns success if the module was able to determine an answer,
* else an error status.
*/
enum subid_status (*list_owner_ranges)(const char *owner, enum subid_type id_type, struct subordinate_range ***ranges, int *count);
enum subid_status (*list_owner_ranges)(const char *owner, enum subid_type id_type, struct subid_range ***ranges, int *count);
/*
* nss_find_subid_owners: find uids who own a given subuid or subgid.