summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>1999-05-02 01:10:51 +0000
committerRoland McGrath <roland@gnu.org>1999-05-02 01:10:51 +0000
commit13d6b6fe1ba509e64dc37aacf52e8596412b8a1a (patch)
tree7a66535dc00dc69e6d7a2015cc3865fc51c320de
parent53b49c423725d276b9d0fd59d9d088e2305176e8 (diff)
1999-05-01 Roland McGrath <roland@baalperazim.frob.com>
* auth.c (main): Give diagnostics for lack of bootstrap port or failure of startup_authinit RPC.
-rw-r--r--auth/auth.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/auth/auth.c b/auth/auth.c
index 98c5cc09..a0888848 100644
--- a/auth/auth.c
+++ b/auth/auth.c
@@ -1,5 +1,5 @@
/* Authentication server.
- Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
Written by Roland McGrath.
This file is part of the GNU Hurd.
@@ -137,7 +137,7 @@ S_auth_makeauth (struct authhandle *auth,
/* Fetch the auth structures for all the ports passed in. */
for (i = 0; i < nauths; i++)
auths[i + 1] = auth_port_to_handle (authpts[i]);
-
+
++nauths;
/* Verify that the union of the handles passed in either contains euid 0
@@ -460,9 +460,14 @@ main (int argc, char **argv)
idvec_merge (&firstauth->agids, &firstauth->auids);
/* Fetch our bootstrap port and contact the bootstrap filesystem. */
- task_get_bootstrap_port (mach_task_self (), &boot);
- startup_authinit (boot, ports_get_right (firstauth),
- MACH_MSG_TYPE_MAKE_SEND, &proc);
+ err = task_get_bootstrap_port (mach_task_self (), &boot);
+ assert_perror (err);
+ if (boot == MACH_PORT_NULL)
+ error (2, 0, "auth server can only be run by init during boot");
+ err = startup_authinit (boot, ports_get_right (firstauth),
+ MACH_MSG_TYPE_MAKE_SEND, &proc);
+ if (err)
+ error (2, err, "cannot contact init for bootstrap");
/* Register ourselves with the proc server and then start signals. */
proc_getprivports (proc, &hostpriv, &masterdev);