From 453b034ca51b86a83f3b82b3d4fa68c0d56ba801 Mon Sep 17 00:00:00 2001 From: Benjamin Gilbert Date: Fri, 8 Nov 2019 19:46:24 -0500 Subject: [PATCH] dev-libs/openssl: Apply CoreOS changes - Drop pkg_postinst. - Create /etc/ssl with tmpfiles (and package it for the SDK). --- .../dev-libs/openssl/files/openssl.conf | 3 +++ .../dev-libs/openssl/openssl-1.0.2u.ebuild | 24 +++++++++---------- 2 files changed, 14 insertions(+), 13 deletions(-) create mode 100644 sdk_container/src/third_party/coreos-overlay/dev-libs/openssl/files/openssl.conf diff --git a/sdk_container/src/third_party/coreos-overlay/dev-libs/openssl/files/openssl.conf b/sdk_container/src/third_party/coreos-overlay/dev-libs/openssl/files/openssl.conf new file mode 100644 index 0000000000..ce86101ce7 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/dev-libs/openssl/files/openssl.conf @@ -0,0 +1,3 @@ +d /etc/ssl - - - - - +d /etc/ssl/private 0700 - - - - +L /etc/ssl/openssl.cnf - - - - ../../usr/share/ssl/openssl.cnf diff --git a/sdk_container/src/third_party/coreos-overlay/dev-libs/openssl/openssl-1.0.2u.ebuild b/sdk_container/src/third_party/coreos-overlay/dev-libs/openssl/openssl-1.0.2u.ebuild index ab6d946a8b..8897acef02 100644 --- a/sdk_container/src/third_party/coreos-overlay/dev-libs/openssl/openssl-1.0.2u.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/dev-libs/openssl/openssl-1.0.2u.ebuild @@ -3,7 +3,7 @@ EAPI="7" -inherit flag-o-matic toolchain-funcs multilib multilib-minimal +inherit flag-o-matic toolchain-funcs multilib multilib-minimal systemd # openssl-1.0.2-patches-1.6 contain additional CVE patches # which got fixed with this release. @@ -267,11 +267,6 @@ multilib_src_install_all() { # twice; once with shared lib support enabled and once without. use static-libs || rm -f "${ED}"/usr/lib*/lib*.a - # create the certs directory - dodir ${SSL_CNF_DIR}/certs - cp -RP certs/* "${ED}"${SSL_CNF_DIR}/certs/ || die - rm -r "${ED}"${SSL_CNF_DIR}/certs/{demo,expired} - # Namespace openssl programs to prevent conflicts with other man pages cd "${ED}"/usr/share/man local m d s @@ -297,12 +292,15 @@ multilib_src_install_all() { dodir /etc/sandbox.d #254521 echo 'SANDBOX_PREDICT="/dev/crypto"' > "${ED}"/etc/sandbox.d/10openssl - diropts -m0700 - keepdir ${SSL_CNF_DIR}/private -} + # Don't keep the sample CA files and their ilk in /etc. + rm -r "${ED}"${SSL_CNF_DIR} -pkg_postinst() { - ebegin "Running 'c_rehash ${EROOT}${SSL_CNF_DIR}/certs/' to rebuild hashes #333069" - c_rehash "${EROOT}${SSL_CNF_DIR}/certs" >/dev/null - eend $? + # Save the default openssl.cnf in /usr and link it into place. + dodir /usr/share/ssl + insinto /usr/share/ssl + doins "${S}"/apps/openssl.cnf + systemd_dotmpfilesd "${FILESDIR}"/openssl.conf + + # Package the tmpfiles.d setup for SDK bootstrapping. + systemd-tmpfiles --create --root="${ED}" "${FILESDIR}"/openssl.conf }