summaryrefslogtreecommitdiff
path: root/utils/setauth.c
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1997-09-29 21:57:13 +0000
committerMiles Bader <miles@gnu.org>1997-09-29 21:57:13 +0000
commit809f1eab77fc717c220a02b4150569b62c4caf3d (patch)
tree3c9e537b287093f0ffbbb57c70d13a2e583ceef6 /utils/setauth.c
parent2414fffb156b8ffd627719b6e216ce6a6702635c (diff)
(main):
Supply new args to frobauth_modify. Use ugids_verify_make_auth instead of ugids_verify and ugids_make_auth.
Diffstat (limited to 'utils/setauth.c')
-rw-r--r--utils/setauth.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/utils/setauth.c b/utils/setauth.c
index 92b6816a..a039e3c6 100644
--- a/utils/setauth.c
+++ b/utils/setauth.c
@@ -56,6 +56,7 @@ void
main (int argc, char *argv[])
{
error_t err;
+ auth_t auth; /* Authority to make changes. */
int save = 0, keep = 0;
struct idvec have_uids = IDVEC_INIT, have_gids = IDVEC_INIT;
struct frobauth frobauth = FROBAUTH_INIT;
@@ -119,13 +120,14 @@ 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");
+ error (16, err, "Authentication failure");
- if (frobauth_modify (&frobauth, modify, print_info, 0))
+ if (frobauth_modify (&frobauth, &auth, 1, modify, print_info, 0))
exit (0);
else
exit (1);