From c027651cd57ac9785057b1d11aa1595ffd0edf60 Mon Sep 17 00:00:00 2001 From: Thomas Bushnell Date: Fri, 17 Mar 2000 17:22:33 +0000 Subject: 2000-03-17 Thomas Bushnell, BSG * exec-reauth.c (exec_reauth): Always destroy REF, even when we get errors. --- libshouldbeinlibc/ChangeLog | 5 +++++ libshouldbeinlibc/exec-reauth.c | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/libshouldbeinlibc/ChangeLog b/libshouldbeinlibc/ChangeLog index fd6ec7c8..c9f3008f 100644 --- a/libshouldbeinlibc/ChangeLog +++ b/libshouldbeinlibc/ChangeLog @@ -1,3 +1,8 @@ +2000-03-17 Thomas Bushnell, BSG + + * exec-reauth.c (exec_reauth): Always destroy REF, even when we + get errors. + 2000-01-29 Roland McGrath * maptime.h: Include for error_t decl. 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 , but really written by Michael I. Bushnell p/BSG @@ -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; } -- cgit v1.2.3