summaryrefslogtreecommitdiff
path: root/libshouldbeinlibc/exec-reauth.c
diff options
context:
space:
mode:
authorThomas Bushnell <thomas@gnu.org>2000-03-17 17:22:33 +0000
committerThomas Bushnell <thomas@gnu.org>2000-03-17 17:22:33 +0000
commitc027651cd57ac9785057b1d11aa1595ffd0edf60 (patch)
treed0fac0200f8db09f05a9726c52b78543f8bdc924 /libshouldbeinlibc/exec-reauth.c
parenta1bd308813e6890f5877b10a1a0984d822c84b7e (diff)
2000-03-17 Thomas Bushnell, BSG <tb@mit.edu>
* exec-reauth.c (exec_reauth): Always destroy REF, even when we get errors.
Diffstat (limited to 'libshouldbeinlibc/exec-reauth.c')
-rw-r--r--libshouldbeinlibc/exec-reauth.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libshouldbeinlibc/exec-reauth.c b/libshouldbeinlibc/exec-reauth.c
index 1ddfcefa..dd267ef7 100644
--- a/libshouldbeinlibc/exec-reauth.c
+++ b/libshouldbeinlibc/exec-reauth.c
@@ -1,6 +1,6 @@
/* Re-authentication in preparation for an exec
- Copyright (C) 1995, 96, 98 Free Software Foundation, Inc.
+ Copyright (C) 1995, 96, 98, 2000 Free Software Foundation, Inc.
Stolen by Miles Bader <miles@gnu.ai.mit.edu>, but really
written by Michael I. Bushnell p/BSG <mib@gnu.ai.mit.edu>
@@ -54,9 +54,12 @@ exec_reauth (auth_t auth, int secure, int must_reauth,
(isproc ? proc_reauthenticate : io_reauthenticate)
(*port, ref, MACH_MSG_TYPE_MAKE_SEND);
+ /* MAKE_SEND is safe here because we destroy REF ourselves. */
+
if (!err)
err = auth_user_authenticate (auth, ref, MACH_MSG_TYPE_MAKE_SEND,
&newport);
+ mach_port_destroy (mach_task_self (), ref);
if (err)
{
if (must_reauth)
@@ -73,7 +76,6 @@ exec_reauth (auth_t auth, int secure, int must_reauth,
*port = newport;
}
}
- mach_port_destroy (mach_task_self (), ref);
}
return 0;
}