nss/libsubid: simplify the ranges variable for list_owner_ranges
Following alexey-tikhonov's suggestion. Since we've dropped the 'owner' field in the data returned for get_subid_ranges, we can just return a single allocated array of simple structs. This means we can return a ** instead of ***, and we can get rid of the subid_free_ranges() helper, since the caller can just free() the returned data. Signed-off-by: Serge Hallyn <serge@hallyn.com>
This commit is contained in:
@ -66,17 +66,17 @@ bool libsubid_init(const char *progname, FILE * logfd)
|
||||
}
|
||||
|
||||
static
|
||||
int get_subid_ranges(const char *owner, enum subid_type id_type, struct subid_range ***ranges)
|
||||
int get_subid_ranges(const char *owner, enum subid_type id_type, struct subid_range **ranges)
|
||||
{
|
||||
return list_owner_ranges(owner, id_type, ranges);
|
||||
}
|
||||
|
||||
int get_subuid_ranges(const char *owner, struct subid_range ***ranges)
|
||||
int get_subuid_ranges(const char *owner, struct subid_range **ranges)
|
||||
{
|
||||
return get_subid_ranges(owner, ID_TYPE_UID, ranges);
|
||||
}
|
||||
|
||||
int get_subgid_ranges(const char *owner, struct subid_range ***ranges)
|
||||
int get_subgid_ranges(const char *owner, struct subid_range **ranges)
|
||||
{
|
||||
return get_subid_ranges(owner, ID_TYPE_GID, ranges);
|
||||
}
|
||||
|
Reference in New Issue
Block a user