• Jiri Slaby's avatar
    coredump: escape / in hostname and comm · 2c563731
    Jiri Slaby authored
    Change every occurence of / in comm and hostname to !.  If the process
    changes its name to contain /, the core is not dumped (if the directory
    tree doesn't exist like that).  The same with hostname being something
    like myhost/3.  Fix this behaviour by using the escape loop used in %E.
    (We extract it to a separate function.)
    
    Now both with comm == myprocess/1 and hostname == myhost/1, the core is
    dumped like (kernel.core_pattern='core.%p.%e.%h):
    core.2349.myprocess!1.myhost!1
    Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
    Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
    Cc: Al Viro <viro@zeniv.linux.org.uk>
    Cc: Andi Kleen <andi@firstfloor.org>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    2c563731
exec.c 52.2 KB