From owner-dev-commits-src-main@freebsd.org Thu Jul 22 16:39:02 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 77F51660339; Thu, 22 Jul 2021 16:39:02 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oi1-f178.google.com (mail-oi1-f178.google.com [209.85.167.178]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4GVyny2qc0z3tlK; Thu, 22 Jul 2021 16:39:02 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oi1-f178.google.com with SMTP id t143so7212556oie.8; Thu, 22 Jul 2021 09:39:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=n+b48HCVQXeviP+aZbekddzrhWxCh7RQHAFW2uBmutY=; b=OfXuUz+CM1n0cBfEX0dqdTWwGv8EffMJquj4KM/UIc31vrYkpIEuD0za5xbHoax7RH eXObTmERUYNGwlTUI6z3uS4UvUIQwQVNCIgR6kbARqGRsJat4iadqhEK7QmGmpdV/zQ/ hBEwWot9G/HWqyeXFE89E86Kbe9qtVLOv9WMRLkdAC+YGAOP96ql7+i9f2NhVugUChTT dShRvm3JMWS6w62EXmUjDC2aXL7rwIc9bP9KCa3VP7n7DMSUiCZWHKt6CjjvcBCL2TWi E1jUsFg7otEmT6UU14/y1ICLHPzGi1l+xJYr+78WeJbUEMxTBPzrm3NMEkVzl5Db8zWi yi3w== X-Gm-Message-State: AOAM531mjUP0wRug5BToFokGD5fOYyjgau1TvKgqZxu3E0WukHSiG6c3 o4dqNiOuEpx9UvOUnsWDPGv9P/bcjNp2Y+wxIEyvKt3Jpz4= X-Google-Smtp-Source: ABdhPJwQbCT7A1HD0tDaprOELh22EqJXIISS8+KNUDQvM+M5e3t5XIdRTdlldi+fE2Cr1NbHnrnMmS7WnovA0qylwuk= X-Received: by 2002:aca:4814:: with SMTP id v20mr595268oia.73.1626971941209; Thu, 22 Jul 2021 09:39:01 -0700 (PDT) MIME-Version: 1.0 References: <202107221623.16MGNZDu023290@gitrepo.freebsd.org> <9fe74162-d1f9-623c-3a9e-d41139729aab@selasky.org> In-Reply-To: <9fe74162-d1f9-623c-3a9e-d41139729aab@selasky.org> From: Alan Somers Date: Thu, 22 Jul 2021 10:38:50 -0600 Message-ID: Subject: Re: git: 6c9506559080 - main - Escape any '.' characters in sysctl node names To: Hans Petter Selasky Cc: src-committers , "" , dev-commits-src-main@freebsd.org X-Rspamd-Queue-Id: 4GVyny2qc0z3tlK X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 Jul 2021 16:39:02 -0000 Because if we reject invalid sysctl names, then we'll have to perform the escaping in (potentially many) more places. The only source of invalid sysctl names that I know of are ZFS pools. ZFS does allow space in pool names, and sysctl(8) works with spaces as long as you quote them on the command line. It does not allow tabs or newlines. I didn't check any other nonprintable characters. We can certainly add other characters to the escape list if needed. -Alan On Thu, Jul 22, 2021 at 10:32 AM Hans Petter Selasky wrote: > On 7/22/21 6:23 PM, Alan Somers wrote: > > commit 6c9506559080da2914749bf611225d7c0a153609 > > Author: Alan Somers > > AuthorDate: 2021-07-21 21:11:00 +0000 > > Commit: Alan Somers > > CommitDate: 2021-07-22 16:22:48 +0000 > > If the strings come from user-input or hardware, why not just allow a-z > and 0-9 and a few other characters? > > There are surely more illegal characters than just '.', like \n \r \t > that we don't want to see in sysctl names. > > --HPS >