]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
core: set dumpable flag after setuid 11736/head
authorPatrick Donnelly <pdonnell@redhat.com>
Wed, 19 Oct 2016 23:10:14 +0000 (19:10 -0400)
committerAbhishek Varshney <abhishek.varshney@flipkart.com>
Wed, 2 Nov 2016 06:43:55 +0000 (12:13 +0530)
commit3667c56c8781c1f1c14007ccf7936dd033350009
treec01f9551e9c3c107595f74e129ac049fb9bce41a
parent7b3ec119cb968a26526ad95355c5bf7525fb5346
core: set dumpable flag after setuid

When ceph-* drops drops privileges via setuid, core dumps are no longer
generated because its DUMPABLE flag is cleared. We have to manually
turn that back on.

From prctl(2):

      Normally, this flag is set to 1.  However, it is reset to the current value contained in the file /proc/sys/fs/suid_dumpable (which by default has the value 0), in the fol‐
      lowing circumstances:

      *  The process's effective user or group ID is changed.

      *  The process's filesystem user or group ID is changed (see credentials(7)).

      *  The process executes (execve(2)) a set-user-ID or set-group-ID program, or a program that has capabilities (see capabilities(7)).

Fixes: http://tracker.ceph.com/issues/17650
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit ff0e521434acb8c57c65ce3d2a2b9af4cfe914f1)
src/global/global_init.cc