public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Yixun Lan" <dlan@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-cluster/ceph/, sys-cluster/ceph/files/
Date: Mon, 11 Jul 2016 01:23:38 +0000 (UTC)	[thread overview]
Message-ID: <1468200107.361fb48dfdefd0b5442dd36e1b3d9a2cb47f8b07.dlan@gentoo> (raw)

commit:     361fb48dfdefd0b5442dd36e1b3d9a2cb47f8b07
Author:     Yixun Lan <dlan <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 11 01:21:06 2016 +0000
Commit:     Yixun Lan <dlan <AT> gentoo <DOT> org>
CommitDate: Mon Jul 11 01:21:47 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=361fb48d

sys-cluster/ceph: restore 0.94.x (hammer)

we decided to keep at least two LTS versions
also, allow user upgrade from old versions (sidely)

Gentoo-Bug: 587568

Package-Manager: portage-2.3.0_rc1

 sys-cluster/ceph/Manifest                          |   1 +
 sys-cluster/ceph/ceph-0.94.7.ebuild                | 177 +++++++++++++++++++++
 .../ceph/files/ceph-0.94.7-monitor-security.patch  | 109 +++++++++++++
 3 files changed, 287 insertions(+)

diff --git a/sys-cluster/ceph/Manifest b/sys-cluster/ceph/Manifest
index 5317942..1a120d4 100644
--- a/sys-cluster/ceph/Manifest
+++ b/sys-cluster/ceph/Manifest
@@ -1,2 +1,3 @@
+DIST ceph-0.94.7.tar.gz 9164375 SHA256 aafe6cbab2f5db11376e5696a58d0711a90e93094a04eafe8d4d0910c8694d66 SHA512 e27631dceb01d59fab5fab22eaf7a8d0cbb474b44834a3b62bff4562e32723711431ee3ae66e2de26368b3b0e8f3619282a91c6934b88e722fcdfe6215bf8e68 WHIRLPOOL b2c0f5d26a1ffdfede29ec35cba6bf3c630cfcf0ea8d42542bcfc8ee36294d611c5316ff85e4ade9c8e1e66ad020cf5402bddcfa9557b29969ae6bb9a3870b60
 DIST ceph-10.2.2.tar.gz 11541035 SHA256 7adaaeffb5a787108b5e1494df9165b6420069c0ab710e6e4aad185f423b0f6d SHA512 b47138528af3078646b52e9ea9a561eca4120473e7584c9076e949f0e9bbbdd15aa88e2287a90bd1ddb09d06c29c40181c18da58f5126a442101169ef3419b8a WHIRLPOOL f744444f2064832cba46065bd0fe64996c92bf8ed7888c075dffa9efe1d84393bd2204b38cefe11d0804ea862d0f2ff2d114ea205ff163d60e061e2e4a01db15
 DIST ceph-9.2.1.tar.gz 9933444 SHA256 1918dfc3df80df5986c5b7ff6bc6c78064eef0f6c5e8269dba30e08c703a7c2f SHA512 1e84c1e2d64f4156a523658ed11552b045f75986922b7b7dbaf4719e73a0a6aadc71eb2b94ae363526f729534a592921a437468a41a3cea88c1b84e09de8505a WHIRLPOOL 3a0eb6712e5b0235707e86129e1d66f1184f50cd4980c30f6d8cc0e7dfd96d30b91177ed16dd7abf2ad4983c6a543eb91915f74f661f7d3e3c810b5b1d656aca

