diff options
author | des <des@FreeBSD.org> | 2012-06-12 17:14:19 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 2012-06-12 17:14:19 +0000 |
commit | 249696a5bb352b7a4d02a3b8751b260a54cf4179 (patch) | |
tree | 9cd4e433872bd87e319e56a6c61363dc6ddc2ae9 /lib/libcrypt/crypt.c | |
parent | 0dd2f4334c397648162b0c1fc1698fbb8a41e32a (diff) | |
download | FreeBSD-src-249696a5bb352b7a4d02a3b8751b260a54cf4179.zip FreeBSD-src-249696a5bb352b7a4d02a3b8751b260a54cf4179.tar.gz |
Stop using auth_getval() now that it always returns NULL. Instead,
hardcode the default to what it would be if we didn't hardcode it,
i.e. DES if supported and MD5 otherwise.
MFC after: 3 weeks
Diffstat (limited to 'lib/libcrypt/crypt.c')
-rw-r--r-- | lib/libcrypt/crypt.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/libcrypt/crypt.c b/lib/libcrypt/crypt.c index b949a48..bfcbb20 100644 --- a/lib/libcrypt/crypt.c +++ b/lib/libcrypt/crypt.c @@ -79,23 +79,23 @@ static const struct { } }; +#ifdef HAS_DES +#define CRYPT_DEFAULT "des" +#else +#define CRYPT_DEFAULT "md5" +#endif + static int crypt_type = -1; static void crypt_setdefault(void) { - char *def; size_t i; if (crypt_type != -1) return; - def = auth_getval("crypt_default"); - if (def == NULL) { - crypt_type = 0; - return; - } for (i = 0; i < sizeof(crypt_types) / sizeof(crypt_types[0]) - 1; i++) { - if (strcmp(def, crypt_types[i].name) == 0) { + if (strcmp(CRYPT_DEFAULT, crypt_types[i].name) == 0) { crypt_type = (int)i; return; } |