aboutsummaryrefslogtreecommitdiff
path: root/hurd/hurdsig.c
diff options
context:
space:
mode:
Diffstat (limited to 'hurd/hurdsig.c')
-rw-r--r--hurd/hurdsig.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/hurd/hurdsig.c b/hurd/hurdsig.c
index 81c109c..0c8ed14 100644
--- a/hurd/hurdsig.c
+++ b/hurd/hurdsig.c
@@ -22,6 +22,7 @@
#include <hurd/signal.h>
#include <cthreads.h> /* For `struct mutex'. */
#include <string.h>
+#include <hurd/id.h>
#include "hurdfault.h"
#include "hurdmalloc.h" /* XXX */
@@ -1239,6 +1240,16 @@ reauth_proc (mach_port_t new)
__mach_port_deallocate (__mach_task_self (), ignore);
__mach_port_destroy (__mach_task_self (), ref);
+ /* Set the owner of the process here too. */
+ mutex_lock (&_hurd_id.lock);
+ if (!_hurd_check_ids ())
+ HURD_PORT_USE (&_hurd_ports[INIT_PORT_PROC],
+ __proc_setowner (port,
+ (_hurd_id.gen.nuids
+ ? _hurd_id.gen.uids[0] : 0),
+ !_hurd_id.gen.nuids));
+ mutex_unlock (&_hurd_id.lock);
+
(void) &reauth_proc; /* Silence compiler warning. */
}
text_set_element (_hurd_reauth_hook, reauth_proc);