diff options
author | Brian Feldman <green@FreeBSD.org> | 2000-08-22 02:15:54 +0000 |
---|---|---|
committer | Brian Feldman <green@FreeBSD.org> | 2000-08-22 02:15:54 +0000 |
commit | c12b6d6f889a718321f8a3ac8ae7ed1be7214a38 (patch) | |
tree | 0a1c6d55bfd868c7a83a1a98bc257704733a3ae7 /libutil | |
parent | 7a3060dbeb091c0726ae2c747db95f95b23b65e6 (diff) | |
download | pw-darwin-c12b6d6f889a718321f8a3ac8ae7ed1be7214a38.tar.gz pw-darwin-c12b6d6f889a718321f8a3ac8ae7ed1be7214a38.tar.zst pw-darwin-c12b6d6f889a718321f8a3ac8ae7ed1be7214a38.zip |
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 'libutil')
-rw-r--r-- | libutil/login_cap.c | 13 | ||||
-rw-r--r-- | libutil/login_cap.h | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/libutil/login_cap.c b/libutil/login_cap.c index b7528b9..7410380 100644 --- a/libutil/login_cap.c +++ b/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); +} diff --git a/libutil/login_cap.h b/libutil/login_cap.h index f4b3825..1320278 100644 --- a/libutil/login_cap.h +++ b/libutil/login_cap.h @@ -110,6 +110,7 @@ rlim_t login_getcapnum __P((login_cap_t *, const char *, rlim_t, rlim_t)); rlim_t login_getcapsize __P((login_cap_t *, const char *, rlim_t, rlim_t)); char *login_getpath __P((login_cap_t *, const char *, char *)); int login_getcapbool __P((login_cap_t *, const char *, int)); +const char *login_setcryptfmt __P((login_cap_t *, const char *, const char *)); int setclasscontext __P((const char*, unsigned int)); int setusercontext __P((login_cap_t*, const struct passwd*, uid_t, unsigned int)); |