summaryrefslogtreecommitdiff
path: root/user
diff options
context:
space:
mode:
authorwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2002-06-04 04:57:22 +0000
committerwrowe <wrowe@13f79535-47bb-0310-9956-ffa450edef68>2002-06-04 04:57:22 +0000
commite788d64deb2d2f07a298a19dafb61735602b5e70 (patch)
treefe47e066ce847b8a1fef65987513f4d8b0119c27 /user
parent0af523b9f39b43fc7d96611a852cbf2987a91548 (diff)
downloadlibapr-e788d64deb2d2f07a298a19dafb61735602b5e70.tar.gz
More CE porting. I'd prefer to see us return a stock value of 0 for the
user and group ID functions rather than returning ENOTIMPL. There are no groups or users on WinCE. Comments? Submitted by: Mladen Turk <mturk@mappingsoft.com> git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63467 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'user')
-rw-r--r--user/win32/groupinfo.c10
-rw-r--r--user/win32/userinfo.c23
2 files changed, 32 insertions, 1 deletions
diff --git a/user/win32/groupinfo.c b/user/win32/groupinfo.c
index edc2feb54..25c51af31 100644
--- a/user/win32/groupinfo.c
+++ b/user/win32/groupinfo.c
@@ -63,6 +63,9 @@
APR_DECLARE(apr_status_t) apr_get_groupid(apr_gid_t *gid,
const char *groupname, apr_pool_t *p)
{
+#ifdef _WIN32_WCE
+ return APR_ENOTIMPL;
+#else
SID_NAME_USE sidtype;
char anydomain[256];
char *domain;
@@ -98,10 +101,14 @@ APR_DECLARE(apr_status_t) apr_get_groupid(apr_gid_t *gid,
return apr_get_os_error();
}
return APR_SUCCESS;
+#endif
}
APR_DECLARE(apr_status_t) apr_group_name_get(char **groupname, apr_gid_t groupid, apr_pool_t *p)
{
+#ifdef _WIN32_WCE
+ *groupname = apr_pstrdup(p, "Administrators");
+#else
SID_NAME_USE type;
char name[MAX_PATH], domain[MAX_PATH];
DWORD cbname = sizeof(name), cbdomain = sizeof(domain);
@@ -113,6 +120,7 @@ APR_DECLARE(apr_status_t) apr_group_name_get(char **groupname, apr_gid_t groupid
&& type != SidTypeAlias)
return APR_EINVAL;
*groupname = apr_pstrdup(p, name);
+#endif
return APR_SUCCESS;
}
@@ -120,9 +128,11 @@ APR_DECLARE(apr_status_t) apr_compare_groups(apr_gid_t left, apr_gid_t right)
{
if (!left || !right)
return APR_EINVAL;
+#ifndef _WIN32_WCE
if (!IsValidSid(left) || !IsValidSid(right))
return APR_EINVAL;
if (!EqualSid(left, right))
return APR_EMISMATCH;
+#endif
return APR_SUCCESS;
}
diff --git a/user/win32/userinfo.c b/user/win32/userinfo.c
index f96117d73..28ae3ddd2 100644
--- a/user/win32/userinfo.c
+++ b/user/win32/userinfo.c
@@ -61,6 +61,7 @@
#include <sys/types.h>
#endif
+#ifndef _WIN32_WCE
/* Internal sid binary to string translation, see MSKB Q131320.
* Several user related operations require our SID to access
* the registry, but in a string format. All error handling
@@ -97,12 +98,16 @@ void get_sid_string(char *buf, int blen, apr_uid_t id)
*GetSidSubAuthority(id, sa));
}
}
-
+#endif
/* Query the ProfileImagePath from the version-specific branch, where the
* regkey uses the user's name on 9x, and user's sid string on NT.
*/
APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *username, apr_pool_t *p)
{
+#ifdef _WIN32_WCE
+ *dirname = apr_pstrdup(p, "/My Documents");
+ return APR_SUCCESS;
+#else
apr_status_t rv;
char regkey[MAX_PATH * 2];
char *fixch;
@@ -189,12 +194,16 @@ APR_DECLARE(apr_status_t) apr_get_home_directory(char **dirname, const char *use
if (*fixch == '\\')
*fixch = '/';
return APR_SUCCESS;
+#endif /* _WIN32_WCE */
}
APR_DECLARE(apr_status_t) apr_current_userid(apr_uid_t *uid,
apr_gid_t *gid,
apr_pool_t *p)
{
+#ifdef _WIN32_WCE
+ return APR_ENOTIMPL;
+#else
HANDLE threadtok;
DWORD needed;
TOKEN_USER *usr;
@@ -222,11 +231,15 @@ APR_DECLARE(apr_status_t) apr_current_userid(apr_uid_t *uid,
return apr_get_os_error();
return APR_SUCCESS;
+#endif
}
APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *uid, apr_gid_t *gid,
const char *username, apr_pool_t *p)
{
+#ifdef _WIN32_WCE
+ return APR_ENOTIMPL;
+#else
SID_NAME_USE sidtype;
char anydomain[256];
char *domain;
@@ -265,10 +278,15 @@ APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *uid, apr_gid_t *gid,
*/
*gid = NULL;
return APR_SUCCESS;
+#endif
}
APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, apr_pool_t *p)
{
+#ifdef _WIN32_WCE
+ *username = apr_pstrdup(p, "Administrator");
+ return APR_SUCCESS;
+#else
SID_NAME_USE type;
char name[MAX_PATH], domain[MAX_PATH];
DWORD cbname = sizeof(name), cbdomain = sizeof(domain);
@@ -280,15 +298,18 @@ APR_DECLARE(apr_status_t) apr_get_username(char **username, apr_uid_t userid, ap
return APR_EINVAL;
*username = apr_pstrdup(p, name);
return APR_SUCCESS;
+#endif
}
APR_DECLARE(apr_status_t) apr_compare_users(apr_uid_t left, apr_uid_t right)
{
if (!left || !right)
return APR_EINVAL;
+#ifndef _WIN32_WCE
if (!IsValidSid(left) || !IsValidSid(right))
return APR_EINVAL;
if (!EqualSid(left, right))
return APR_EMISMATCH;
+#endif
return APR_SUCCESS;
}