summaryrefslogtreecommitdiff
path: root/libsubid/subid.h
diff options
context:
space:
mode:
authorBalint Reczey <balint@balintreczey.hu>2022-01-21 23:41:15 +0100
committerBalint Reczey <balint@balintreczey.hu>2022-01-21 23:41:15 +0100
commit0c04b92a9afe5e09a20307d8a5ec98d97ed00f47 (patch)
tree27f51b8f32e23b65d2ef2bbbae00c19fd036e81d /libsubid/subid.h
parent749c1780621163ca5108f164861324bafa9e0ae8 (diff)
downloadshadow-0c04b92a9afe5e09a20307d8a5ec98d97ed00f47.tar.gz
New upstream version 4.11.1+dfsg1upstream/4.11.1+dfsg1
Diffstat (limited to 'libsubid/subid.h')
-rw-r--r--libsubid/subid.h40
1 files changed, 22 insertions, 18 deletions
diff --git a/libsubid/subid.h b/libsubid/subid.h
index eabafe4d..01476713 100644
--- a/libsubid/subid.h
+++ b/libsubid/subid.h
@@ -4,6 +4,10 @@
#ifndef SUBID_RANGE_DEFINED
#define SUBID_RANGE_DEFINED 1
+#define SUBID_ABI_VERSION 4.0.0
+#define SUBID_ABI_MAJOR 4
+#define SUBID_ABI_MINOR 0
+#define SUBID_ABI_MICRO 0
/* subid_range is just a starting point and size of a range */
struct subid_range {
@@ -32,7 +36,7 @@ enum subid_status {
};
/*
- * libsubid_init: initialize libsubid
+ * subid_init: initialize libsubid
*
* @progname: Name to display as program. If NULL, then "(libsubid)" will be
* shown in error messages.
@@ -45,10 +49,10 @@ enum subid_status {
*
* Returns false if an error occurred.
*/
-bool libsubid_init(const char *progname, FILE *logfd);
+bool subid_init(const char *progname, FILE *logfd);
/*
- * get_subuid_ranges: return a list of UID ranges for a user
+ * subid_get_uid_ranges: return a list of UID ranges for a user
*
* @owner: username being queried
* @ranges: a pointer to an array of subid_range structs in which the result
@@ -58,10 +62,10 @@ bool libsubid_init(const char *progname, FILE *logfd);
*
* returns: number of ranges found, ir < 0 on error.
*/
-int get_subuid_ranges(const char *owner, struct subid_range **ranges);
+int subid_get_uid_ranges(const char *owner, struct subid_range **ranges);
/*
- * get_subgid_ranges: return a list of GID ranges for a user
+ * subid_get_gid_ranges: return a list of GID ranges for a user
*
* @owner: username being queried
* @ranges: a pointer to an array of subid_range structs in which the result
@@ -71,10 +75,10 @@ int get_subuid_ranges(const char *owner, struct subid_range **ranges);
*
* returns: number of ranges found, ir < 0 on error.
*/
-int get_subgid_ranges(const char *owner, struct subid_range **ranges);
+int subid_get_gid_ranges(const char *owner, struct subid_range **ranges);
/*
- * get_subuid_owners: return a list of uids to which the given uid has been
+ * subid_get_uid_owners: return a list of uids to which the given uid has been
* delegated.
*
* @uid: The subuid being queried
@@ -83,10 +87,10 @@ int get_subgid_ranges(const char *owner, struct subid_range **ranges);
*
* Returns the number of uids returned, or < 0 on error.
*/
-int get_subuid_owners(uid_t uid, uid_t **owner);
+int subid_get_uid_owners(uid_t uid, uid_t **owner);
/*
- * get_subgid_owners: return a list of uids to which the given gid has been
+ * subid_get_gid_owners: return a list of uids to which the given gid has been
* delegated.
*
* @uid: The subgid being queried
@@ -95,10 +99,10 @@ int get_subuid_owners(uid_t uid, uid_t **owner);
*
* Returns the number of uids returned, or < 0 on error.
*/
-int get_subgid_owners(gid_t gid, uid_t **owner);
+int subid_get_gid_owners(gid_t gid, uid_t **owner);
/*
- * grant_subuid_range: assign a subuid range to a user
+ * subid_grant_uid_range: assign a subuid range to a user
*
* @range: pointer to a struct subordinate_range detailing the UID range
* to allocate. ->owner must be the username, and ->count must be
@@ -109,10 +113,10 @@ int get_subgid_owners(gid_t gid, uid_t **owner);
* then the range from (range->start, range->start + range->count) will
* be delegated to range->owner.
*/
-bool grant_subuid_range(struct subordinate_range *range, bool reuse);
+bool subid_grant_uid_range(struct subordinate_range *range, bool reuse);
/*
- * grant_subsid_range: assign a subgid range to a user
+ * subid_grant_gid_range: assign a subgid range to a user
*
* @range: pointer to a struct subordinate_range detailing the GID range
* to allocate. ->owner must be the username, and ->count must be
@@ -123,10 +127,10 @@ bool grant_subuid_range(struct subordinate_range *range, bool reuse);
* then the range from (range->start, range->start + range->count) will
* be delegated to range->owner.
*/
-bool grant_subgid_range(struct subordinate_range *range, bool reuse);
+bool subid_grant_gid_range(struct subordinate_range *range, bool reuse);
/*
- * ungrant_subuid_range: remove a subuid allocation.
+ * subid_ungrant_uid_range: remove a subuid allocation.
*
* @range: pointer to a struct subordinate_range detailing the UID allocation
* to remove.
@@ -134,10 +138,10 @@ bool grant_subgid_range(struct subordinate_range *range, bool reuse);
* Returns true if successful, false if it failed, for instance if the
* delegation did not exist.
*/
-bool ungrant_subuid_range(struct subordinate_range *range);
+bool subid_ungrant_uid_range(struct subordinate_range *range);
/*
- * ungrant_subuid_range: remove a subgid allocation.
+ * subid_ungrant_gid_range: remove a subgid allocation.
*
* @range: pointer to a struct subordinate_range detailing the GID allocation
* to remove.
@@ -145,7 +149,7 @@ bool ungrant_subuid_range(struct subordinate_range *range);
* Returns true if successful, false if it failed, for instance if the
* delegation did not exist.
*/
-bool ungrant_subgid_range(struct subordinate_range *range);
+bool subid_ungrant_gid_range(struct subordinate_range *range);
#define SUBID_NFIELDS 3
#endif