From owner-svn-src-stable-10@freebsd.org Wed Oct 14 06:26:56 2015 Return-Path: Delivered-To: svn-src-stable-10@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 795FAA13228; Wed, 14 Oct 2015 06:26:56 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 42B4A163F; Wed, 14 Oct 2015 06:26:56 +0000 (UTC) (envelope-from bapt@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t9E6QtZP035777; Wed, 14 Oct 2015 06:26:55 GMT (envelope-from bapt@FreeBSD.org) Received: (from bapt@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t9E6QtgK035776; Wed, 14 Oct 2015 06:26:55 GMT (envelope-from bapt@FreeBSD.org) Message-Id: <201510140626.t9E6QtgK035776@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bapt set sender to bapt@FreeBSD.org using -f From: Baptiste Daroussin Date: Wed, 14 Oct 2015 06:26:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r289291 - stable/10/sbin/sysctl X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Oct 2015 06:26:56 -0000 Author: bapt Date: Wed Oct 14 06:26:55 2015 New Revision: 289291 URL: https://svnweb.freebsd.org/changeset/base/289291 Log: Trim spaces at the end of the buffer before trying to convert it to an oid This allows to write entries in sysctl.conf with spaces before the '=' like kern.ipc.shmmax = 9663676416 Sponsored by: Gandi.net Modified: stable/10/sbin/sysctl/sysctl.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sbin/sysctl/sysctl.c ============================================================================== --- stable/10/sbin/sysctl/sysctl.c Wed Oct 14 06:24:01 2015 (r289290) +++ stable/10/sbin/sysctl/sysctl.c Wed Oct 14 06:26:55 2015 (r289291) @@ -233,6 +233,12 @@ parse(const char *string, int lineno) newval = cp; newsize = strlen(cp); } + /* Trim spaces */ + cp = bufp + strlen(bufp) - 1; + while (cp >= bufp && isspace((int)*cp)) { + *cp = '\0'; + cp--; + } len = name2oid(bufp, mib); if (len < 0) {