From owner-freebsd-geom@FreeBSD.ORG Thu Aug 19 11:30:04 2010 Return-Path: Delivered-To: freebsd-geom@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 309051065679 for ; Thu, 19 Aug 2010 11:30:04 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 050B38FC12 for ; Thu, 19 Aug 2010 11:30:04 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o7JBU3Oj033856 for ; Thu, 19 Aug 2010 11:30:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o7JBU3jU033851; Thu, 19 Aug 2010 11:30:03 GMT (envelope-from gnats) Date: Thu, 19 Aug 2010 11:30:03 GMT Message-Id: <201008191130.o7JBU3jU033851@freefall.freebsd.org> To: freebsd-geom@FreeBSD.org From: Oliver Fromme Cc: Subject: Re: kern/149762: volume labels with rogue characters X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Oliver Fromme List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Aug 2010 11:30:04 -0000 The following reply was made to PR kern/149762; it has been noted by GNATS. From: Oliver Fromme To: jhell , bug-followup@freebsd.org Cc: Subject: Re: kern/149762: volume labels with rogue characters Date: Thu, 19 Aug 2010 13:29:25 +0200 (CEST) jhell wrote: > This is a hack, something that you would commonly find in Linux code and > is neither a proper or viable workaround for the naming of labels. > > Instead, using glabel(8) the admin/user can create a local label to > FreeBSD that does not change the original nor does it carry over to any > other OS that does not understand geom_label's. There are cases were you cannot create a permanent label with glabel. For example, there are quite a lot of USB devices that insist on having their memory formatted with their own firmware only, destroying any other labels. I own an mp3 player (Medion) that behaves like this. The submitter mentioned a digital camera (Nikon, I think) in a previous thread. How do you suggest to solve the problem for those cases? > Stripping characters no matter what they are with a sysctl is overkill > and does not scale well, all the while - presenting false information to > the user. I don't think there is a scalability issue, because it is only done once when a device is attached. On the other hand, maybe the patch should be changed so it doesn't touch the name at all when the sysctl is 0, so the default behaviour would be no different from what we have today. > I would highly advise against this. If the user does not like > the label that appears in msdosfs/{LABEL} then they are free to change > that at their own will. Unfortunately they are subject to the will of their devices, see above. And if the device's own label contains a space (the Nikon camera mentioned above does), it cannot be used as-is in /etc/fstab. I think a similar problem occurs with the volume names of CD-ROMs and DVD-ROMs, which contain spaces quite often, and you cannot glabel them. But I haven't looked deeply into this, maybe it's not an issue. (Does FreeBSD even support mounting CDs by their volume name, like Solaris does? I've never tried, but it would come in handy, because I have a clip art CD that I use every now and then, and I never remember whether it's in drive cd0 or cd1 currently ...) > I see presenting the label as it is to the user > ``important''. Uhm ... it is not my impression that the names of nodes in /dev are intended to present accurate "external" information to the user. I always thought that the purpose of /dev is an interface between userland software and drivers, and that users shouldn't have to deal with /dev at all during "normal operations". Am I wrong? I mean, there are commands to display the atual labels if you need to see them (and I don't mean "ls /dev/..."). 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 "When your hammer is C++, everything begins to look like a thumb." -- Steve Haflich, in comp.lang.c++