summaryrefslogtreecommitdiff
path: root/include/apr_user.h
diff options
context:
space:
mode:
authorwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2001-01-28 01:18:04 +0000
committerwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2001-01-28 01:18:04 +0000
commit24a3f1c20414e0ec2799d6573b1e5f5fa5186cab (patch)
tree9279263ffac7adf2f18dc6b7cb13091bf58e30d6 /include/apr_user.h
parent58a59b64bf803d5faeccac4afe2e64f023b69a64 (diff)
downloadlibapr-24a3f1c20414e0ec2799d6573b1e5f5fa5186cab.tar.gz
Add groupinfo.c for apr_get_groupname... win32 commit to follow in a
moment. Note: I have no clue if getgrgid_r is implemented by anyone anywhere, it was a best guess at a threadsafe flavor. PR: Obtained from: Submitted by: Reviewed by: git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@61138 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include/apr_user.h')
-rw-r--r--include/apr_user.h34
1 files changed, 29 insertions, 5 deletions
diff --git a/include/apr_user.h b/include/apr_user.h
index c1606462b..a69719059 100644
--- a/include/apr_user.h
+++ b/include/apr_user.h
@@ -59,8 +59,6 @@
#include "apr_errno.h"
#include "apr_pools.h"
-#if APR_HAS_USER
-
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
@@ -70,10 +68,26 @@ extern "C" {
*/
/**
- * Structure for determining file owner.
+ * Structure for determining user ownership.
* @defvar apr_uid_t
*/
+#ifdef WIN32
+typedef PSID apr_uid_t;
+#else
typedef uid_t apr_uid_t;
+#endif
+
+/**
+ * Structure for determining group ownership.
+ * @defvar apr_gid_t
+ */
+#ifdef WIN32
+typedef PSID apr_gid_t;
+#else
+typedef gid_t apr_gid_t;
+#endif
+
+#if APR_HAS_USER
/***
* Get the user name for a specified userid
@@ -95,10 +109,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);
+/***
+ * Get the group name for a specified groupid
+ * @param dirname Pointer to new string containing group name (on output)
+ * @param userid The groupid
+ * @param p The pool from which to allocate the string
+ * @deffunc apr_status_t apr_get_groupname(char **groupname, apr_gid_t userid, apr_pool_t *p)
+ * @tip This function is available only if APR_HAS_USER is defined.
+ */
+APR_DECLARE(apr_status_t) apr_get_groupname(char **groupname, apr_gid_t groupid, apr_pool_t *p)
+
+#endif /* ! APR_HAS_USER */
+
#ifdef __cplusplus
}
#endif
-#endif /* ! APR_HAS_USER */
-
#endif /* ! APR_USER_H */