]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: set dumpable flag after setuid post ff0e521 13844/head
authorBrad Hubbard <bhubbard@redhat.com>
Mon, 27 Feb 2017 03:06:59 +0000 (13:06 +1000)
committerNathan Cutler <ncutler@suse.com>
Tue, 7 Mar 2017 21:18:56 +0000 (22:18 +0100)
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 <bhubbard@redhat.com>
(cherry picked from commit bc458d39630b599e0e1ca9fe25ad7455fcffdd10)

src/rgw/rgw_main.cc

index d03fd251f8fe2be520e7e54b456ca8bfc4765c7c..18d09d5a5d9f94df799491d507b308c4076273f3 100644 (file)
 #include "include/types.h"
 #include "common/BackTrace.h"
 
+#ifdef HAVE_SYS_PRCTL_H
+#include <sys/prctl.h>
+#endif
+
 #define dout_subsys ceph_subsys_rgw
 
 using namespace std;
@@ -480,6 +484,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;