dev-db/mongodb: prevent privilege escalation (bug #631000)
authorTomas Mozes <hydrapolic@gmail.com>
Tue, 26 Sep 2017 11:26:27 +0000 (13:26 +0200)
committerUltrabug <ultrabug@gentoo.org>
Fri, 13 Oct 2017 08:33:13 +0000 (10:33 +0200)
Package-Manager: Portage-2.3.10, Repoman-2.3.3
Closes: https://github.com/gentoo/gentoo/pull/5763

dev-db/mongodb/files/mongodb.confd-r3 [new file with mode: 0644]
dev-db/mongodb/files/mongodb.initd-r3 [new file with mode: 0644]
dev-db/mongodb/files/mongos.confd-r3 [new file with mode: 0644]
dev-db/mongodb/files/mongos.initd-r3 [new file with mode: 0644]
dev-db/mongodb/mongodb-3.0.15.ebuild
dev-db/mongodb/mongodb-3.2.16.ebuild
dev-db/mongodb/mongodb-3.4.9.ebuild

diff --git a/dev-db/mongodb/files/mongodb.confd-r3 b/dev-db/mongodb/files/mongodb.confd-r3
new file mode 100644 (file)
index 0000000..e515d1d
--- /dev/null
@@ -0,0 +1,11 @@
+# !! IMPORTANT !!
+#
+# This file is ONLY used to override some of the init script configuration.
+#
+# You should NOT use this file to configure your mongodb instance,
+# see the /etc/mongodb.conf file instead.
+#
+# Available init script modifiers :
+# - config_file : the configuration file to use (default : /etc/mongodb.conf)
+# - user : the user used to run your mongodb instance (default : mongodb)
+# - group : the group used to run your mongodb instance (default : mongodb)
diff --git a/dev-db/mongodb/files/mongodb.initd-r3 b/dev-db/mongodb/files/mongodb.initd-r3
new file mode 100644 (file)
index 0000000..778ef74
--- /dev/null
@@ -0,0 +1,18 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+: ${config_file:="/etc/${RC_SVCNAME}.conf"}
+: ${user:=mongodb}
+: ${group:=mongodb}
+
+command="/usr/bin/mongod"
+command_args="--config ${config_file}"
+command_background="true"
+pidfile="/run/${RC_SVCNAME}.pid"
+command_user="${user}:${group}"
+required_files="${config_file}"
+
+depend() {
+       use net
+}
diff --git a/dev-db/mongodb/files/mongos.confd-r3 b/dev-db/mongodb/files/mongos.confd-r3
new file mode 100644 (file)
index 0000000..7f297df
--- /dev/null
@@ -0,0 +1,11 @@
+# !! IMPORTANT !!
+#
+# This file is ONLY used to override some of the init script configuration.
+#
+# You should NOT use this file to configure your mongos instance,
+# see the /etc/mongos.conf file instead.
+#
+# Available init script modifiers :
+# - config_file : the configuration file to use (default : /etc/mongos.conf)
+# - user : the user used to run your mongodb instance (default : mongodb)
+# - group : the group used to run your mongodb instance (default : mongodb)
diff --git a/dev-db/mongodb/files/mongos.initd-r3 b/dev-db/mongodb/files/mongos.initd-r3
new file mode 100644 (file)
index 0000000..cf5844a
--- /dev/null
@@ -0,0 +1,18 @@
+#!/sbin/openrc-run
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+: ${config_file:="/etc/${RC_SVCNAME}.conf"}
+: ${user:=mongodb}
+: ${group:=mongodb}
+
+command="/usr/bin/mongos"
+command_args="--config ${config_file}"
+command_background="true"
+pidfile="/run/${RC_SVCNAME}.pid"
+command_user="${user}:${group}"
+required_files="${config_file}"
+
+depend() {
+       use net
+}
index 848080d07995cf8ec72fa9568dee28762d5bc08f..08741ca2af67a80b504b21b766ad27884ed22236 100644 (file)
@@ -111,10 +111,10 @@ src_install() {
        doman debian/mongo*.1
        dodoc README docs/building.md
 
-       newinitd "${FILESDIR}/${PN}.initd-r2" ${PN}
-       newconfd "${FILESDIR}/${PN}.confd-r2" ${PN}
-       newinitd "${FILESDIR}/${PN/db/s}.initd-r2" ${PN/db/s}
-       newconfd "${FILESDIR}/${PN/db/s}.confd-r2" ${PN/db/s}
+       newinitd "${FILESDIR}/${PN}.initd-r3" ${PN}
+       newconfd "${FILESDIR}/${PN}.confd-r3" ${PN}
+       newinitd "${FILESDIR}/${PN/db/s}.initd-r3" ${PN/db/s}
+       newconfd "${FILESDIR}/${PN/db/s}.confd-r3" ${PN/db/s}
 
        insinto /etc
        newins "${FILESDIR}/${PN}.conf-r3" ${PN}.conf
index f18602bddd9586592ffcd0a550a2f45645583a18..76293455988739bdfa5f088f4783e496e6c25ed9 100644 (file)
@@ -129,10 +129,10 @@ src_install() {
        doman debian/mongo*.1
        dodoc README docs/building.md
 
-       newinitd "${FILESDIR}/${PN}.initd-r2" ${PN}
-       newconfd "${FILESDIR}/${PN}.confd-r2" ${PN}
-       newinitd "${FILESDIR}/${PN/db/s}.initd-r2" ${PN/db/s}
-       newconfd "${FILESDIR}/${PN/db/s}.confd-r2" ${PN/db/s}
+       newinitd "${FILESDIR}/${PN}.initd-r3" ${PN}
+       newconfd "${FILESDIR}/${PN}.confd-r3" ${PN}
+       newinitd "${FILESDIR}/${PN/db/s}.initd-r3" ${PN/db/s}
+       newconfd "${FILESDIR}/${PN/db/s}.confd-r3" ${PN/db/s}
 
        insinto /etc
        newins "${FILESDIR}/${PN}.conf-r3" ${PN}.conf
index 8b70cd5e8e22bf9c5b794e01e2a221393273edce..1e193228dcc222237ccd2c261752b31abfb86003 100644 (file)
@@ -134,10 +134,10 @@ src_install() {
        doman debian/mongo*.1
        dodoc README docs/building.md
 
-       newinitd "${FILESDIR}/${PN}.initd-r2" ${PN}
-       newconfd "${FILESDIR}/${PN}.confd-r2" ${PN}
-       newinitd "${FILESDIR}/${PN/db/s}.initd-r2" ${PN/db/s}
-       newconfd "${FILESDIR}/${PN/db/s}.confd-r2" ${PN/db/s}
+       newinitd "${FILESDIR}/${PN}.initd-r3" ${PN}
+       newconfd "${FILESDIR}/${PN}.confd-r3" ${PN}
+       newinitd "${FILESDIR}/${PN/db/s}.initd-r3" ${PN/db/s}
+       newconfd "${FILESDIR}/${PN/db/s}.confd-r3" ${PN/db/s}
 
        insinto /etc
        newins "${FILESDIR}/${PN}.conf-r3" ${PN}.conf