diff options
Diffstat (limited to 'sys-apps/systemd')
-rw-r--r-- | sys-apps/systemd/Manifest | 8 | ||||
-rw-r--r-- | sys-apps/systemd/files/CVE-2017-15908.patch | 39 | ||||
-rw-r--r-- | sys-apps/systemd/files/CVE-2017-9217.patch | 28 | ||||
-rw-r--r-- | sys-apps/systemd/systemd-233-r5.ebuild (renamed from sys-apps/systemd/systemd-234-r4.ebuild) | 315 | ||||
-rw-r--r-- | sys-apps/systemd/systemd-233-r6.ebuild | 462 | ||||
-rw-r--r-- | sys-apps/systemd/systemd-235-r1.ebuild (renamed from sys-apps/systemd/systemd-235.ebuild) | 1 |
6 files changed, 698 insertions, 155 deletions
diff --git a/sys-apps/systemd/Manifest b/sys-apps/systemd/Manifest index 53172a8a8606..116976977f0b 100644 --- a/sys-apps/systemd/Manifest +++ b/sys-apps/systemd/Manifest @@ -12,15 +12,17 @@ AUX 234-0004-logind-make-sure-we-don-t-process-the-same-method-ca.patch 821 SHA2 AUX 234-uucp-group.patch 536 SHA256 b3ef6c7d40d86dfc801ff7839876dcffb299d0b6d5b11fbf081adfe51ee0d8e6 SHA512 6ffaa3b50f36598682019c1c6b171ad121d57ba9cfd379be5f46f64621dc026a82069922b78a62a5c477bb117e700a31e0315872d78378755cd4150abd22a912 WHIRLPOOL dc9bbd2879af33a8ff27e7a13052c51b4ddc1b336bbd58ed0b5e28bb63229acbb355b6316cc58555b12eee8ed2d73ba25ee21286e8e0f429d6760e70dc6de5a4 AUX 235-0001-test-skip-hwdb-and-sysv-generator-if-the-features-ar.patch 1280 SHA256 a448c39a3d172c03edf4ac303b02251d3c09a9d21c2512ae475c1a92905b97af SHA512 70dd0b3ed7926fc2406aae8fc592ba7bbbf9bdd94151d3045d94683921f2921dbe8184f7184e4e5a9cd4bf1556ddb93f20f741df3bead3c664f4c71757e75376 WHIRLPOOL bd3aeda654fffd90e2b49757f5bdc483284d034a78f134f3c2b1870f11f35d9604d6105b159ff9cd879bb82c57536e363d8bf8cbba1878514cfc894ca009a47f AUX 235-0002-networkd-Don-t-stop-networkd-if-CONFIG_FIB_RULES-n-i.patch 2620 SHA256 0211aba9502c23e51e154fccdad7712d729caea3869f969313b9dbf08474641a SHA512 52bf63183930872c44c0dc53a616c75a4ae37ffedfcf34b2b5e400994b334d311b2afcadd75e91dd6c37a88cab71e30d2d6690261a980ea5dfc056b67d7e2e78 WHIRLPOOL 1f3c1fcc5a161644785aae482d97e2007150d47beae4372fdb30805f291b33e21d2e8e16ea6bc4cc9cf8c0fbd3d8ddfff2504af1e568c519b2398411eca9458e +AUX CVE-2017-15908.patch 1371 SHA256 b0651db043115e8251a4efccad369f917d4e8ffcfdd011baa93f99ebea0e03ea SHA512 e3ca9cb44981a7a5d80a7ca63d6c9249e42dc5af1290ecfd472ec377db4ac372a18c3a3b6a99e1b7cfa322f7c00f0a755c916f67273b0b1e0a0e37957035aba9 WHIRLPOOL f19731b7211060ffa3154bdd227840683bcac2ae5fcd6b18b1639b92a5212a0ed6c69b29b0938ea3b9c90b3c8dcaa31db4045cef6f1bf5dbc60c9ae1eacffcc8 +AUX CVE-2017-9217.patch 863 SHA256 d56929985fcabfbebc15799b38a6e9e5b298b2de0950bd75e1b49f5ac68655fb SHA512 d323c6e79f60bb7abdb4583f021041532d1bf1514500d09d07b0a429b6cfb76787f590de04446ae84d51747b0023042d575aeb07da29e4e8c0ad13656a1877a5 WHIRLPOOL e2c86993539d40c8ab83c34c7fe0678be9a87741e66b7b5b8225a60e289386c5379ff42c8c1ab71258bb5b79d74a05c846cbf8875f8b511589983207b1791376 AUX generator-path.patch 1046 SHA256 aeb236e19bedc17737ada8953fed61272423b36fd186ffeaff0f14addc488549 SHA512 e9999afbf4d2d8a9e828d81dd0b54e2c2ba556e9778a4954dac3da885a15bc6dcc718f7e119c352eb2efd090e410735395ec20ce2eb3c84a481570bc8b5f66b3 WHIRLPOOL cbc5eb71fe2f61c95adefca78f29f1acd7ccb7bf9ccb7872326b2c7ed2704f4c856dd7456759c3320496995bef4f94d390b0d5f6d9b2585cb99c4a27faabdf2a AUX nsswitch.conf 698 SHA256 56aada9338fad1b105bc5755a85761cab57dc9aba180545be2df0b993b581eb3 SHA512 486581b096db702941589bbd3211df58df4979d17856dc935f6e22f7a268c5b6b1c4dfa643d38e21bc01eb258b0b97318d4e97ebab0e87abd718af1e391fde1a WHIRLPOOL 160d83a8a136c44d8d4d1fa9c8c321ff792746b6482c29662c93bcab720540591ea95c4c6a68252f024b449360fcdcebf4c78ee0e33be268e8801bede1286200 DIST systemd-233-man.tar.gz 31386 SHA256 825e62eb82c4e23997061fc8f56f7ec9bb1e6ac1111d279c76c926cc2bfbf1dc SHA512 cc5215d3590ffc3c9203a64c14d6adeb0148c421c1396b8c1e43dcb58763b687ce99bdee327dd8a00abab7198171e73b22109a3f2032e4cec6adf2dcc85acf40 WHIRLPOOL ff1f36beff377f675047271df38503e8b71d615ea73c5fdfebf465edaf1fe29b4f89e3194d65cdf84eec9b7c3156de597627fdaffa4b86018520aaa127a7a159 DIST systemd-233.tar.gz 4660737 SHA256 8b3e99da3d4164b66581830a7f2436c0c8fe697b5fbdc3927bdb960646be0083 SHA512 5ad5329ea116d973cf67096f7e7ad28e9ea0905696e9451291f1d25e5064f4a9bfcfae87e912996c6a38397e9f4a148d4ccecfa9b70f7ecdf04deadb61784c8e WHIRLPOOL ce19f6a546b8f899cfa952e49d47f063fd29186be4a53391bc30ea2c487eb2c140a74ad843a1dc499bb61bba3e9ca055613852291e38b85af5d79c59409dc176 -DIST systemd-234.tar.gz 4800186 SHA256 da3e69d10aa1c983d33833372ad4929037b411ac421fb085c8cee79ae1d80b6a SHA512 762336a7d96c6583cf71cad62efce95a0ed93cd0a0d7251f128d10dba8200c0c8df0e5a7d168179ababa5b221295a231e73b7e7ea2697cb3fb5c1b33538efa68 WHIRLPOOL 9ff9f25ce82514db969a427eee51c0483b2bcaaa611f93c1fc17c356ea25eee712217708c54101ecaafd835cd8ac988b16e8ad411b48541a32442b9a0d148f07 DIST systemd-235.tar.gz 6586406 SHA256 25811f96f5a027bf2a4c9383495cf5b623e385d84da31e473cf375932b3e9c52 SHA512 243f2eb5340fa37dd1286eaa63e83387bda9e03953af266cd6196a37535a13491482caf14c6ab10608bba4ed23b6c41923608e52017e0c26988ed72ddd2b9993 WHIRLPOOL 05e50b31f7b3b1cd756abd1580dddae0e114953857564133784fc43b9ecd0e203ee534aaf76531ca7af5c43b03b9b73c6cbbbb1caf5afb17502555cc52fe06cd EBUILD systemd-233-r4.ebuild 13626 SHA256 0dc86e550d767d12e945975267f4a6ff6c4a862f049253e966c9f2db699310f6 SHA512 3527bc62210aba9c50f663d8023440b73ae6185f1a90e6e31a48b6dcc13ac2dc0b312c433cbe74e942cb50ad894d4dd4212d81caf50d17971c9f965cae9535a0 WHIRLPOOL 8b4f723d82d0101b30838c5c21c89bdc1f23d18291ea3e5fd97f28357e8e35d6365725129cd4edda7d7b14f18b5e2cfe370971522a2d822f686fd61d1d08ab5d -EBUILD systemd-234-r4.ebuild 13476 SHA256 56dcb5358bb37180167e69894032d20aa7121f2d1bf9f80d0eec780eb748956b SHA512 4276434de0bb01ac06a78b001017c91b2bf104ac0559666fcc28cad2b2d8545c8279db89afa4d1bf31d4106337f8662b3ee1c65cf75f3507081a47a52c1a126c WHIRLPOOL d8953a3b122b206f0b10f737543685ca3c429f6f6456f555fbe78972bab5c96e69b968df4cfe3a9df189a519e4ce384b92916575794e7e5ccc725acc58d970d9 -EBUILD systemd-235.ebuild 13364 SHA256 bd8997ff489058e0b60b3cef8df5a2e53e151f81bdd6eea2eda084fcf8f98301 SHA512 ebb5ffd0f473d18c5d3862fb7b944ba67028cd0d93d38ac4182074f6ae700ef02dfdeccddbbb90d69baad124f7b1870c81eb27bcb864aa7dd86cbf4787ad979b WHIRLPOOL 632cd55136ec811ffb01acaedfa01e3b0b1333f89e6a4230bcdd40e752d8a3685ee70821cc19da7403e6dde2cfa0938b3c846f8039fc8f627a178d921771dba5 +EBUILD systemd-233-r5.ebuild 13669 SHA256 6ecc5fa2a1f6b7864113e59972a3bf150eb836ea43d06c5b4f84fd1cb6eae325 SHA512 722307b55c7621f119dee2e483bb7271d5a460945bd938adee6e679345a3549eaf060c96493b54e7a5bcb94a2821ce31949cfaeb5b1a43aeef36b673ecc39d7c WHIRLPOOL f1e5aabea3ff94eb2ee4576b5d34fb411c8bda9f01293b9579215b0e51a8103c93149befd25543c68d20855f0eff9804da7074449ec0db12b93d59b6cff4625f +EBUILD systemd-233-r6.ebuild 13703 SHA256 4a175589f8db63b05d622433d2024b1d4ae01b5ea01590f78570e60471b5a02b SHA512 9da2170e9443109ed79437c8d58ae2487ae93b7a3928d8d813391a2b520c700f563f2651a8a209359e4524f94a159454b412d468e3f1c22da82bbc72eeda5151 WHIRLPOOL 2df3ccd94ac4b913939223e7d96d197881557a7b4f634bd0592dc329e262d60e05067c23917aa371b0789e28922e48f723ed78e4037e737a4e6670a940c83ff5 +EBUILD systemd-235-r1.ebuild 13401 SHA256 bde936448268da8906d49ae5d0032cc496c38c32830414059a715af514c4c537 SHA512 240341672cc795a7bce946e5d44f9cc30f7099d6954b352fa13e142d185dd1fdf1bd665eb510355c6317c81d29e491cd7d41b5d7b28c8860f092767ea81b4ce1 WHIRLPOOL 6c707048afd34b9d7f51823661a833e312c0067bc38b6de9ed2e5afc51c3cc7134017adfa25ddc6de9aa368da7ec375238f33ef9c7b11cc0c05b37218402e635 EBUILD systemd-9999.ebuild 13196 SHA256 0e18985198be157839accf26bfc358a784ad2f3b9b596fd8636f461bb2320fb1 SHA512 90b0283fb318638e572edcd03d04ba4545ffef50ea877c97277b43db8ddb95b9784e834072a51aa3954c8088c4a946390f5f3b2d651fbc6c959c74058b606dc1 WHIRLPOOL f790ba07e2bdb3f99f905a5dfd027891b8337e661e0ca5f88cf414c165f3e7924f9ec584e8b6baf2d8bcf053b49583d0bcac2d19e7acdf0d175fb5a681c4bdea MISC ChangeLog 20141 SHA256 b01beaf5824021996a73fbd2fb1749b390e13c13eb309d336934fc758a73fd57 SHA512 041097f0655b5464023c1365d6e2813def67ffcdf6d2ae28c48497280bf3ed1ba49fca24ef661cb30de4af97ab1cee53575b4f51cb985fcc700535f3d4432481 WHIRLPOOL 854111ca90d15661843afd4c026028949b7d6f8916e750a2537f22993225aef0ef4076c0ff3d818609a9b166ca926ba152e26d2e3d30510a646a5bcb6b5c04fb MISC ChangeLog-2015 69416 SHA256 10adffab2046e41857e68c45b411fa011fe6206cf8d4cab42db78562cecf6bd8 SHA512 bc8f0ad8ebb6a31db74be738e97d9cd1183c0cc394615d90bf15633a315778557170bb93ce7e88b63bb93237c1a748f6f3d0ab89539f014d319f30ba9a0021fc WHIRLPOOL 7052513a02364742e297fea4c595da7045b5b6a517a397314992b7cf87f40d9ffa16383c6e413d466fdfa3173e9e8769257cf46116e4808fad7ae5c0f7990296 diff --git a/sys-apps/systemd/files/CVE-2017-15908.patch b/sys-apps/systemd/files/CVE-2017-15908.patch new file mode 100644 index 000000000000..08e5e37514ce --- /dev/null +++ b/sys-apps/systemd/files/CVE-2017-15908.patch @@ -0,0 +1,39 @@ +From 9f939335a07085aa9a9663efd1dca06ef6405d62 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl> +Date: Wed, 25 Oct 2017 11:19:19 +0200 +Subject: [PATCH] resolved: fix loop on packets with pseudo dns types + +Reported by Karim Hossen & Thomas Imbert from Sogeti ESEC R&D. + +https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1725351 +--- + src/resolve/resolved-dns-packet.c | 6 +----- + 1 file changed, 1 insertion(+), 5 deletions(-) + +diff --git a/src/resolve/resolved-dns-packet.c b/src/resolve/resolved-dns-packet.c +index e2f227bfc..35f4d0689 100644 +--- a/src/resolve/resolved-dns-packet.c ++++ b/src/resolve/resolved-dns-packet.c +@@ -1514,7 +1514,7 @@ static int dns_packet_read_type_window(DnsPacket *p, Bitmap **types, size_t *sta + + found = true; + +- while (bitmask) { ++ for (; bitmask; bit++, bitmask >>= 1) + if (bitmap[i] & bitmask) { + uint16_t n; + +@@ -1528,10 +1528,6 @@ static int dns_packet_read_type_window(DnsPacket *p, Bitmap **types, size_t *sta + if (r < 0) + return r; + } +- +- bit++; +- bitmask >>= 1; +- } + } + + if (!found) +-- +2.15.0.rc2 + diff --git a/sys-apps/systemd/files/CVE-2017-9217.patch b/sys-apps/systemd/files/CVE-2017-9217.patch new file mode 100644 index 000000000000..68d0f36d4913 --- /dev/null +++ b/sys-apps/systemd/files/CVE-2017-9217.patch @@ -0,0 +1,28 @@ +From a924f43f30f9c4acaf70618dd2a055f8b0f166be Mon Sep 17 00:00:00 2001 +From: Evgeny Vereshchagin <evvers@ya.ru> +Date: Wed, 24 May 2017 08:56:48 +0300 +Subject: [PATCH] resolved: bugfix of null pointer p->question dereferencing + (#6020) + +See https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1621396 +--- + src/resolve/resolved-dns-packet.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/src/resolve/resolved-dns-packet.c b/src/resolve/resolved-dns-packet.c +index 652970284..240ee448f 100644 +--- a/src/resolve/resolved-dns-packet.c ++++ b/src/resolve/resolved-dns-packet.c +@@ -2269,6 +2269,9 @@ int dns_packet_is_reply_for(DnsPacket *p, const DnsResourceKey *key) { + if (r < 0) + return r; + ++ if (!p->question) ++ return 0; ++ + if (p->question->n_keys != 1) + return 0; + +-- +2.15.0.rc2 + diff --git a/sys-apps/systemd/systemd-234-r4.ebuild b/sys-apps/systemd/systemd-233-r5.ebuild index a4c94bd3a96c..74c4b9e56fee 100644 --- a/sys-apps/systemd/systemd-234-r4.ebuild +++ b/sys-apps/systemd/systemd-233-r5.ebuild @@ -7,21 +7,22 @@ if [[ ${PV} == 9999 ]]; then EGIT_REPO_URI="https://github.com/systemd/systemd.git" inherit git-r3 else - SRC_URI="https://github.com/systemd/systemd/archive/v${PV}.tar.gz -> ${P}.tar.gz" - KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~x86" + SRC_URI="https://github.com/systemd/systemd/archive/v${PV}.tar.gz -> ${P}.tar.gz + !doc? ( https://dev.gentoo.org/~floppym/dist/${P}-man.tar.gz )" + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~ia64 ~ppc ~ppc64 ~sparc x86" fi PYTHON_COMPAT=( python{3_4,3_5,3_6} ) -inherit bash-completion-r1 linux-info meson multilib-minimal ninja-utils pam python-any-r1 systemd toolchain-funcs udev user +inherit autotools bash-completion-r1 linux-info multilib-minimal pam python-any-r1 systemd toolchain-funcs udev user DESCRIPTION="System and service manager for Linux" HOMEPAGE="https://www.freedesktop.org/wiki/Software/systemd" LICENSE="GPL-2 LGPL-2.1 MIT public-domain" SLOT="0/2" -IUSE="acl apparmor audit build cryptsetup curl elfutils +gcrypt gnuefi http - idn importd +kmod libidn2 +lz4 lzma nat pam policykit +IUSE="acl apparmor audit build cryptsetup curl doc elfutils +gcrypt gnuefi http + idn importd +kmod +lz4 lzma nat pam policykit qrcode +seccomp selinux ssl sysv-utils test vanilla xkb" REQUIRED_USE="importd? ( curl gcrypt lzma )" @@ -42,10 +43,7 @@ COMMON_DEPEND=">=sys-apps/util-linux-2.27.1:0=[${MULTILIB_USEDEP}] >=net-libs/libmicrohttpd-0.9.33:0= ssl? ( >=net-libs/gnutls-3.1.4:0= ) ) - idn? ( - libidn2? ( net-dns/libidn2 ) - !libidn2? ( net-dns/libidn ) - ) + idn? ( net-dns/libidn:0= ) importd? ( app-arch/bzip2:0= sys-libs/zlib:0= @@ -100,9 +98,13 @@ DEPEND="${COMMON_DEPEND} app-text/docbook-xml-dtd:4.5 app-text/docbook-xsl-stylesheets dev-libs/libxslt:0 - $(python_gen_any_dep 'dev-python/lxml[${PYTHON_USEDEP}]') + doc? ( $(python_gen_any_dep 'dev-python/lxml[${PYTHON_USEDEP}]') ) " +python_check_deps() { + has_version --host-root "dev-python/lxml[${PYTHON_USEDEP}]" +} + pkg_pretend() { if [[ ${MERGE_TYPE} != buildonly ]]; then local CONFIG_CHECK="~AUTOFS4_FS ~BLK_DEV_BSG ~CGROUPS @@ -147,10 +149,16 @@ src_unpack() { } src_prepare() { + # Bug 463376 + sed -i -e 's/GROUP="dialout"/GROUP="uucp"/' rules/*.rules || die + local PATCHES=( - "${FILESDIR}"/234-0002-cryptsetup-fix-infinite-timeout-6486.patch - "${FILESDIR}"/234-0003-resolved-make-sure-idn2-conversions-are-roundtrippab.patch - "${FILESDIR}"/234-0004-logind-make-sure-we-don-t-process-the-same-method-ca.patch + "${FILESDIR}/233-0001-Avoid-strict-DM-interface-version-dependencies-5519.patch" + "${FILESDIR}/233-CVE-2017-9445.patch" + "${FILESDIR}/233-format-warnings.patch" + "${FILESDIR}/233-0002-core-load-fragment-refuse-units-with-errors-in-RootD.patch" + "${FILESDIR}/233-0003-core-load-fragment-refuse-units-with-errors-in-certa.patch" + "${FILESDIR}/CVE-2017-15908.patch" ) if ! use vanilla; then @@ -158,159 +166,189 @@ src_prepare() { "${FILESDIR}/218-Dont-enable-audit-by-default.patch" "${FILESDIR}/228-noclean-tmp.patch" "${FILESDIR}/233-systemd-user-pam.patch" - "${FILESDIR}/234-uucp-group.patch" - "${FILESDIR}/generator-path.patch" ) fi [[ -d "${WORKDIR}"/patches ]] && PATCHES+=( "${WORKDIR}"/patches ) default + + eautoreconf } src_configure() { + # Keep using the one where the rules were installed. + MY_UDEVDIR=$(get_udevdir) + # Fix systems broken by bug #509454. + [[ ${MY_UDEVDIR} ]] || MY_UDEVDIR=/lib/udev + # Prevent conflicts with i686 cross toolchain, bug 559726 tc-export AR CC NM OBJCOPY RANLIB - python_setup + use doc && python_setup multilib-minimal_src_configure } -meson_use() { - usex "$1" true false -} - -meson_multilib() { - if multilib_is_native_abi; then - echo true - else - echo false - fi -} - -meson_multilib_native_use() { - if multilib_is_native_abi && use "$1"; then - echo true - else - echo false - fi -} - multilib_src_configure() { - local myconf=( - --localstatedir="${EPREFIX}/var" - -Dpamlibdir="$(getpam_mod_dir)" + local myeconfargs=( + # disable -flto since it is an optimization flag + # and makes distcc less effective + cc_cv_CFLAGS__flto=no + # disable -fuse-ld=gold since Gentoo supports explicit linker + # choice and forcing gold is undesired, #539998 + # ld.gold may collide with user's LDFLAGS, #545168 + # ld.gold breaks sparc, #573874 + cc_cv_LDFLAGS__Wl__fuse_ld_gold=no + + # Workaround for gcc-4.7, bug 554454. + cc_cv_CFLAGS__Werror_shadow=no + + # Workaround for bug 516346 + --enable-dependency-tracking + + --disable-maintainer-mode + --localstatedir=/var + --with-pamlibdir=$(getpam_mod_dir) # avoid bash-completion dep - -Dbashcompletiondir="$(get_bashcompdir)" + --with-bashcompletiondir="$(get_bashcompdir)" # make sure we get /bin:/sbin in $PATH - -Dsplit-usr=true - -Drootprefix="${EPREFIX}${ROOTPREFIX}" - -Dsysvinit-path= - -Dsysvrcnd-path= + --enable-split-usr + # For testing. + --with-rootprefix="${ROOTPREFIX-/usr}" + --with-rootlibdir="${ROOTPREFIX-/usr}/$(get_libdir)" + # disable sysv compatibility + --with-sysvinit-path= + --with-sysvrcnd-path= # no deps - -Defi=$(meson_multilib) - -Dima=true + --enable-efi + --enable-ima + # Optional components/dependencies - -Dacl=$(meson_multilib_native_use acl) - -Dapparmor=$(meson_multilib_native_use apparmor) - -Daudit=$(meson_multilib_native_use audit) - -Dlibcryptsetup=$(meson_multilib_native_use cryptsetup) - -Dlibcurl=$(meson_multilib_native_use curl) - -Delfutils=$(meson_multilib_native_use elfutils) - -Dgcrypt=$(meson_use gcrypt) - -Dgnu-efi=$(meson_multilib_native_use gnuefi) - -Defi-libdir="/usr/$(get_libdir)" - -Dmicrohttpd=$(meson_multilib_native_use http) - $(usex http -Dgnutls=$(meson_multilib_native_use ssl) -Dgnutls=false) - -Dimportd=$(meson_multilib_native_use importd) - -Dbzip2=$(meson_multilib_native_use importd) - -Dzlib=$(meson_multilib_native_use importd) - -Dkmod=$(meson_multilib_native_use kmod) - -Dlz4=$(meson_use lz4) - -Dxz=$(meson_use lzma) - -Dlibiptc=$(meson_multilib_native_use nat) - -Dpam=$(meson_use pam) - -Dpolkit=$(meson_multilib_native_use policykit) - -Dqrencode=$(meson_multilib_native_use qrcode) - -Dseccomp=$(meson_multilib_native_use seccomp) - -Dselinux=$(meson_multilib_native_use selinux) - #-Dtests=$(meson_multilib_native_use test) - -Ddbus=$(meson_multilib_native_use test) - -Dxkbcommon=$(meson_multilib_native_use xkb) + $(multilib_native_use_enable acl) + $(multilib_native_use_enable apparmor) + $(multilib_native_use_enable audit) + $(multilib_native_use_enable cryptsetup libcryptsetup) + $(multilib_native_use_enable curl libcurl) + $(multilib_native_use_enable elfutils) + $(use_enable gcrypt) + $(multilib_native_use_enable gnuefi) + --with-efi-libdir="/usr/$(get_libdir)" + $(multilib_native_use_enable http microhttpd) + $(usex http $(multilib_native_use_enable ssl gnutls) --disable-gnutls) + $(multilib_native_use_enable idn libidn) + $(multilib_native_use_enable importd) + $(multilib_native_use_enable importd bzip2) + $(multilib_native_use_enable importd zlib) + $(multilib_native_use_enable kmod) + $(use_enable lz4) + $(use_enable lzma xz) + $(multilib_native_use_enable nat libiptc) + $(use_enable pam) + $(multilib_native_use_enable policykit polkit) + $(multilib_native_use_enable qrcode qrencode) + $(multilib_native_use_enable seccomp) + $(multilib_native_use_enable selinux) + $(multilib_native_use_enable test tests) + $(multilib_native_use_enable test dbus) + $(multilib_native_use_enable xkb xkbcommon) + $(multilib_native_use_with doc python) + # hardcode a few paths to spare some deps - -Dpath-kill=/bin/kill - -Dntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org" + KILL=/bin/kill + QUOTAON=/usr/sbin/quotaon + QUOTACHECK=/usr/sbin/quotacheck + + # TODO: we may need to restrict this to gcc + EFI_CC="$(tc-getCC)" + + # dbus paths + --with-dbuspolicydir="${EPREFIX}/etc/dbus-1/system.d" + --with-dbussessionservicedir="${EPREFIX}/usr/share/dbus-1/services" + --with-dbussystemservicedir="${EPREFIX}/usr/share/dbus-1/system-services" + + --with-ntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org" + # Breaks screen, tmux, etc. - -Ddefault-kill-user-processes=false - - # multilib options - -Dbacklight=$(meson_multilib) - -Dbinfmt=$(meson_multilib) - -Dcoredump=$(meson_multilib) - -Denvironment-d=$(meson_multilib) - -Dfirstboot=$(meson_multilib) - -Dhibernate=$(meson_multilib) - -Dhostnamed=$(meson_multilib) - -Dhwdb=$(meson_multilib) - -Dldconfig=$(meson_multilib) - -Dlocaled=$(meson_multilib) - -Dman=$(meson_multilib) - -Dnetworkd=$(meson_multilib) - -Dquotacheck=$(meson_multilib) - -Drandomseed=$(meson_multilib) - -Drfkill=$(meson_multilib) - -Dsysusers=$(meson_multilib) - -Dtimedated=$(meson_multilib) - -Dtimesyncd=$(meson_multilib) - -Dtmpfiles=$(meson_multilib) - -Dvconsole=$(meson_multilib) + --without-kill-user-processes ) - if multilib_is_native_abi && use idn; then - myconf+=( - -Dlibidn2=$(usex libidn2 true false) - -Dlibidn=$(usex libidn2 false true) - ) - else - myconf+=( - -Dlibidn2=false - -Dlibidn=false - ) - fi + # Work around bug 463846. + tc-export CC - meson_src_configure "${myconf[@]}" + ECONF_SOURCE="${S}" econf "${myeconfargs[@]}" } multilib_src_compile() { - eninja + local mymakeopts=( + udevlibexecdir="${MY_UDEVDIR}" + ) + + if multilib_is_native_abi; then + emake "${mymakeopts[@]}" + else + emake built-sources + local targets=( + '$(rootlib_LTLIBRARIES)' + '$(lib_LTLIBRARIES)' + '$(pamlib_LTLIBRARIES)' + '$(pkgconfiglib_DATA)' + ) + echo "gentoo: ${targets[*]}" | emake "${mymakeopts[@]}" -f Makefile -f - gentoo + fi } multilib_src_test() { - eninja test + multilib_is_native_abi || return 0 + default } multilib_src_install() { - DESTDIR="${D}" eninja install + local mymakeopts=( + # automake fails with parallel libtool relinking + # https://bugs.gentoo.org/show_bug.cgi?id=491398 + -j1 + + udevlibexecdir="${MY_UDEVDIR}" + dist_udevhwdb_DATA= + DESTDIR="${D}" + ) + + if multilib_is_native_abi; then + emake "${mymakeopts[@]}" install + else + mymakeopts+=( + install-rootlibLTLIBRARIES + install-libLTLIBRARIES + install-pamlibLTLIBRARIES + install-pkgconfiglibDATA + install-includeHEADERS + install-pkgincludeHEADERS + ) + + emake "${mymakeopts[@]}" + fi } multilib_src_install_all() { - # meson doesn't know about docdir - mv "${ED%/}"/usr/share/doc/{systemd,${PF}} || die - + prune_libtool_files --modules einstalldocs dodoc "${FILESDIR}"/nsswitch.conf + if [[ ${PV} != 9999 ]]; then + use doc || doman "${WORKDIR}"/man/systemd.{directives,index}.7 + fi + if use sysv-utils; then for app in halt poweroff reboot runlevel shutdown telinit; do - dosym "${EPREFIX}${ROOTPREFIX%/}/bin/systemctl" /sbin/${app} + dosym "..${ROOTPREFIX-/usr}/bin/systemctl" /sbin/${app} done - dosym "${EPREFIX}${ROOTPREFIX%/}/lib/systemd/systemd" /sbin/init + dosym "..${ROOTPREFIX-/usr}/lib/systemd/systemd" /sbin/init else # we just keep sysvinit tools, so no need for the mans - rm "${ED%/}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 \ + rm "${D}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 \ || die - rm "${ED%/}"/usr/share/man/man1/init.1 || die + rm "${D}"/usr/share/man/man1/init.1 || die fi # Preserve empty dirs in /etc & /var, bug #437008 @@ -323,19 +361,11 @@ multilib_src_install_all() { # If we install these symlinks, there is no way for the sysadmin to remove them # permanently. - rm "${ED%/}"/etc/systemd/system/multi-user.target.wants/systemd-networkd.service || die - rm -f "${ED%/}"/etc/systemd/system/multi-user.target.wants/systemd-resolved.service || die - rm -r "${ED%/}"/etc/systemd/system/network-online.target.wants || die - rm -r "${ED%/}"/etc/systemd/system/sockets.target.wants || die - rm -r "${ED%/}"/etc/systemd/system/sysinit.target.wants || die - - rm -r "${ED%/}${ROOTPREFIX%/}/lib/udev/hwdb.d" || die - - if [[ ! -e "${ED%/}"/usr/lib/systemd/systemd ]]; then - # Avoid breaking boot/reboot - dosym "../../..${ROOTPREFIX%/}/lib/systemd/systemd" /usr/lib/systemd/systemd - dosym "../../..${ROOTPREFIX%/}/lib/systemd/systemd-shutdown" /usr/lib/systemd/systemd-shutdown - fi + rm "${D}"/etc/systemd/system/multi-user.target.wants/systemd-networkd.service || die + rm -f "${D}"/etc/systemd/system/multi-user.target.wants/systemd-resolved.service || die + rm -r "${D}"/etc/systemd/system/network-online.target.wants || die + rm -r "${D}"/etc/systemd/system/sockets.target.wants || die + rm -r "${D}"/etc/systemd/system/sysinit.target.wants || die } migrate_locale() { @@ -382,19 +412,6 @@ migrate_locale() { fi } -pkg_preinst() { - # If /lib/systemd and /usr/lib/systemd are the same directory, remove the - # symlinks we created in src_install. - if [[ $(realpath "${EROOT%/}${ROOTPREFIX}/lib/systemd") == $(realpath "${EROOT%/}/usr/lib/systemd") ]]; then - if [[ -L ${ED%/}/usr/lib/systemd/systemd ]]; then - rm "${ED%/}/usr/lib/systemd/systemd" || die - fi - if [[ -L ${ED%/}/usr/lib/systemd/systemd-shutdown ]]; then - rm "${ED%/}/usr/lib/systemd/systemd-shutdown" || die - fi - fi -} - pkg_postinst() { newusergroup() { enewgroup "$1" @@ -402,7 +419,6 @@ pkg_postinst() { } enewgroup input - enewgroup kvm 78 enewgroup systemd-journal newusergroup systemd-bus-proxy newusergroup systemd-coredump @@ -418,7 +434,7 @@ pkg_postinst() { # Keep this here in case the database format changes so it gets updated # when required. Despite that this file is owned by sys-apps/hwids. if has_version "sys-apps/hwids[udev]"; then - udevadm hwdb --update --root="${EROOT%/}" + udevadm hwdb --update --root="${ROOT%/}" fi udev_reload || FAIL=1 @@ -435,11 +451,6 @@ pkg_postinst() { eerror "systemd again." eerror fi - - if [[ -e "${EROOT%/}"/usr/lib/systemd/system-generators ]]; then - ewarn "Please rebuild any packages which install system generators." - ewarn " emerge --oneshot --usepkg=n /usr/lib/systemd/system-generators" - fi } pkg_prerm() { diff --git a/sys-apps/systemd/systemd-233-r6.ebuild b/sys-apps/systemd/systemd-233-r6.ebuild new file mode 100644 index 000000000000..be302349a160 --- /dev/null +++ b/sys-apps/systemd/systemd-233-r6.ebuild @@ -0,0 +1,462 @@ +# Copyright 1999-2017 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +EAPI=6 + +if [[ ${PV} == 9999 ]]; then + EGIT_REPO_URI="https://github.com/systemd/systemd.git" + inherit git-r3 +else + SRC_URI="https://github.com/systemd/systemd/archive/v${PV}.tar.gz -> ${P}.tar.gz + !doc? ( https://dev.gentoo.org/~floppym/dist/${P}-man.tar.gz )" + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ia64 ppc ppc64 ~sparc ~x86" +fi + +PYTHON_COMPAT=( python{3_4,3_5,3_6} ) + +inherit autotools bash-completion-r1 linux-info multilib-minimal pam python-any-r1 systemd toolchain-funcs udev user + +DESCRIPTION="System and service manager for Linux" +HOMEPAGE="https://www.freedesktop.org/wiki/Software/systemd" + +LICENSE="GPL-2 LGPL-2.1 MIT public-domain" +SLOT="0/2" +IUSE="acl apparmor audit build cryptsetup curl doc elfutils +gcrypt gnuefi http + idn importd +kmod +lz4 lzma nat pam policykit + qrcode +seccomp selinux ssl sysv-utils test vanilla xkb" + +REQUIRED_USE="importd? ( curl gcrypt lzma )" + +MINKV="3.11" + +COMMON_DEPEND=">=sys-apps/util-linux-2.27.1:0=[${MULTILIB_USEDEP}] + sys-libs/libcap:0=[${MULTILIB_USEDEP}] + !<sys-libs/glibc-2.16 + acl? ( sys-apps/acl:0= ) + apparmor? ( sys-libs/libapparmor:0= ) + audit? ( >=sys-process/audit-2:0= ) + cryptsetup? ( >=sys-fs/cryptsetup-1.6:0= ) + curl? ( net-misc/curl:0= ) + elfutils? ( >=dev-libs/elfutils-0.158:0= ) + gcrypt? ( >=dev-libs/libgcrypt-1.4.5:0=[${MULTILIB_USEDEP}] ) + http? ( + >=net-libs/libmicrohttpd-0.9.33:0= + ssl? ( >=net-libs/gnutls-3.1.4:0= ) + ) + idn? ( net-dns/libidn:0= ) + importd? ( + app-arch/bzip2:0= + sys-libs/zlib:0= + ) + kmod? ( >=sys-apps/kmod-15:0= ) + lz4? ( >=app-arch/lz4-0_p131:0=[${MULTILIB_USEDEP}] ) + lzma? ( >=app-arch/xz-utils-5.0.5-r1:0=[${MULTILIB_USEDEP}] ) + nat? ( net-firewall/iptables:0= ) + pam? ( virtual/pam:=[${MULTILIB_USEDEP}] ) + qrcode? ( media-gfx/qrencode:0= ) + seccomp? ( >=sys-libs/libseccomp-2.3.1:0= ) + selinux? ( sys-libs/libselinux:0= ) + sysv-utils? ( + !sys-apps/systemd-sysv-utils + !sys-apps/sysvinit ) + xkb? ( >=x11-libs/libxkbcommon-0.4.1:0= ) + abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20130224-r9 + !app-emulation/emul-linux-x86-baselibs[-abi_x86_32(-)] )" + +# baselayout-2.2 has /run +RDEPEND="${COMMON_DEPEND} + >=sys-apps/baselayout-2.2 + selinux? ( sec-policy/selinux-base-policy[systemd] ) + !build? ( || ( + sys-apps/util-linux[kill(-)] + sys-process/procps[kill(+)] + sys-apps/coreutils[kill(-)] + ) ) + !sys-auth/nss-myhostname + !<sys-kernel/dracut-044 + !sys-fs/eudev + !sys-fs/udev" + +# sys-apps/dbus: the daemon only (+ build-time lib dep for tests) +PDEPEND=">=sys-apps/dbus-1.9.8[systemd] + >=sys-apps/hwids-20150417[udev] + >=sys-fs/udev-init-scripts-25 + policykit? ( sys-auth/polkit ) + !vanilla? ( sys-apps/gentoo-systemd-integration )" + +# Newer linux-headers needed by ia64, bug #480218 +DEPEND="${COMMON_DEPEND} + app-arch/xz-utils:0 + dev-util/gperf + >=dev-util/intltool-0.50 + >=sys-apps/coreutils-8.16 + >=sys-kernel/linux-headers-${MINKV} + virtual/pkgconfig + gnuefi? ( >=sys-boot/gnu-efi-3.0.2 ) + test? ( sys-apps/dbus ) + app-text/docbook-xml-dtd:4.2 + app-text/docbook-xml-dtd:4.5 + app-text/docbook-xsl-stylesheets + dev-libs/libxslt:0 + doc? ( $(python_gen_any_dep 'dev-python/lxml[${PYTHON_USEDEP}]') ) +" + +python_check_deps() { + has_version --host-root "dev-python/lxml[${PYTHON_USEDEP}]" +} + +pkg_pretend() { + if [[ ${MERGE_TYPE} != buildonly ]]; then + local CONFIG_CHECK="~AUTOFS4_FS ~BLK_DEV_BSG ~CGROUPS + ~CHECKPOINT_RESTORE ~DEVTMPFS ~EPOLL ~FANOTIFY ~FHANDLE + ~INOTIFY_USER ~IPV6 ~NET ~NET_NS ~PROC_FS ~SIGNALFD ~SYSFS + ~TIMERFD ~TMPFS_XATTR ~UNIX + ~CRYPTO_HMAC ~CRYPTO_SHA256 ~CRYPTO_USER_API_HASH + ~!FW_LOADER_USER_HELPER ~!GRKERNSEC_PROC ~!IDE ~!SYSFS_DEPRECATED + ~!SYSFS_DEPRECATED_V2" + + use acl && CONFIG_CHECK+=" ~TMPFS_POSIX_ACL" + use seccomp && CONFIG_CHECK+=" ~SECCOMP ~SECCOMP_FILTER" + kernel_is -lt 3 7 && CONFIG_CHECK+=" ~HOTPLUG" + kernel_is -lt 4 7 && CONFIG_CHECK+=" ~DEVPTS_MULTIPLE_INSTANCES" + + if linux_config_exists; then + local uevent_helper_path=$(linux_chkconfig_string UEVENT_HELPER_PATH) + if [[ -n ${uevent_helper_path} ]] && [[ ${uevent_helper_path} != '""' ]]; then + ewarn "It's recommended to set an empty value to the following kernel config option:" + ewarn "CONFIG_UEVENT_HELPER_PATH=${uevent_helper_path}" + fi + if linux_chkconfig_present X86; then + CONFIG_CHECK+=" ~DMIID" + fi + fi + + if kernel_is -lt ${MINKV//./ }; then + ewarn "Kernel version at least ${MINKV} required" + fi + + check_extra_config + fi +} + +pkg_setup() { + : +} + +src_unpack() { + default + [[ ${PV} != 9999 ]] || git-r3_src_unpack +} + +src_prepare() { + # Bug 463376 + sed -i -e 's/GROUP="dialout"/GROUP="uucp"/' rules/*.rules || die + + local PATCHES=( + "${FILESDIR}/233-0001-Avoid-strict-DM-interface-version-dependencies-5519.patch" + "${FILESDIR}/233-CVE-2017-9445.patch" + "${FILESDIR}/233-format-warnings.patch" + "${FILESDIR}/233-0002-core-load-fragment-refuse-units-with-errors-in-RootD.patch" + "${FILESDIR}/233-0003-core-load-fragment-refuse-units-with-errors-in-certa.patch" + "${FILESDIR}/CVE-2017-15908.patch" + "${FILESDIR}/CVE-2017-9217.patch" + ) + + if ! use vanilla; then + PATCHES+=( + "${FILESDIR}/218-Dont-enable-audit-by-default.patch" + "${FILESDIR}/228-noclean-tmp.patch" + "${FILESDIR}/233-systemd-user-pam.patch" + ) + fi + + [[ -d "${WORKDIR}"/patches ]] && PATCHES+=( "${WORKDIR}"/patches ) + + default + + eautoreconf +} + +src_configure() { + # Keep using the one where the rules were installed. + MY_UDEVDIR=$(get_udevdir) + # Fix systems broken by bug #509454. + [[ ${MY_UDEVDIR} ]] || MY_UDEVDIR=/lib/udev + + # Prevent conflicts with i686 cross toolchain, bug 559726 + tc-export AR CC NM OBJCOPY RANLIB + + use doc && python_setup + + multilib-minimal_src_configure +} + +multilib_src_configure() { + local myeconfargs=( + # disable -flto since it is an optimization flag + # and makes distcc less effective + cc_cv_CFLAGS__flto=no + # disable -fuse-ld=gold since Gentoo supports explicit linker + # choice and forcing gold is undesired, #539998 + # ld.gold may collide with user's LDFLAGS, #545168 + # ld.gold breaks sparc, #573874 + cc_cv_LDFLAGS__Wl__fuse_ld_gold=no + + # Workaround for gcc-4.7, bug 554454. + cc_cv_CFLAGS__Werror_shadow=no + + # Workaround for bug 516346 + --enable-dependency-tracking + + --disable-maintainer-mode + --localstatedir=/var + --with-pamlibdir=$(getpam_mod_dir) + # avoid bash-completion dep + --with-bashcompletiondir="$(get_bashcompdir)" + # make sure we get /bin:/sbin in $PATH + --enable-split-usr + # For testing. + --with-rootprefix="${ROOTPREFIX-/usr}" + --with-rootlibdir="${ROOTPREFIX-/usr}/$(get_libdir)" + # disable sysv compatibility + --with-sysvinit-path= + --with-sysvrcnd-path= + # no deps + --enable-efi + --enable-ima + + # Optional components/dependencies + $(multilib_native_use_enable acl) + $(multilib_native_use_enable apparmor) + $(multilib_native_use_enable audit) + $(multilib_native_use_enable cryptsetup libcryptsetup) + $(multilib_native_use_enable curl libcurl) + $(multilib_native_use_enable elfutils) + $(use_enable gcrypt) + $(multilib_native_use_enable gnuefi) + --with-efi-libdir="/usr/$(get_libdir)" + $(multilib_native_use_enable http microhttpd) + $(usex http $(multilib_native_use_enable ssl gnutls) --disable-gnutls) + $(multilib_native_use_enable idn libidn) + $(multilib_native_use_enable importd) + $(multilib_native_use_enable importd bzip2) + $(multilib_native_use_enable importd zlib) + $(multilib_native_use_enable kmod) + $(use_enable lz4) + $(use_enable lzma xz) + $(multilib_native_use_enable nat libiptc) + $(use_enable pam) + $(multilib_native_use_enable policykit polkit) + $(multilib_native_use_enable qrcode qrencode) + $(multilib_native_use_enable seccomp) + $(multilib_native_use_enable selinux) + $(multilib_native_use_enable test tests) + $(multilib_native_use_enable test dbus) + $(multilib_native_use_enable xkb xkbcommon) + $(multilib_native_use_with doc python) + + # hardcode a few paths to spare some deps + KILL=/bin/kill + QUOTAON=/usr/sbin/quotaon + QUOTACHECK=/usr/sbin/quotacheck + + # TODO: we may need to restrict this to gcc + EFI_CC="$(tc-getCC)" + + # dbus paths + --with-dbuspolicydir="${EPREFIX}/etc/dbus-1/system.d" + --with-dbussessionservicedir="${EPREFIX}/usr/share/dbus-1/services" + --with-dbussystemservicedir="${EPREFIX}/usr/share/dbus-1/system-services" + + --with-ntp-servers="0.gentoo.pool.ntp.org 1.gentoo.pool.ntp.org 2.gentoo.pool.ntp.org 3.gentoo.pool.ntp.org" + + # Breaks screen, tmux, etc. + --without-kill-user-processes + ) + + # Work around bug 463846. + tc-export CC + + ECONF_SOURCE="${S}" econf "${myeconfargs[@]}" +} + +multilib_src_compile() { + local mymakeopts=( + udevlibexecdir="${MY_UDEVDIR}" + ) + + if multilib_is_native_abi; then + emake "${mymakeopts[@]}" + else + emake built-sources + local targets=( + '$(rootlib_LTLIBRARIES)' + '$(lib_LTLIBRARIES)' + '$(pamlib_LTLIBRARIES)' + '$(pkgconfiglib_DATA)' + ) + echo "gentoo: ${targets[*]}" | emake "${mymakeopts[@]}" -f Makefile -f - gentoo + fi +} + +multilib_src_test() { + multilib_is_native_abi || return 0 + default +} + +multilib_src_install() { + local mymakeopts=( + # automake fails with parallel libtool relinking + # https://bugs.gentoo.org/show_bug.cgi?id=491398 + -j1 + + udevlibexecdir="${MY_UDEVDIR}" + dist_udevhwdb_DATA= + DESTDIR="${D}" + ) + + if multilib_is_native_abi; then + emake "${mymakeopts[@]}" install + else + mymakeopts+=( + install-rootlibLTLIBRARIES + install-libLTLIBRARIES + install-pamlibLTLIBRARIES + install-pkgconfiglibDATA + install-includeHEADERS + install-pkgincludeHEADERS + ) + + emake "${mymakeopts[@]}" + fi +} + +multilib_src_install_all() { + prune_libtool_files --modules + einstalldocs + dodoc "${FILESDIR}"/nsswitch.conf + + if [[ ${PV} != 9999 ]]; then + use doc || doman "${WORKDIR}"/man/systemd.{directives,index}.7 + fi + + if use sysv-utils; then + for app in halt poweroff reboot runlevel shutdown telinit; do + dosym "..${ROOTPREFIX-/usr}/bin/systemctl" /sbin/${app} + done + dosym "..${ROOTPREFIX-/usr}/lib/systemd/systemd" /sbin/init + else + # we just keep sysvinit tools, so no need for the mans + rm "${D}"/usr/share/man/man8/{halt,poweroff,reboot,runlevel,shutdown,telinit}.8 \ + || die + rm "${D}"/usr/share/man/man1/init.1 || die + fi + + # Preserve empty dirs in /etc & /var, bug #437008 + keepdir /etc/binfmt.d /etc/modules-load.d /etc/tmpfiles.d \ + /etc/systemd/ntp-units.d /etc/systemd/user /var/lib/systemd \ + /var/log/journal/remote + + # Symlink /etc/sysctl.conf for easy migration. + dosym ../sysctl.conf /etc/sysctl.d/99-sysctl.conf + + # If we install these symlinks, there is no way for the sysadmin to remove them + # permanently. + rm "${D}"/etc/systemd/system/multi-user.target.wants/systemd-networkd.service || die + rm -f "${D}"/etc/systemd/system/multi-user.target.wants/systemd-resolved.service || die + rm -r "${D}"/etc/systemd/system/network-online.target.wants || die + rm -r "${D}"/etc/systemd/system/sockets.target.wants || die + rm -r "${D}"/etc/systemd/system/sysinit.target.wants || die +} + +migrate_locale() { + local envd_locale_def="${EROOT%/}/etc/env.d/02locale" + local envd_locale=( "${EROOT%/}"/etc/env.d/??locale ) + local locale_conf="${EROOT%/}/etc/locale.conf" + + if [[ ! -L ${locale_conf} && ! -e ${locale_conf} ]]; then + # If locale.conf does not exist... + if [[ -e ${envd_locale} ]]; then + # ...either copy env.d/??locale if there's one + ebegin "Moving ${envd_locale} to ${locale_conf}" + mv "${envd_locale}" "${locale_conf}" + eend ${?} || FAIL=1 + else + # ...or create a dummy default + ebegin "Creating ${locale_conf}" + cat > "${locale_conf}" <<-EOF + # This file has been created by the sys-apps/systemd ebuild. + # See locale.conf(5) and localectl(1). + + # LANG=${LANG} + EOF + eend ${?} || FAIL=1 + fi + fi + + if [[ ! -L ${envd_locale} ]]; then + # now, if env.d/??locale is not a symlink (to locale.conf)... + if [[ -e ${envd_locale} ]]; then + # ...warn the user that he has duplicate locale settings + ewarn + ewarn "To ensure consistent behavior, you should replace ${envd_locale}" + ewarn "with a symlink to ${locale_conf}. Please migrate your settings" + ewarn "and create the symlink with the following command:" + ewarn "ln -s -n -f ../locale.conf ${envd_locale}" + ewarn + else + # ...or just create the symlink if there's nothing here + ebegin "Creating ${envd_locale_def} -> ../locale.conf symlink" + ln -n -s ../locale.conf "${envd_locale_def}" + eend ${?} || FAIL=1 + fi + fi +} + +pkg_postinst() { + newusergroup() { + enewgroup "$1" + enewuser "$1" -1 -1 -1 "$1" + } + + enewgroup input + enewgroup systemd-journal + newusergroup systemd-bus-proxy + newusergroup systemd-coredump + newusergroup systemd-journal-gateway + newusergroup systemd-journal-remote + newusergroup systemd-journal-upload + newusergroup systemd-network + newusergroup systemd-resolve + newusergroup systemd-timesync + + systemd_update_catalog + + # Keep this here in case the database format changes so it gets updated + # when required. Despite that this file is owned by sys-apps/hwids. + if has_version "sys-apps/hwids[udev]"; then + udevadm hwdb --update --root="${ROOT%/}" + fi + + udev_reload || FAIL=1 + + # Bug 465468, make sure locales are respect, and ensure consistency + # between OpenRC & systemd + migrate_locale + + systemd_reenable systemd-networkd.service systemd-resolved.service + + if [[ ${FAIL} ]]; then + eerror "One of the postinst commands failed. Please check the postinst output" + eerror "for errors. You may need to clean up your system and/or try installing" + eerror "systemd again." + eerror + fi +} + +pkg_prerm() { + # If removing systemd completely, remove the catalog database. + if [[ ! ${REPLACED_BY_VERSION} ]]; then + rm -f -v "${EROOT}"/var/lib/systemd/catalog/database + fi +} diff --git a/sys-apps/systemd/systemd-235.ebuild b/sys-apps/systemd/systemd-235-r1.ebuild index 6fe34a0809b9..2bb192a49e2d 100644 --- a/sys-apps/systemd/systemd-235.ebuild +++ b/sys-apps/systemd/systemd-235-r1.ebuild @@ -150,6 +150,7 @@ src_prepare() { local PATCHES=( "${FILESDIR}"/235-0001-test-skip-hwdb-and-sysv-generator-if-the-features-ar.patch "${FILESDIR}"/235-0002-networkd-Don-t-stop-networkd-if-CONFIG_FIB_RULES-n-i.patch + "${FILESDIR}/CVE-2017-15908.patch" ) if ! use vanilla; then |