[SWLUG] how hard can it be... to get a core dump

Dave Cridland dave at cridland.net
Thu Sep 25 07:48:21 UTC 2008


On Thu Sep 25 08:16:19 2008, Mark Summerfield wrote:
> and even if I use sysctl with -e I still end up with
> 
>     $ cat /proc/sys/fs/suid_dumpable
> 
> printing 0.

Ah... If it's a setuid program, we found it easiest to do it within  
the source:

+#if defined (linux)
+            prctl(PR_SET_DUMPABLE, 1UL);
+#endif

That bit is just after the setuid() call.

We assume that people who don't want core dumps will ulimit it away,  
you might want to make it optional.

Dave.
-- 
Dave Cridland - mailto:dave at cridland.net - xmpp:dwd at dave.cridland.net
  - acap://acap.dave.cridland.net/byowner/user/dwd/bookmarks/
  - http://dave.cridland.net/
Infotrope Polymer - ACAP, IMAP, ESMTP, and Lemonade



More information about the Swlug mailing list