diff --git a/sys-cluster/ceph/ceph-0.94.7.ebuild b/sys-cluster/ceph/ceph-0.94.7.ebuild
new file mode 100644
index 0000000..eb31594
--- /dev/null
+++ b/sys-cluster/ceph/ceph-0.94.7.ebuild
@@ -0,0 +1,177 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python2_7 )
+
+if [[ $PV = *9999* ]]; then
+	scm_eclass=git-r3
+	EGIT_REPO_URI="
+		git://github.com/ceph/ceph.git
+		https://github.com/ceph/ceph.git"
+	SRC_URI=""
+else
+	[[ -n ${UPSTREAM_VER} ]] && \
+		UPSTREAM_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${P}-upstream-patches-${UPSTREAM_VER}.tar.xz"
+
+	SRC_URI="http://ceph.com/download/${P}.tar.gz
+		${UPSTREAM_PATCHSET_URI}"
+fi
+KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86"
+
+inherit check-reqs autotools eutils multilib python-single-r1 udev readme.gentoo-r1 systemd ${scm_eclass}
+
+DESCRIPTION="Ceph distributed filesystem"
+HOMEPAGE="http://ceph.com/"
+
+LICENSE="LGPL-2.1"
+SLOT="0"
+IUSE="babeltrace cryptopp debug fuse gtk libatomic +libaio lttng +nss radosgw static-libs jemalloc python tcmalloc xfs zfs"
+
+COMMON_DEPEND="
+	app-arch/snappy
+	dev-libs/boost:=[threads]
+	dev-libs/fcgi
+	dev-libs/libaio
+	dev-libs/libedit
+	dev-libs/leveldb[snappy]
+	nss? ( dev-libs/nss )
+	cryptopp? ( dev-libs/crypto++ )
+	sys-apps/keyutils
+	sys-apps/util-linux
+	dev-libs/libxml2
+	babeltrace? ( dev-util/babeltrace )
+	fuse? ( sys-fs/fuse )
+	libatomic? ( dev-libs/libatomic_ops )
+	xfs? ( sys-fs/xfsprogs )
+	zfs? ( sys-fs/zfs )
+	gtk? (
+		x11-libs/gtk+:2
+		dev-cpp/gtkmm:2.4
+		gnome-base/librsvg
+	)
+	radosgw? (
+		dev-libs/fcgi
+		dev-libs/expat
+		net-misc/curl
+	)
+	jemalloc? ( dev-libs/jemalloc )
+	!jemalloc? ( dev-util/google-perftools )
+	lttng? ( dev-util/lttng-ust )
+	${PYTHON_DEPS}
+	"
+DEPEND="${COMMON_DEPEND}
+	virtual/pkgconfig"
+RDEPEND="${COMMON_DEPEND}
+	sys-apps/hdparm
+	dev-python/flask[${PYTHON_USEDEP}]
+	dev-python/requests[${PYTHON_USEDEP}]
+	"
+REQUIRED_USE="
+	${PYTHON_REQUIRED_USE}
+	^^ ( nss cryptopp )
+	?? ( jemalloc tcmalloc )
+	"
+
+STRIP_MASK="/usr/lib*/rados-classes/*"
+
+PATCHES=(
+	"${FILESDIR}"/${PN}-0.79-libzfs.patch
+	"${FILESDIR}"/${P}-monitor-security.patch
+)
+CHECKREQS_DISK_BUILD="1400M"
+
+pkg_setup() {
+	python_setup
+}
+
+src_prepare() {
+	# Upstream's patchset
+	if [[ -n ${UPSTREAM_VER} ]]; then
+		einfo "Try to apply Ceph Upstream patch set"
+		EPATCH_SUFFIX="patch" \
+		EPATCH_FORCE="yes" \
+		EPATCH_OPTS="-p1" \
+			epatch "${WORKDIR}"/patches-upstream
+	fi
+
+	[[ ${PATCHES[@]} ]] && epatch "${PATCHES[@]}"
+
+	epatch_user
+	eautoreconf
+}
+
+src_configure() {
+	local myeconfargs=(
+		--without-hadoop
+		--docdir="${EPREFIX}/usr/share/doc/${PF}"
+		--includedir=/usr/include
+		$(use_with debug)
+		$(use_with fuse)
+		$(use_with libaio)
+		$(use_with libatomic libatomic-ops)
+		$(use_with nss)
+		$(use_with cryptopp)
+		$(use_with radosgw)
+		$(use_with gtk gtk2)
+		$(use_enable static-libs static)
+		$(use_with jemalloc)
+		$(use_with xfs libxfs)
+		$(use_with zfs libzfs)
+		$(use_with lttng )
+		$(use_with babeltrace)
+		--without-kinetic
+		--without-librocksdb
+	)
+
+	use jemalloc || \
+		myeconfargs+=( $(usex tcmalloc " --with-tcmalloc" " --with-tcmalloc-minimal") )
+
+	PYTHON="${EPYTHON}" \
+		econf "${myeconfargs[@]}"
+}
+
+src_install() {
+	default
+
+	prune_libtool_files --all
+
+	exeinto /usr/$(get_libdir)/ceph
+	newexe src/init-ceph ceph_init.sh
+
+	insinto /etc/logrotate.d/
+	newins "${FILESDIR}"/ceph.logrotate ${PN}
+
+	chmod 644 "${ED}"/usr/share/doc/${PF}/sample.*
+
+	keepdir /var/lib/${PN}
+	keepdir /var/lib/${PN}/tmp
+	keepdir /var/log/${PN}/stat
+
+	newinitd "${FILESDIR}/rbdmap.initd" rbdmap
+	newinitd "${FILESDIR}/${PN}.initd-r1.1" ${PN}
+	newconfd "${FILESDIR}/${PN}.confd-r1" ${PN}
+
+	systemd_dounit           "${FILESDIR}/ceph.target"
+	systemd_newunit          "${FILESDIR}/ceph-mds_at.service"      "ceph-mds@.service"
+	systemd_install_serviced "${FILESDIR}/ceph-mds_at.service.conf" "ceph-mds@.service"
+	systemd_newunit          "${FILESDIR}/ceph-osd_at.service"      "ceph-osd@.service"
+	systemd_install_serviced "${FILESDIR}/ceph-osd_at.service.conf" "ceph-osd@.service"
+	systemd_newunit          "${FILESDIR}/ceph-mon_at.service"      "ceph-mon@.service"
+	systemd_install_serviced "${FILESDIR}/ceph-mon_at.service.conf" "ceph-mon@.service"
+
+	python_fix_shebang \
+		"${ED}"/usr/sbin/{ceph-disk,ceph-create-keys} \
+		"${ED}"/usr/bin/{ceph,ceph-rest-api}
+
+	#install udev rules
+	udev_dorules udev/50-rbd.rules
+	udev_dorules udev/95-ceph-osd.rules
+
+	readme.gentoo_create_doc
+}
+
+pkg_postinst() {
+	readme.gentoo_print_elog
+}

