From owner-svn-src-head@FreeBSD.ORG Tue Feb 10 18:35:47 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B2242CE1; Tue, 10 Feb 2015 18:35:47 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9E00E31E; Tue, 10 Feb 2015 18:35:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1AIZlPX049131; Tue, 10 Feb 2015 18:35:47 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1AIZlnu049130; Tue, 10 Feb 2015 18:35:47 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201502101835.t1AIZlnu049130@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Tue, 10 Feb 2015 18:35:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r278525 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Feb 2015 18:35:47 -0000 Author: rpaulo Date: Tue Feb 10 18:35:46 2015 New Revision: 278525 URL: https://svnweb.freebsd.org/changeset/base/278525 Log: Remove a printf and an strlen() from the coredump code. Modified: head/sys/kern/kern_sig.c Modified: head/sys/kern/kern_sig.c ============================================================================== --- head/sys/kern/kern_sig.c Tue Feb 10 18:05:58 2015 (r278524) +++ head/sys/kern/kern_sig.c Tue Feb 10 18:35:46 2015 (r278525) @@ -3225,14 +3225,13 @@ out: static int coredump_sanitise_path(const char *path) { - size_t len, i; + size_t i; /* * Only send a subset of ASCII to devd(8) because it * might pass these strings to sh -c. */ - len = strlen(path); - for (i = 0; i < len; i++) + for (i = 0; path[i]; i++) if (!(isalpha(path[i]) || isdigit(path[i])) && path[i] != '/' && path[i] != '.' && path[i] != '-') @@ -3365,10 +3364,8 @@ close: snprintf(data, sizeof(data), "comm=%s ", fullpath); free(freepath, M_TEMP); freepath = NULL; - if (vn_fullpath_global(td, vp, &fullpath, &freepath) != 0) { - printf("could not find coredump\n"); + if (vn_fullpath_global(td, vp, &fullpath, &freepath) != 0) goto out; - } if (!coredump_sanitise_path(fullpath)) goto out; strlcat(data, "core=", sizeof(data));