summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--auth/ChangeLog8
-rw-r--r--auth/auth.c11
2 files changed, 15 insertions, 4 deletions
diff --git a/auth/ChangeLog b/auth/ChangeLog
index 3effd418..2f82a470 100644
--- a/auth/ChangeLog
+++ b/auth/ChangeLog
@@ -1,10 +1,16 @@
+Fri Jul 19 00:35:46 1996 Michael I. Bushnell, p/BSG <mib@gnu.ai.mit.edu>
+
+ * auth.c (S_auth_makeauth): Deallocate initial reference to
+ NEWAUTH after *NEWHANDLE has been set.
+
Thu Jul 18 19:31:53 1996 Michael I. Bushnell, p/BSG <mib@gnu.ai.mit.edu>
* auth.c (S_auth_makeauth): It's fine if a passed in auth port is
not one we know about; just make the loops across AUTHS deal
properly with null values. Only deallocate the AUTHPTS passed in
if we don't encounter any errors. Always deallocate the
- references in the AUTHS array.
+ references in the AUTHS array. ISUID and GROUPMEMBER functions
+ should check both effective and auxiliary members of AUTH.
(struct pending): Delete member `passthrough_type'.
(S_auth_user_authenticate): Always use MOVE_SEND to send pass
through port back to user.
diff --git a/auth/auth.c b/auth/auth.c
index ebef00b4..d77c484e 100644
--- a/auth/auth.c
+++ b/auth/auth.c
@@ -143,8 +143,12 @@ S_auth_makeauth (struct authhandle *auth,
/* Verify that the union of the handles passed in either contains euid 0
(root), or contains all the requested ids. */
-#define isuid(uid, auth) idvec_contains (&(auth)->euids, uid)
-#define groupmember(gid, auth) idvec_contains (&(auth)->egids, gid)
+#define isuid(uid, auth) \
+ (idvec_contains (&(auth)->euids, uid) \
+ || idvec_contains (&(auth)->auids, uid))
+#define groupmember(gid, auth) \
+ (idvec_contains (&(auth)->egids, gid) \
+ || idvec_contains (&(auth)->agids, gid))
#define isroot(auth) isuid (0, auth)
for (i = 0; i < nauths; i++)
@@ -225,8 +229,9 @@ S_auth_makeauth (struct authhandle *auth,
if (! err)
{
for (j = 1; j < nauths; ++j)
- mach_port_deallocate (mach_task_self (), authpts[j]);
+ mach_port_deallocate (mach_task_self (), authpts[j - 1]);
*newhandle = ports_get_right (newauth);
+ ports_port_deref (newauth);
}
for (j = 1; j < nauths; j++)