diff options
author | green <green@FreeBSD.org> | 2000-08-22 02:15:54 +0000 |
---|---|---|
committer | green <green@FreeBSD.org> | 2000-08-22 02:15:54 +0000 |
commit | 67c40ef892e23a375a1eeec51d343ef6be31f5d8 (patch) | |
tree | 7fd6719b0a54565971e388646c8ae7f62b08674b /lib/libutil/login_cap.c | |
parent | 219e29595a8d293c1e81f0136a866f25a69d648e (diff) | |
download | FreeBSD-src-67c40ef892e23a375a1eeec51d343ef6be31f5d8.zip FreeBSD-src-67c40ef892e23a375a1eeec51d343ef6be31f5d8.tar.gz |
Add working and easy crypt(3)-switching. Yes, we need a whole new API
for crypt(3) by now. In any case:
Add crypt_set_format(3) + documentation to -lcrypt.
Add login_setcryptfmt(3) + documentation to -lutil.
Support for switching crypt formats in passwd(8).
Support for switching crypt formats in pw(8).
The simple synopsis is:
edit login.conf; add a passwd_format field set to "des" or "md5"; go nuts :)
Reviewed by: peter
Diffstat (limited to 'lib/libutil/login_cap.c')
-rw-r--r-- | lib/libutil/login_cap.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/libutil/login_cap.c b/lib/libutil/login_cap.c index b7528b9..7410380 100644 --- a/lib/libutil/login_cap.c +++ b/lib/libutil/login_cap.c @@ -798,3 +798,16 @@ login_getstyle(login_cap_t *lc, char *style, const char *auth) return lc->lc_style; } + +const char * +login_setcryptfmt(login_cap_t *lc, const char *def, const char *error) +{ + const char *cipher; + + cipher = login_getcapstr(lc, "passwd_format", def, NULL); + if (cipher == NULL) + return (error); + if (!crypt_set_format(cipher)) + return (error); + return (cipher); +} |