diff --git a/sys-cluster/ceph/files/ceph-0.94.7-monitor-security.patch b/sys-cluster/ceph/files/ceph-0.94.7-monitor-security.patch
new file mode 100644
index 0000000..b225a6f
--- /dev/null
+++ b/sys-cluster/ceph/files/ceph-0.94.7-monitor-security.patch
@@ -0,0 +1,109 @@
+From b78a1be835706e7dabc505be343945d0ac05697d Mon Sep 17 00:00:00 2001
+From: Kefu Chai <kchai@redhat.com>
+Date: Thu, 30 Jun 2016 13:24:22 +0800
+Subject: [PATCH] mon: Monitor: validate prefix on handle_command()
+
+Fixes: http://tracker.ceph.com/issues/16297
+
+Signed-off-by: You Ji <youji@ebay.com>
+(cherry picked from commit 7cb3434fed03a5497abfd00bcec7276b70df0654)
+
+Conflicts:
+    src/mon/Monitor.cc (the signature of Monitor::reply_command()
+                        changed a little bit in master, so adapt the
+                        commit to work with the old method)
+---
+ src/mon/Monitor.cc       | 23 ++++++++++++++++++++++-
+ src/test/librados/cmd.cc | 35 +++++++++++++++++++++++++++++++++++
+ 2 files changed, 57 insertions(+), 1 deletion(-)
+
+diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc
+index 48563ad..d499f0c 100644
+--- a/src/mon/Monitor.cc
++++ b/src/mon/Monitor.cc
+@@ -2565,7 +2565,19 @@ void Monitor::handle_command(MMonCommand *m)
+     return;
+   }
+ 
+-  cmd_getval(g_ceph_context, cmdmap, "prefix", prefix);
++  // check return value. If no prefix parameter provided,
++  // return value will be false, then return error info.
++  if(!cmd_getval(g_ceph_context, cmdmap, "prefix", prefix)) {
++    reply_command(m, -EINVAL, "command prefix not found", 0);
++    return;
++  }
++
++  // check prefix is empty
++  if (prefix.empty()) {
++    reply_command(m, -EINVAL, "command prefix must not be empty", 0);
++    return;
++  }
++
+   if (prefix == "get_command_descriptions") {
+     bufferlist rdata;
+     Formatter *f = Formatter::create("json");
+@@ -2586,6 +2598,15 @@ void Monitor::handle_command(MMonCommand *m)
+   boost::scoped_ptr<Formatter> f(Formatter::create(format));
+ 
+   get_str_vec(prefix, fullcmd);
++
++  // make sure fullcmd is not empty.
++  // invalid prefix will cause empty vector fullcmd.
++  // such as, prefix=";,,;"
++  if (fullcmd.empty()) {
++    reply_command(m, -EINVAL, "command requires a prefix to be valid", 0);
++    return;
++  }
++
+   module = fullcmd[0];
+ 
+   // validate command is in leader map
+diff --git a/src/test/librados/cmd.cc b/src/test/librados/cmd.cc
+index 4f327a0..0a7ed16 100644
+--- a/src/test/librados/cmd.cc
++++ b/src/test/librados/cmd.cc
+@@ -49,6 +49,41 @@ TEST(LibRadosCmd, MonDescribe) {
+   rados_buffer_free(buf);
+   rados_buffer_free(st);
+ 
++  cmd[0] = (char *)"";
++  ASSERT_EQ(-EINVAL, rados_mon_command(cluster, (const char **)cmd, 1, "{}", 2, &buf, &buflen, &st, &stlen));
++  rados_buffer_free(buf);
++  rados_buffer_free(st);
++
++  cmd[0] = (char *)"{}";
++  ASSERT_EQ(-EINVAL, rados_mon_command(cluster, (const char **)cmd, 1, "", 0, &buf, &buflen, &st, &stlen));
++  rados_buffer_free(buf);
++  rados_buffer_free(st);
++
++  cmd[0] = (char *)"{\"abc\":\"something\"}";
++  ASSERT_EQ(-EINVAL, rados_mon_command(cluster, (const char **)cmd, 1, "", 0, &buf, &buflen, &st, &stlen));
++  rados_buffer_free(buf);
++  rados_buffer_free(st);
++
++  cmd[0] = (char *)"{\"prefix\":\"\"}";
++  ASSERT_EQ(-EINVAL, rados_mon_command(cluster, (const char **)cmd, 1, "", 0, &buf, &buflen, &st, &stlen));
++  rados_buffer_free(buf);
++  rados_buffer_free(st);
++
++  cmd[0] = (char *)"{\"prefix\":\"    \"}";
++  ASSERT_EQ(-EINVAL, rados_mon_command(cluster, (const char **)cmd, 1, "", 0, &buf, &buflen, &st, &stlen));
++  rados_buffer_free(buf);
++  rados_buffer_free(st);
++
++  cmd[0] = (char *)"{\"prefix\":\";;;,,,;;,,\"}";
++  ASSERT_EQ(-EINVAL, rados_mon_command(cluster, (const char **)cmd, 1, "", 0, &buf, &buflen, &st, &stlen));
++  rados_buffer_free(buf);
++  rados_buffer_free(st);
++
++  cmd[0] = (char *)"{\"prefix\":\"extra command\"}";
++  ASSERT_EQ(-EINVAL, rados_mon_command(cluster, (const char **)cmd, 1, "", 0, &buf, &buflen, &st, &stlen));
++  rados_buffer_free(buf);
++  rados_buffer_free(st);
++
+   cmd[0] = (char *)"{\"prefix\":\"mon_status\"}";
+   ASSERT_EQ(0, rados_mon_command(cluster, (const char **)cmd, 1, "", 0, &buf, &buflen, &st, &stlen));
+   ASSERT_LT(0u, buflen);
+-- 
+2.9.0
+


             reply	other threads:[~2016-07-11  1:23 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-11  1:23 Yixun Lan [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-10-14  0:50 [gentoo-commits] repo/gentoo:master commit in: sys-cluster/ceph/, sys-cluster/ceph/files/ Sam James
2024-10-01  9:32 Patrick Lauer
2024-07-30  9:05 Patrick Lauer
2024-07-30  9:05 Patrick Lauer
2023-11-08  2:51 Patrick McLean
2023-09-12  2:24 Patrick McLean
2023-06-04  5:06 Sam James
2023-06-03  1:54 Sam James
2023-04-11 23:28 Patrick McLean
2023-03-17 18:07 Patrick McLean
2022-10-28 15:57 Sam James
2022-10-04 23:42 Patrick McLean
2022-08-24 17:07 Patrick McLean
2022-08-22 20:29 Patrick McLean
2022-07-07 18:32 Patrick McLean
2022-06-28  0:27 Patrick McLean
2022-05-17 18:03 Patrick McLean
2022-05-13 10:59 Michał Górny
2022-05-05 22:51 Patrick McLean
2022-05-04 23:17 Patrick McLean
2022-04-29  0:31 Patrick McLean
2021-10-29 20:49 Patrick McLean
2021-10-25 17:02 Patrick McLean
2021-10-25 17:02 Patrick McLean
2021-07-01  0:47 Patrick McLean
2020-12-01  2:35 Patrick McLean
2020-11-25  5:38 Patrick McLean
2020-11-19  7:29 Patrick McLean
2020-09-25  0:53 Patrick McLean
2020-09-16 23:52 Patrick McLean
2020-08-05  0:16 Patrick McLean
2020-06-24  0:51 Patrick McLean
2020-04-03  1:41 Patrick McLean
2019-12-11 22:40 Patrick McLean
2019-11-08 23:26 Patrick McLean
2019-09-17 22:56 Patrick McLean
2019-09-05  0:26 Patrick McLean
2019-07-19  3:20 Patrick McLean
2019-06-13  1:48 Patrick McLean
2019-04-29 22:57 Patrick McLean
2019-04-12  2:05 Patrick McLean
2019-03-29  2:23 Patrick McLean
2019-03-20 21:54 Patrick McLean
2019-03-20  1:12 Patrick McLean
2019-01-08  0:13 Patrick McLean
2018-11-29 23:57 Patrick McLean
2018-11-09  2:51 Patrick McLean
2018-03-10 19:16 Patrick McLean
2018-03-06 19:39 Patrick McLean
2018-02-06 17:43 Patrick Lauer
2017-12-05 20:10 Patrick McLean
2017-10-06 21:07 Patrick McLean
2017-09-27 21:19 Patrick McLean
2017-09-07 23:40 Patrick McLean
2017-08-02 22:11 Patrick McLean
2017-08-02 21:04 Patrick McLean
2017-07-31 19:04 Patrick McLean
2017-07-27 21:33 Patrick McLean
2017-07-27 21:27 Patrick McLean
2017-04-12 20:44 Patrick McLean
2017-02-10  1:18 Patrick McLean
2016-10-11 21:57 Patrick McLean
2016-06-30 23:53 Patrick McLean
2016-06-07  6:45 Yixun Lan
2016-05-12 21:05 Patrick McLean
2016-05-12 18:56 Patrick McLean
2015-12-21  7:47 Yixun Lan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1468200107.361fb48dfdefd0b5442dd36e1b3d9a2cb47f8b07.dlan@gentoo \
    --to=dlan@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox