From owner-svn-src-all@FreeBSD.ORG Wed Apr 14 08:40:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9038A1065670; Wed, 14 Apr 2010 08:40:42 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 071F88FC0A; Wed, 14 Apr 2010 08:40:41 +0000 (UTC) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id o3E8ebst001396 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 14 Apr 2010 11:40:37 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4) with ESMTP id o3E8ebB4092175; Wed, 14 Apr 2010 11:40:37 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.4/8.14.4/Submit) id o3E8ebxg092174; Wed, 14 Apr 2010 11:40:37 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Wed, 14 Apr 2010 11:40:37 +0300 From: Kostik Belousov To: Jaakko Heinonen Message-ID: <20100414084037.GK2415@deviant.kiev.zoral.com.ua> References: <201004131853.o3DIrdOT035078@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="+pJtUjZ2dt//FV8b" Content-Disposition: inline In-Reply-To: <201004131853.o3DIrdOT035078@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, DNS_FROM_OPENWHOIS autolearn=no version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r206560 - head/sys/fs/devfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 08:40:42 -0000 --+pJtUjZ2dt//FV8b Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Apr 13, 2010 at 06:53:39PM +0000, Jaakko Heinonen wrote: > Author: jh > Date: Tue Apr 13 18:53:39 2010 > New Revision: 206560 > URL: http://svn.freebsd.org/changeset/base/206560 >=20 > Log: > - Ignore and report duplicate and empty device names in devfs_populate_= loop() > instead of causing erratic behavior. Currently make_dev(9) can't fail= , so > there is no way to report an error to make_dev(9) callers. > - Disallow using "." and ".." in device path names. It didn't work prev= iously > but now it is reported rather than panicing. > - Treat multiple sequential slashes as single in device path names. > =20 > Discussed with: pjd I think that this could be done more clean. Main motivation of not changing make_dev(9) seems to be desire to avoid handling impossible errors for creation of simple-named devices, where device name is fully controlled by driver. On the other hand, make_dev(9) is sometimes used to create devfs node with externally-supplied name, that does not obey devfs naming rules, or cause some other irregularity. The make_dev_credf() signature can be changed to return int error code instead of void, and a flag, lets call it MAKEDEV_CHECKNAME, added, that specifies that make_dev_credf() is allowed to fail with error EINVAL if supplied name is not sane. If flag is not supplied, make_dev_credf() should KASSERT or even just panic(9) if name does not pass internal validation. Small comment about the patch itself: Collapsion of the consequent '/' may be done in make_dev_credv() immediately after vsnprintf(). --+pJtUjZ2dt//FV8b Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (FreeBSD) iEYEARECAAYFAkvFf4QACgkQC3+MBN1Mb4g7jACfVTb9ZWTjg48Rii94b+inlhgB OlEAn0V+ywtGfpP5BRG5PgI6fIXZYp2v =rqAv -----END PGP SIGNATURE----- --+pJtUjZ2dt//FV8b--