summaryrefslogtreecommitdiff
path: root/include/apr_user.h
diff options
context:
space:
mode:
authorwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2001-01-28 23:20:48 +0000
committerwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2001-01-28 23:20:48 +0000
commit4ef48efcb7eb1e0c58b5aa42933a723ba04edbb7 (patch)
tree4af66b20d7d3a7168663576fc864e8f3b11e6103 /include/apr_user.h
parent5acd64acf7d65f6b9caa434e774db0c609707d15 (diff)
downloadlibapr-4ef48efcb7eb1e0c58b5aa42933a723ba04edbb7.tar.gz
User and Group goodness. If anyone objects to the non-typesafe unix
implementation of apr_compare_users/groups - feel free to add saftey. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@61162 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include/apr_user.h')
-rw-r--r--include/apr_user.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/include/apr_user.h b/include/apr_user.h
index 5fea54441..c650fb818 100644
--- a/include/apr_user.h
+++ b/include/apr_user.h
@@ -110,6 +110,20 @@ APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, ap
APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *userid, apr_pool_t *p);
/***
+ * Compare two user identifiers for equality.
+ * @param left One uid to test
+ * @param right Another uid to test
+ * @deffunc apr_status_t apr_compare_users(apr_uid_t left, apr_uid_t right)
+ * @tip Returns APR_SUCCESS if the apr_uid_t strutures identify the same user,
+ * APR_EMISMATCH if not, APR_BADARG if an apr_uid_t is invalid.
+ */
+#ifdef WIN32
+APR_DECLARE(apr_status_t) apr_compare_users(apr_uid_t left, apr_uid_t right);
+#else
+#define apr_compare_users(left,right) ((left == right) ? APR_SUCCESS : APR_EMISMATCH)
+#endif
+
+/***
* Get the group name for a specified groupid
* @param dirname Pointer to new string containing group name (on output)
* @param userid The groupid
@@ -119,6 +133,20 @@ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *use
*/
APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, apr_gid_t groupid, apr_pool_t *p);
+/***
+ * Compare two group identifiers for equality.
+ * @param left One gid to test
+ * @param right Another gid to test
+ * @deffunc apr_status_t apr_compare_groups(apr_gid_t left, apr_gid_t right)
+ * @tip Returns APR_SUCCESS if the apr_gid_t strutures identify the same group,
+ * APR_EMISMATCH if not, APR_BADARG if an apr_gid_t is invalid.
+ */
+#ifdef WIN32
+APR_DECLARE(apr_status_t) apr_compare_groups(apr_gid_t left, apr_gid_t right);
+#else
+#define apr_compare_groups(left,right) ((left == right) ? APR_SUCCESS : APR_EMISMATCH)
+#endif
+
#endif /* ! APR_HAS_USER */
#ifdef __cplusplus