Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Oct 1996 20:17:09 -0400 (EDT)
From:      Tim Vanderhoek <hoek@freenet.hamilton.on.ca>
To:        freebsd-questions@freebsd.org
Subject:   fsck and MAXPATHLEN
Message-ID:  <Pine.GSO.3.95.961014195917.15115A-100000@james.freenet.hamilton.on.ca>

next in thread | raw e-mail | index | archive | help

I decided I would type

cp -R .. .

to see if cp had some check for exceeding MAXPATHLEN that I hadn't noticed
in the source (which I was going through since I'm trying to rewrite a bit
of it to fix that fact that mv doesn't work properly).

(cp -R .. .

will, of course, create an endless chain of directories, since as soon as
it recurses from .. into ., . will have gained a new directory which will
in turn be recursed into, and so on.)

I wasn't surprised when cp itself didn't complain about not exceeding
MAXPATHLEN, but I was surprised when the system (2.2-961006-SNAP) didn't
complain.

Further investigation showed that it was indeed exceeding MAXPATHLEN and
that there were indeed the expected detrimental effects (ie. can't always
determine CWD, or a sheared-off pwd).

However, neither ufs nor fsck (on the still-mounted fs) complained about
anything.  This led me to suspect that MAXPATHLEN is just a suggestion
that userland programs follow, and that there is no reason a userland
program couldn't go beyond MAXPATHLEN if it wanted to?

This theory would, of course, be fine except for the obvious fact that
syscalls such as open(2) can have the error ENAMETOOLONG...

So my question is thus -- Is MAXPATHLEN enforced, and who exactly is
responsible for enforcing it?


--
Outnumbered?  Maybe.  Outspoken?  Never!
tIM...HOEk





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.3.95.961014195917.15115A-100000>