From owner-freebsd-hackers Sun Oct 17 11:37:22 1999 Delivered-To: freebsd-hackers@freebsd.org Received: from rover.village.org (rover.village.org [204.144.255.49]) by hub.freebsd.org (Postfix) with ESMTP id D445D14C28 for ; Sun, 17 Oct 1999 11:37:15 -0700 (PDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.9.3/8.9.3) with ESMTP id MAA03279; Sun, 17 Oct 1999 12:37:13 -0600 (MDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost.village.org [127.0.0.1]) by harmony.village.org (8.9.3/8.8.3) with ESMTP id MAA04529; Sun, 17 Oct 1999 12:36:48 -0600 (MDT) Message-Id: <199910171836.MAA04529@harmony.village.org> To: "Aleksandr A.Babaylov" Subject: Re: how mkdir without .. ? Cc: freebsd-hackers@FreeBSD.ORG In-reply-to: Your message of "Fri, 15 Oct 1999 17:24:12 +0400." <199910151324.RAA22353@aaz.links.ru> References: <199910151324.RAA22353@aaz.links.ru> Date: Sun, 17 Oct 1999 12:36:48 -0600 From: Warner Losh Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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