summaryrefslogtreecommitdiff
path: root/pflocal
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1996-07-14 00:20:46 +0000
committerMichael I. Bushnell <mib@gnu.org>1996-07-14 00:20:46 +0000
commitd9727983f073559cfca177faca0d20c554407dd6 (patch)
treea45990d62ee6a7a758762ed38f8d0a05cf2beea3 /pflocal
parent966a500d2598db5ede16b32305633662a1e6f336 (diff)
(S_io_reauthenticate): Repeat sock_create_port and
auth_server_authenticate for as long as we get EINTR.
Diffstat (limited to 'pflocal')
-rw-r--r--pflocal/io.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/pflocal/io.c b/pflocal/io.c
index bae8317d..02dfbd40 100644
--- a/pflocal/io.c
+++ b/pflocal/io.c
@@ -394,20 +394,28 @@ S_io_reauthenticate (struct sock_user *user, mach_port_t rendezvous)
if (!user)
return EOPNOTSUPP;
-
- err = sock_create_port (user->sock, &new_user_port);
+
+ do
+ err = sock_create_port (user->sock, &new_user_port);
+ while (err == EINTR);
if (err)
return err;
auth_server = getauth ();
- err =
- auth_server_authenticate (auth_server,
- rendezvous, MACH_MSG_TYPE_COPY_SEND,
- new_user_port, MACH_MSG_TYPE_MAKE_SEND,
- &uids, &num_uids, &aux_uids, &num_aux_uids,
- &gids, &num_gids, &aux_gids, &num_aux_gids);
+ err = mach_port_insert_right (mach_task_self (), new_user_port,
+ new_user_port, MACH_MSG_TYPE_MAKE_SEND);
+ assert_perror (err);
+ do
+ err =
+ auth_server_authenticate (auth_server,
+ rendezvous, MACH_MSG_TYPE_COPY_SEND,
+ new_user_port, MACH_MSG_TYPE_COPY_SEND,
+ &uids, &num_uids, &aux_uids, &num_aux_uids,
+ &gids, &num_gids, &aux_gids, &num_aux_gids);
+ while (err == EINTR);
mach_port_deallocate (mach_task_self (), rendezvous);
mach_port_deallocate (mach_task_self (), auth_server);
+ mach_port_deallocate (mach_task_self (), new_user_port);
/* Throw away the ids we went through all that trouble to get... */
#define TRASH_IDS(ids, buf, num) \