From owner-freebsd-bugs@FreeBSD.ORG Wed Aug 18 16:36:40 2010 Return-Path: Delivered-To: freebsd-bugs@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B4F71065670; Wed, 18 Aug 2010 16:36:40 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [IPv6:2a01:170:102f::2]) by mx1.freebsd.org (Postfix) with ESMTP id 8FFF88FC16; Wed, 18 Aug 2010 16:36:39 +0000 (UTC) Received: from lurza.secnetix.de (localhost [127.0.0.1]) by lurza.secnetix.de (8.14.3/8.14.3) with ESMTP id o7IGaMmg040609; Wed, 18 Aug 2010 18:36:37 +0200 (CEST) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.3/8.14.3/Submit) id o7IGaMpJ040608; Wed, 18 Aug 2010 18:36:22 +0200 (CEST) (envelope-from olli) Date: Wed, 18 Aug 2010 18:36:22 +0200 (CEST) Message-Id: <201008181636.o7IGaMpJ040608@lurza.secnetix.de> From: Oliver Fromme To: freebsd-bugs@FreeBSD.ORG, bug-followup@FreeBSD.ORG, walter@pelissero.de In-Reply-To: <201008181015.o7IAFUdF002639@zaphod.home.lan> X-Newsgroups: list.freebsd-bugs User-Agent: tin/1.8.3-20070201 ("Scotasay") (UNIX) (FreeBSD/6.4-PRERELEASE-20080904 (i386)) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.3.4 (lurza.secnetix.de [127.0.0.1]); Wed, 18 Aug 2010 18:36:37 +0200 (CEST) Cc: Subject: Re: kern/149762: volume labels with rogue characters X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Aug 2010 16:36:40 -0000 Walter C. Pelissero wrote: > In the following patch, the function sanitise_name (controlled > by kern.geom.label.sanitation sysctl) replaces characters > deemed invalid according to three levels: > > 0 - replace only '/'s with '#'s > 1 - like 0, but also replace whitespace and all the ASCII control > characters (anything below 0x20) with '_' > 2 - like 1, but also replace anything above 0x7E with '#' > > Note that the replacement of '/'s is done in any case. I > don't know whether that might be redundant or even bad in the > context of the other geom_label stuff. It just made sense, > but I don't have enough familiarity with that code. FWIW, I like this approach much better than the one from bin/149424. (Trying to put personal attitudes aside.) I have reviewed the patch (the second one from the followup), and it looks good to me, except for a few minor style(9) issues, and one type problem: By default, char is unsigned, so the comparisons p <= ' ' and p > '~' probably don't do what you expect. Other than that, the patch looks fine to me. But I'm not authoritative regarding the geom code in the kernel, so I cannot pick this up myself. I'll re-assign the PR to -geom, maybe someone there can help. Best regards Oliver -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "... there are two ways of constructing a software design: One way is to make it so simple that there are _obviously_ no deficiencies and the other way is to make it so complicated that there are no _obvious_ deficiencies." -- C.A.R. Hoare, ACM Turing Award Lecture, 1980