On 17/04/2007, at 10:17 AM, [EMAIL PROTECTED] wrote:

Author: lmuelle
Date: 2007-04-17 17:17:19 +0000 (Tue, 17 Apr 2007)
New Revision: 22318

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=22318

Log:
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.

Modified:
  branches/SAMBA_3_0/source/lib/fault.c
  branches/SAMBA_3_0_25/source/lib/fault.c


Changeset:
Modified: branches/SAMBA_3_0/source/lib/fault.c
===================================================================
--- branches/SAMBA_3_0/source/lib/fault.c 2007-04-17 17:07:14 UTC (rev 22317) +++ branches/SAMBA_3_0/source/lib/fault.c 2007-04-17 17:17:19 UTC (rev 22318)
@@ -161,6 +161,13 @@
        }

#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) {

Do you need to check geteuid() here?

--
James Peach | [EMAIL PROTECTED]

Reply via email to