From bc458d39630b599e0e1ca9fe25ad7455fcffdd10 Mon Sep 17 00:00:00 2001 From: Brad Hubbard Date: Mon, 27 Feb 2017 13:06:59 +1000 Subject: [PATCH] rgw: set dumpable flag after setuid post ff0e521 ff0e521 resolved the issue for the other daemons but not for rgw since it calls setuid (via civetweb) after the new code sets PR_SET_DUMPABLE. Add another prctl call before wait_shutdown. Fixes: http://tracker.ceph.com/issues/19089 Signed-off-by: Brad Hubbard --- src/rgw/rgw_main.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/rgw/rgw_main.cc b/src/rgw/rgw_main.cc index 5bd734891597..2a400ec4fb30 100644 --- a/src/rgw/rgw_main.cc +++ b/src/rgw/rgw_main.cc @@ -64,6 +64,10 @@ #include "include/types.h" #include "common/BackTrace.h" +#ifdef HAVE_SYS_PRCTL_H +#include +#endif + #define dout_subsys ceph_subsys_rgw using namespace std; @@ -532,6 +536,12 @@ int main(int argc, const char **argv) realm_watcher.add_watcher(RGWRealmNotify::Reload, reloader); realm_watcher.add_watcher(RGWRealmNotify::ZonesNeedPeriod, pusher); +#if defined(HAVE_SYS_PRCTL_H) + if (prctl(PR_SET_DUMPABLE, 1) == -1) { + cerr << "warning: unable to set dumpable flag: " << cpp_strerror(errno) << std::endl; + } +#endif + wait_shutdown(); derr << "shutting down" << dendl; -- 2.47.3