Enabling core dumps
sudo at realh.co.uk
Wed Oct 23 17:57:22 EDT 2002
In <200210232122.g9NLMZFo020527 at xerxes.courtesan.com>, Todd C. Miller wrote:
> In message <20021023205345.GA14080 at realh.co.uk>
> so spake Tony Houghton (sudo):
> > The target user is news rather than root, but anyway, like I said, I've
> > set the cwd to news' home dir which it can write to (and dumps core in
> > OK if I su manually).
> > sudo itself is setuid of course, so I suppose the kernel must be
> > inhibiting core dumps because of that. Is there any way round it?
> I wouldn't expect that property to be inherited to the child process
> run by sudo. It's the kind of thing normally set at exec time. If
> it works OK when you su, I would expect it to be OK with sudo. At
> one point sudo did disable coredumps in the child but that was
> changed in sudo 1.6.3. What do you see when you run:
> sudo -u news sh -c "ulimit -c"
It says 0. But if I change it to:
sudo -u news sh -c "ulimit -c unlimited; ulimit -c"
it says "unlimited".
The script I'm running from sudo is:
ulimit -c unlimited
echo -n "ulimit for core: "
newsstar -snews -m -A-100 -a -s -vv -f 2>/var/log/news/newsstar
I've just added the echo and the second ulimit line. It also reports
"unlimited", but if I run it from sudo, it still doesn't dump core when
it segfaults (which I'm forcing ATM by writing a NULL pointer). But if I
use su news (with or without the - flag) and run the script from an
interactive bash shell instead, it does.
TH * http://www.realh.co.uk
More information about the sudo-users