From owner-svn-src-head@freebsd.org Fri Sep 4 04:31:57 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 519C73D5D55; Fri, 4 Sep 2020 04:31:57 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BjPs91RDgz4VN1; Fri, 4 Sep 2020 04:31:57 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1469626CCC; Fri, 4 Sep 2020 04:31:57 +0000 (UTC) (envelope-from stevek@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0844VuJ2086641; Fri, 4 Sep 2020 04:31:56 GMT (envelope-from stevek@FreeBSD.org) Received: (from stevek@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0844Vup9086639; Fri, 4 Sep 2020 04:31:56 GMT (envelope-from stevek@FreeBSD.org) Message-Id: <202009040431.0844Vup9086639@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: stevek set sender to stevek@FreeBSD.org using -f From: "Stephen J. Kiernan" Date: Fri, 4 Sep 2020 04:31:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r365325 - head/usr.sbin/fmtree X-SVN-Group: head X-SVN-Commit-Author: stevek X-SVN-Commit-Paths: head/usr.sbin/fmtree X-SVN-Commit-Revision: 365325 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Sep 2020 04:31:57 -0000 Author: stevek Date: Fri Sep 4 04:31:56 2020 New Revision: 365325 URL: https://svnweb.freebsd.org/changeset/base/365325 Log: Avoid collisions with function names in openssl headers. Just using MD5, SHA1, RMD160 and SHA256 for defines collides with functions of the same name in OpenSSL. This can cause compilation issues in downstream consumers if they use OpenSSL for the hash functions instead of libmd. Reviewed by: sjg Obtained from: Juniper Networks, Inc. Differential Revision: https://reviews.freebsd.org/D26321 Modified: head/usr.sbin/fmtree/Makefile head/usr.sbin/fmtree/compare.c Modified: head/usr.sbin/fmtree/Makefile ============================================================================== --- head/usr.sbin/fmtree/Makefile Fri Sep 4 02:22:27 2020 (r365324) +++ head/usr.sbin/fmtree/Makefile Fri Sep 4 04:31:56 2020 (r365325) @@ -10,7 +10,7 @@ MAN= fmtree.8 SRCS= compare.c crc.c create.c excludes.c misc.c mtree.c spec.c verify.c SRCS+= specspec.c -CFLAGS+= -DMD5 -DSHA1 -DRMD160 -DSHA256 +CFLAGS+= -DWITH_MD5 -DWITH_SHA1 -DWITH_RMD160 -DWITH_SHA256 LIBADD= md CLEANFILES+= fmtree.8 Modified: head/usr.sbin/fmtree/compare.c ============================================================================== --- head/usr.sbin/fmtree/compare.c Fri Sep 4 02:22:27 2020 (r365324) +++ head/usr.sbin/fmtree/compare.c Fri Sep 4 04:31:56 2020 (r365325) @@ -43,16 +43,16 @@ __FBSDID("$FreeBSD$"); #include #include #include -#ifdef MD5 +#ifdef WITH_MD5 #include #endif -#ifdef RMD160 +#ifdef WITH_RMD160 #include #endif -#ifdef SHA1 +#ifdef WITH_SHA1 #include #endif -#ifdef SHA256 +#ifdef WITH_SHA256 #include #endif #include @@ -244,7 +244,7 @@ typeerr: LABEL; (void)printf("\n"); tab = "\t"; } -#ifdef MD5 +#ifdef WITH_MD5 if (s->flags & F_MD5) { char *new_digest, buf[33]; @@ -262,7 +262,7 @@ typeerr: LABEL; } } #endif /* MD5 */ -#ifdef SHA1 +#ifdef WITH_SHA1 if (s->flags & F_SHA1) { char *new_digest, buf[41]; @@ -280,7 +280,7 @@ typeerr: LABEL; } } #endif /* SHA1 */ -#ifdef RMD160 +#ifdef WITH_RMD160 if (s->flags & F_RMD160) { char *new_digest, buf[41]; @@ -298,7 +298,7 @@ typeerr: LABEL; } } #endif /* RMD160 */ -#ifdef SHA256 +#ifdef WITH_SHA256 if (s->flags & F_SHA256) { char *new_digest, buf[65];