Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 13 Dec 2001 19:48:08 -0800
From:      Terry Lambert <tlambert2@mindspring.com>
To:        fcash@bigfoot.com
Cc:        Freebsd-chat <freebsd-chat@FreeBSD.ORG>
Subject:   Re: whats this?!
Message-ID:  <3C197678.34FD54EE@mindspring.com>
References:  <3C1954A6.8264978A@pantherdragon.org> <3C18E8BA.24815.F0A8EDA@localhost>

next in thread | previous in thread | raw e-mail | index | archive | help
Freddie Cash wrote:

[ ... BASH and multiple "/" characters ... ]

> It's a Bash "feature".  Anywhere that you can use / in a path, you can
> use multiple /'s.  It only sees the first one and ignores everything up
> to the first non-/ character.
> 
> I've run across this several times in the past, especially with autoconf-
> generated init.d scripts on Linux systems running Bash1 and Bash2.
> 
> Even though it shows you multiple slashes, internally it treats them all
> as one.  [shrug] go fig.

Say, that *is* buggy.

POSIX reserves a leading "//" as the POSIX name space escape
mechanism, so it is required to be passed to the OS, where the
interpretation is implementation defined.

Intermediate "//" not at the lead-in is defined to be treated as
"/", unless it follows the name space escape introducer, in which
case the behaviour is defined by the namespace escaped to.

The POSIX namespace escape mechanism is used in Microsoft OSs to
select network resources, as in:  "//nodename/<path>" for storage
sharing of file spaces over the network (Internally, the path
resolution system treats "/" and "\" identically, though the
"command.com" interpretation is stricter... "/" is treated as the
"switch character", unless in the config.sys you do something
like add the line "switchchar=-", which makes "/" work as "\",
and "-" work as the option introducer instead of "/").

FreeBSD doesn't properly support POSIX namespace escape because
of the way the path resolution recursion in vfs_lookup.c is handled,
since you can't set the namespace as an attribute, and then have it
be inherited over subsequent path components properly (in effect,
you have to prefix each component, as in: "//<ns>/one//<ns>/two..."
to be able to escape the complete path).

It would actually be useful to permit, for example, selection of
the 8.3 vs. Unicode namespaces when doing NTFS lookups, or the 8.3
vs. Joliet vs. RockRidge namespaces when doing ISO9660FS lookups,
or even node selection for SMBFS lookups, so that mounts need not
be explicit.

-- Terry

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-chat" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3C197678.34FD54EE>