Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932966AbaLDTo2 (ORCPT ); Thu, 4 Dec 2014 14:44:28 -0500 Received: from message.langara.bc.ca ([209.87.29.115]:37050 "EHLO message.langara.bc.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751822AbaLDTo1 (ORCPT ); Thu, 4 Dec 2014 14:44:27 -0500 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-disposition: inline Content-type: text/plain; charset=us-ascii From: Steven Stewart-Gallus To: linux-kernel@vger.kernel.org Message-id: Date: Thu, 04 Dec 2014 19:44:25 +0000 (GMT) X-Mailer: Sun Java(tm) System Messenger Express 6.3-6.03 (built Mar 14 2008; 32bit) Content-language: en Subject: How can I parse the command name from /proc//stat? X-Accept-Language: en Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Given an evil hacker trying to confuse process monitors that might use such strange process names as 'pause) R 0 0 (foo' how can I correctly parse the command name from /proc//stat? Maybe I should just use /proc//status? Maybe there should be some documentation written on the issue? I just wanted to send an email off to check if I was missing anything before writing a few small additions to the documentation or filing a bug report. procps-ng seems to use an ugly hack that involves knowing the limits on the size of a possible command name that I'm not actually sure works totally correctly. Thank you, Steven Stewart-Gallus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/