Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Aug 2010 16:50:03 GMT
From:      Oliver Fromme <olli@lurza.secnetix.de>
To:        freebsd-geom@FreeBSD.org
Subject:   Re: kern/149762: volume labels with rogue characters
Message-ID:  <201008181650.o7IGo3vu096176@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/149762; it has been noted by GNATS.

From: Oliver Fromme <olli@lurza.secnetix.de>
To: freebsd-bugs@FreeBSD.ORG, bug-followup@FreeBSD.ORG, walter@pelissero.de
Cc:  
Subject: Re: kern/149762: volume labels with rogue characters
Date: Wed, 18 Aug 2010 18:36:22 +0200 (CEST)

 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201008181650.o7IGo3vu096176>