From mboxrd@z Thu Jan  1 00:00:00 1970
Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org)
	by finch.gentoo.org with esmtp (Exim 4.60)
	(envelope-from <gentoo-dev+bounces-30336-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1JmRXC-0004zF-E8
	for garchives@archives.gentoo.org; Thu, 17 Apr 2008 10:40:06 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 1A902E04C2;
	Thu, 17 Apr 2008 10:40:05 +0000 (UTC)
Received: from dspnet.fr.eu.org (dspnet.fr.eu.org [213.186.44.138])
	by pigeon.gentoo.org (Postfix) with ESMTP id E4752E04C2
	for <gentoo-dev@lists.gentoo.org>; Thu, 17 Apr 2008 10:40:04 +0000 (UTC)
Received: by dspnet.fr.eu.org (Postfix, from userid 1007)
	id 05DB1A3641; Thu, 17 Apr 2008 12:40:04 +0200 (CEST)
Date: Thu, 17 Apr 2008 12:40:03 +0200
From: Olivier Galibert <galibert@pobox.com>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev]  Re: escaping variables in sed expressions
Message-ID: <20080417104003.GA22142@dspnet.fr.eu.org>
References: <48048E31.6040209@gentoo.org> <3c32af40804150405qb2bbfbavb8d7ce575dbc2278@mail.gmail.com> <20080415141753.GS29406@der-frank.org> <20080415171606.6e2a900a.genone@gentoo.org> <20080416171751.GT29406@der-frank.org> <20080416182405.651698dd@snowcone> <pan.2008.04.17.04.31.58@cox.net>
Precedence: bulk
List-Post: <mailto:gentoo-dev@lists.gentoo.org>
List-Help: <mailto:gentoo-dev+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-dev+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-dev+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-dev.gentoo.org>
X-BeenThere: gentoo-dev@lists.gentoo.org
Reply-to: gentoo-dev@lists.gentoo.org
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
In-Reply-To: <pan.2008.04.17.04.31.58@cox.net>
User-Agent: Mutt/1.4.2.3i
X-Archives-Salt: 901ccf99-d353-4e5e-aa2c-35b171d8044e
X-Archives-Hash: f1751e3286974b101e150a572d5eb911

On Thu, Apr 17, 2008 at 04:31:59AM +0000, Duncan wrote:
> Ciaran McCreesh <ciaran.mccreesh@googlemail.com> posted
> 20080416182405.651698dd@snowcone, excerpted below, on  Wed, 16 Apr 2008
> 18:24:05 +0100:
> 
> > On Wed, 16 Apr 2008 19:17:51 +0200
> > Frank Gruellich <frank@der-frank.org> wrote:
> >> I was not able to create a filename or path containing it.  (Anyone
> >> else?)
> > 
> > Unix file names can't contain / or null.
> 
> Feel free to correct me if I'm mistaken, but I believe I was reading 
> somewhere and /thought/ it was this list...
> 
> While you are almost certainly correct on POSIX/Unix filenames and the 
> shell won't accept / in a filename, IIRC (from reading) it's often 
> possible for C programs to code a literal / in a filename, and possible 
> for some filesystems (also written in C, generally) to accept it.  Thus, 
> while POSIX/Unix standards don't allow it, in practice, it's sometimes 
> possible, if rare.

You can't access or create a file with a visible '/' in it on linux
using filesystem access calls because the character is taken into
account at the vfs level, i.e. before it hits the filesystem.  That
doesn't preclude three things though:

- Some filesystems are supposed to allow it (hfs for instance).  Dunno
  what the filesystem driver does in that case, perhaps an encoding or a
  mapping.  FS-dependant in any case

- You can change the fs at the sector level and forcibly put a '/' in
  a filename there.  What happens then is also fs-dependant, in the
  usual "interesting things can happen when your filesystem is corrupt"
  way.

- You can have series of codes (such as c0 af) which can be
  interpreted by a permissive utf-8 decoder as an encoding of '/'.
  They're valid in a file name, but they're an incorrect utf8
  sequence.  That's a pure userspace issue though.

  OG.
-- 
gentoo-dev@lists.gentoo.org mailing list