Skip to content

Commit

Permalink
Merge pull request #11582 from batrick/ceph-dumpable
Browse files Browse the repository at this point in the history
core: set dumpable flag after setuid

Reviewed-by: Brad Hubbard <bhubbard@redhat.com>
  • Loading branch information
badone committed Oct 28, 2016
2 parents fb64281 + ff0e521 commit a271880
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/global/global_init.cc
Expand Up @@ -31,6 +31,10 @@
#include <grp.h>
#include <errno.h>

#ifdef HAVE_SYS_PRCTL_H
#include <sys/prctl.h>
#endif

#define dout_subsys ceph_subsys_

static void global_init_set_globals(CephContext *cct)
Expand Down Expand Up @@ -262,6 +266,12 @@ void global_init(std::vector < const char * > *alt_def_args,
}
}

#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

// Expand metavariables. Invoke configuration observers. Open log file.
g_conf->apply_changes(NULL);

Expand Down

0 comments on commit a271880

Please sign in to comment.