1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

r22318: If we're running as non root we might not be able to dump the core file

to the corepath.

Even the chdir() will fail if the LOGFILEBASE path is set 0700.

If the currrent user doesn't have the permission to create the core file
we end with:
   unable to change to <LOGFILEBASE>
   refusing to dump core

The alternative would be to change the permissions of the directory.
But taht would not ensure core dumps are working out of the box.
(This used to be commit 0814a3acbe)
This commit is contained in:
Lars Müller 2007-04-17 17:17:19 +00:00 committed by Gerald (Jerry) Carter
parent 123e721590
commit ffc03ada71

View File

@ -161,6 +161,13 @@ void dump_core_setup(const char *progname)
}
#if DUMP_CORE
/* If we're running as non root we might not be able to dump the core
* file to the corepath. There must not be an unbecome_root() before
* we call abort(). */
if (getuid() != 0) {
become_root();
}
if (*corepath != '\0') {
/* The chdir might fail if we dump core before we finish
* processing the config file.