Date: Sun, 17 Oct 1999 12:36:48 -0600 From: Warner Losh <imp@village.org> To: "Aleksandr A.Babaylov" <babolo@links.ru> Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: how mkdir without .. ? Message-ID: <199910171836.MAA04529@harmony.village.org> In-Reply-To: Your message of "Fri, 15 Oct 1999 17:24:12 %2B0400." <199910151324.RAA22353@aaz.links.ru> References: <199910151324.RAA22353@aaz.links.ru>
index | next in thread | previous in thread | raw e-mail
In message <199910151324.RAA22353@aaz.links.ru> "Aleksandr A.Babaylov" writes:
: I need in directories without link to parent in it
: or with link to parent renamed to something exotic name.
:
: What is the method to do it without kernel patching
: in FreeBSD 2.2.X or 3.X ?
I don't think this is possible. Even / has a parent directory
(/.. being the only loop in the directory graph allowed).
If you want to create a process that has no working directory, you can
do this by, for example,
mkdir("/tmp/foo");
chdir("/tmp/foo");
rmdir("/tmp/foo");
which will make it impossible to create files in dot (./). This can
cause other problems as many programs assume they can walk up to
root.
The jail code in -current may also be of interest.
Warner
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message
help
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199910171836.MAA04529>
