summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1997-09-29 21:58:32 +0000
committerMiles Bader <miles@gnu.org>1997-09-29 21:58:32 +0000
commit7909062355ecc2e2b2a3544b807d4bf627826c55 (patch)
tree1fd1c9b364b3e6b248f6b8356a3897063e61f919
parent809f1eab77fc717c220a02b4150569b62c4caf3d (diff)
(main):
Use ugids_verify_make_auth instead of ugids_verify and ugids_make_auth.
-rw-r--r--utils/addauth.c12
-rw-r--r--utils/login.c11
2 files changed, 8 insertions, 15 deletions
diff --git a/utils/addauth.c b/utils/addauth.c
index 4cf221cf..7c199989 100644
--- a/utils/addauth.c
+++ b/utils/addauth.c
@@ -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. */
diff --git a/utils/login.c b/utils/login.c
index c22a379a..a9b3d8b8 100644
--- a/utils/login.c
+++ b/utils/login.c
@@ -581,11 +581,12 @@ main(int argc, char *argv[])
argp_parse (&argp, argc, argv, ARGP_IN_ORDER, 0, 0);
/* Check passwords where necessary. */
- err = ugids_verify (&ugids, &parent_uids, &parent_gids, 0);
- if (err == EINVAL)
+ err = ugids_verify_make_auth (&ugids, &parent_uids, &parent_gids, 0, 0,
+ 0, 0, &auth);
+ if (err == EACCES)
fail (5, 0, "Invalid password", 0);
else if (err)
- error (5, err, "Checking passwords");
+ error (5, err, "Authentication failure");
/* Now that we've parsed the command line, put together all these
environments we've gotten from various places. There are two targets:
@@ -642,10 +643,6 @@ main(int argc, char *argv[])
free (passwd);
}
- err = ugids_make_auth (&ugids, MACH_PORT_NULL, &auth);
- if (err)
- fail (3, err, "Authentication failure", 0);
-
err = proc_getsid (proc_server, pid, &sid);
assert_perror (err); /* This should never fail. */