diff options
author | Thomas Bushnell <thomas@gnu.org> | 1999-04-26 01:40:11 +0000 |
---|---|---|
committer | Thomas Bushnell <thomas@gnu.org> | 1999-04-26 01:40:11 +0000 |
commit | 6ac4feb602d86010c815100e2b02a8ec60d01929 (patch) | |
tree | a4ab86f29ebb7bc063dc3a205dac65cbf8c74dd7 /libshouldbeinlibc | |
parent | d4f6b14d4efded20df1eae0a2f027ff55b0fb5d2 (diff) |
1998-12-21 Mark Kettenis <kettenis@phys.uva.nl>
* ugids-verify-auth.c: Include <hurd/password.h> again and remove
temporary definitions of password_check_user and
password_check_group.
1998-11-29 Mark Kettenis <kettenis@phys.uva.nl>
* idvec-verify.c (verify_passwd): Grant access when the password
in the passwd DB is empty.
(verify_id): Also call verify_fn when the password in the password
DB is empty.
Diffstat (limited to 'libshouldbeinlibc')
-rw-r--r-- | libshouldbeinlibc/ChangeLog | 13 | ||||
-rw-r--r-- | libshouldbeinlibc/idvec-verify.c | 13 | ||||
-rw-r--r-- | libshouldbeinlibc/ugids-verify-auth.c | 25 |
3 files changed, 25 insertions, 26 deletions
diff --git a/libshouldbeinlibc/ChangeLog b/libshouldbeinlibc/ChangeLog index 12fbb1c3..8ab5a69c 100644 --- a/libshouldbeinlibc/ChangeLog +++ b/libshouldbeinlibc/ChangeLog @@ -1,3 +1,16 @@ +1998-12-21 Mark Kettenis <kettenis@phys.uva.nl> + + * ugids-verify-auth.c: Include <hurd/password.h> again and remove + temporary definitions of password_check_user and + password_check_group. + +1998-11-29 Mark Kettenis <kettenis@phys.uva.nl> + + * idvec-verify.c (verify_passwd): Grant access when the password + in the passwd DB is empty. + (verify_id): Also call verify_fn when the password in the password + DB is empty. + 1999-02-12 Gordon Matzigkeit <gord@trick.fig.org> * Makefile (LCLHDRS): Purge argp-fmtstream.h and argp-namefrob.h. diff --git a/libshouldbeinlibc/idvec-verify.c b/libshouldbeinlibc/idvec-verify.c index 11ab2c22..bee4376f 100644 --- a/libshouldbeinlibc/idvec-verify.c +++ b/libshouldbeinlibc/idvec-verify.c @@ -65,6 +65,9 @@ verify_passwd (const char *password, ? ((struct passwd *)pwd_or_grp)->pw_passwd : ((struct group *)pwd_or_grp)->gr_passwd); + if (sys_encrypted && !*sys_encrypted) + return 0; /* No password. */ + if (crypt) /* Encrypt the password entered by the user (SYS_ENCRYPTED is the salt). */ encrypted = crypt (password, sys_encrypted); @@ -232,6 +235,9 @@ verify_id (uid_t id, int is_group, int multiple, char *prompt = 0, *password; char id_lookup_buf[1024]; + /* VERIFY_FN should have been defaulted in idvec_verify if necessary. */ + assert (verify_fn); + if (id >= 0) do { @@ -242,7 +248,7 @@ verify_id (uid_t id, int is_group, int multiple, == 0) { if (!gr->gr_passwd || !*gr->gr_passwd) - return 0; /* No password. */ + return (*verify_fn) ("", id, 1, gr, verify_hook); name = gr->gr_name; pwd_or_grp = gr; } @@ -254,7 +260,7 @@ verify_id (uid_t id, int is_group, int multiple, == 0) { if (!pw->pw_passwd || !*pw->pw_passwd) - return 0; /* No password. */ + return (*verify_fn) ("", id, 0, pw, verify_hook); name = pw->pw_name; pwd_or_grp = pw; } @@ -282,9 +288,6 @@ verify_id (uid_t id, int is_group, int multiple, /* Default GETPASS_FN to using getpass. */ getpass_fn = get_passwd; - /* VERIFY_FN should have been defaulted in idvec_verify if necessary. */ - assert (verify_fn); - if (multiple) { if (name) diff --git a/libshouldbeinlibc/ugids-verify-auth.c b/libshouldbeinlibc/ugids-verify-auth.c index 000e4126..91fa06e9 100644 --- a/libshouldbeinlibc/ugids-verify-auth.c +++ b/libshouldbeinlibc/ugids-verify-auth.c @@ -28,28 +28,10 @@ #include <grp.h> #include <hurd/paths.h> -/*#include <hurd/password.h>*/ /* XXX commented out until new libc installed */ +#include <hurd/password.h> #include "ugids.h" -/* XXXX these are dummies to use until libc gets re-installed. - The weak symbols should make the real libhurduser.so versions - get used as soon as they exist, even though we didn't #include - the header. When they are available in a working libc dist, - then this page can be removed and the #include above uncommented. */ -#pragma weak password_check_user -error_t -password_check_user (io_t a, uid_t b, const char *c, auth_t *d) -{ - return ENOSYS; -} -#pragma weak password_check_group -error_t -password_check_group (io_t a, uid_t b, const char *c, auth_t *d) -{ - return ENOSYS; -} - /* Accumulated information from authentication various passwords. */ struct svma_state { @@ -93,7 +75,7 @@ server_verify_make_auth (const char *password, error_t err = (*check) (svma_state->server, id, password, &auth); if (! err) - /* PASSWORD checked out ok; the corresponding authentication is in AUTH. */ + /* PASSWORD checked out ok; the corresponding authentication is in AUTH. */ { err = svma_state_add_auths (svma_state, &auth, 1); if (err) @@ -113,7 +95,8 @@ server_verify_make_auth (const char *password, for the idvec_verify function in <idvec.h>. */ error_t ugids_verify_make_auth (const struct ugids *ugids, - const struct idvec *have_uids, const struct idvec *have_gids, + const struct idvec *have_uids, + const struct idvec *have_gids, char *(*getpass_fn) (const char *prompt, uid_t id, int is_group, void *pwd_or_grp, void *hook), |