wrowe 2002/12/31 11:37:04
Modified: test testuser.c
Log:
Clarify what is going on here... Win32 can only recover the 'primary'
group of an existing token. An arbitrary user sid can't be an
authenticated token, so apr_uid_get cannot return the group.
There may be a way to do so, but I hadn't found it. For now, register
this case as not implemented; it would probably be better if both the
apr_uid_get and apr_uid_current quit dealing in gids altogether.
Revision Changes Path
1.10 +15 -1 apr/test/testuser.c
Index: testuser.c
===================================================================
RCS file: /home/cvs/apr/test/testuser.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- testuser.c 13 Dec 2002 19:49:22 -0000 1.9
+++ testuser.c 31 Dec 2002 19:37:04 -0000 1.10
@@ -88,7 +88,21 @@
CuAssertIntEquals(tc, APR_SUCCESS, rv);
CuAssertIntEquals(tc, APR_SUCCESS, apr_uid_compare(uid, retreived_uid));
- CuAssertIntEquals(tc, APR_SUCCESS, apr_gid_compare(gid, retreived_gid));
+ if (!gid || !retreived_gid) {
+ /* The function had no way to recover the gid (this would have been
+ * an ENOTIMPL if apr_uid_ functions didn't try to double-up and
+ * also return apr_gid_t values, which was bogus.
+ */
+ if (!gid) {
+ CuNotImpl(tc, "Groups from apr_uid_current");
+ }
+ else {
+ CuNotImpl(tc, "Groups from apr_uid_get");
+ }
+ }
+ else {
+ CuAssertIntEquals(tc, APR_SUCCESS, apr_gid_compare(gid,
retreived_gid));
+ }
}
static void groupname(CuTest *tc)