From owner-svn-src-all@FreeBSD.ORG Tue Jun 12 17:14:20 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1A287106564A; Tue, 12 Jun 2012 17:14:20 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E00F18FC0C; Tue, 12 Jun 2012 17:14:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5CHEJHf065659; Tue, 12 Jun 2012 17:14:19 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5CHEJhY065655; Tue, 12 Jun 2012 17:14:19 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201206121714.q5CHEJhY065655@svn.freebsd.org> From: Dag-Erling Smorgrav Date: Tue, 12 Jun 2012 17:14:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236967 - head/lib/libcrypt X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jun 2012 17:14:20 -0000 Author: des Date: Tue Jun 12 17:14:19 2012 New Revision: 236967 URL: http://svn.freebsd.org/changeset/base/236967 Log: 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 Modified: head/lib/libcrypt/Makefile head/lib/libcrypt/crypt.3 head/lib/libcrypt/crypt.c Modified: head/lib/libcrypt/Makefile ============================================================================== --- head/lib/libcrypt/Makefile Tue Jun 12 17:04:56 2012 (r236966) +++ head/lib/libcrypt/Makefile Tue Jun 12 17:14:19 2012 (r236967) @@ -26,11 +26,7 @@ SRCS+= crypt-des.c crypt-blowfish.c blo CFLAGS+= -I${.CURDIR} -DHAS_DES -DHAS_BLOWFISH .endif -# And the auth_getval() code and support. -.PATH: ${.CURDIR}/../libutil -SRCS+= auth.c property.c -.for sym in auth_getval property_find properties_read properties_free \ - MD4Init MD4Final MD4Update MD4Pad \ +.for sym in MD4Init MD4Final MD4Update MD4Pad \ MD5Init MD5Final MD5Update MD5Pad \ SHA256_Init SHA256_Final SHA256_Update \ SHA512_Init SHA512_Final SHA512_Update Modified: head/lib/libcrypt/crypt.3 ============================================================================== --- head/lib/libcrypt/crypt.3 Tue Jun 12 17:04:56 2012 (r236966) +++ head/lib/libcrypt/crypt.3 Tue Jun 12 17:14:19 2012 (r236967) @@ -238,12 +238,6 @@ The .Fn crypt_set_format function sets the default encoding format according to the supplied .Fa string . -.Pp -The global default format can be set using the -.Pa /etc/auth.conf -file using the -.Va crypt_default -property. .Sh RETURN VALUES The .Fn crypt @@ -260,9 +254,7 @@ Otherwise, a value of 0 is returned. .Sh SEE ALSO .Xr login 1 , .Xr passwd 1 , -.Xr auth_getval 3 , .Xr getpass 3 , -.Xr auth.conf 5 , .Xr passwd 5 .Sh HISTORY A rotor-based Modified: head/lib/libcrypt/crypt.c ============================================================================== --- head/lib/libcrypt/crypt.c Tue Jun 12 17:04:56 2012 (r236966) +++ head/lib/libcrypt/crypt.c Tue Jun 12 17:14:19 2012 (r236967) @@ -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; }