aboutsummaryrefslogtreecommitdiff
path: root/utils/addauth.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils/addauth.c')
-rw-r--r--utils/addauth.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/utils/addauth.c b/utils/addauth.c
index 4cf221cf..0932a33f 100644
--- a/utils/addauth.c
+++ b/utils/addauth.c
@@ -1,6 +1,6 @@
/* Add authentication to selected processes
- Copyright (C) 1997 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998 Free Software Foundation, Inc.
Written by Miles Bader <miles@gnu.ai.mit.edu>
@@ -41,7 +41,7 @@ static char doc[] =
extern error_t
get_nonsugid_ids (struct idvec *uids, struct idvec *gids);
-void
+int
main (int argc, char *argv[])
{
int i;
@@ -64,16 +64,12 @@ main (int argc, char *argv[])
error (52, err, "Cannot get invoking authentication");
/* Check passwords. */
- err = ugids_verify (&frobauth.ugids, &have_uids, &have_gids, 0);
- if (err == EINVAL)
+ err = ugids_verify_make_auth (&frobauth.ugids, &have_uids, &have_gids, 0, 0,
+ 0, 0, &auth);
+ if (err == EACCES)
error (15, 0, "Invalid password");
else if (err)
- error (16, err, "Cannot verify authentication");
-
- /* Make an auth port with the new ids. */
- err = ugids_make_auth (&frobauth.ugids, MACH_PORT_NULL, &auth);
- if (err)
- error (3, err, "Authentication failure");
+ error (16, err, "Authentication failure");
if (frobauth.verbose)
/* A string showing which ids we will add. */
@@ -100,5 +96,5 @@ main (int argc, char *argv[])
}
}
- exit (0);
+ return 0;
}