[systemd-devel] [PATCH 2/2] coredump: Handle programs with spaces in COMM

Lennart Poettering lennart at poettering.net
Fri May 3 08:11:12 PDT 2013


On Tue, 30.04.13 15:15, Colin Walters (walters at verbum.org) wrote:

> On Tue, 2013-04-30 at 19:47 +0200, Zbigniew Jędrzejewski-Szmek wrote:
> > On Tue, Apr 30, 2013 at 01:12:19PM -0400, Colin Walters wrote:
> > > This patch makes systemd-coredump handle processes that have
> > > whitespace in their COMM fields.
> > > 
> > > fs/coredump.c when given %e (as systemd-coredump uses), will end up
> > > joining the process arguments into a string (along with the other
> > > fields), then will split the entire thing up on whitespace, and use
> > > it as the arguments to the coredump pipe handler.
> > > 
> > > Previously, systemd-coredump would then reject them as having too many
> > > arguments.
> > > ---
> > That's a workaround for a bug in the kernel. I think it makes sense, but
> > it'd be nice to fix the kernel too.
> 
> To do what though?  Add a new coredump format specifier that gives you
> a string-escaped version as one argument?  That'd probably make sense,
> but then we'd have to test the kernel version before installing a
> specifier.

Nah, don't escape. Just make sure the kernel treats the command line as
char** rather than a single string. It's totally broken to make this a
single string first. If you keep this a char** then no escaping will
ever be necessary.

Lennart

-- 
Lennart Poettering - Red Hat, Inc.


More information about the systemd-devel mailing list