From owner-freebsd-bugs@FreeBSD.ORG Wed Dec 28 09:16:58 2005 Return-Path: X-Original-To: freebsd-bugs@freebsd.org Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4604116A41F for ; Wed, 28 Dec 2005 09:16:58 +0000 (GMT) (envelope-from tzachi_tager@yahoo.com) Received: from web30805.mail.mud.yahoo.com (web30805.mail.mud.yahoo.com [68.142.200.148]) by mx1.FreeBSD.org (Postfix) with SMTP id 2DAC243D5A for ; Wed, 28 Dec 2005 09:16:57 +0000 (GMT) (envelope-from tzachi_tager@yahoo.com) Received: (qmail 48875 invoked by uid 60001); 28 Dec 2005 09:16:04 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=06UUgkDB26fJiRs5X08gcT2Jri3f+AH1FQM3oPcdVCgY5JBXEMuMBCZJv/mbWKCAJxbkXcM2uxh2+cyh7hDuBoKBUz8g+Mg/IouIwMEew/C0lrp3HRuhlgjLC+9RDj34Zscy9aeyUHvVI/WP6j2RjPjSnJZ/y4vlINT1DARR7bU= ; Message-ID: <20051228091604.48873.qmail@web30805.mail.mud.yahoo.com> Received: from [80.74.107.235] by web30805.mail.mud.yahoo.com via HTTP; Wed, 28 Dec 2005 01:16:04 PST Date: Wed, 28 Dec 2005 01:16:04 -0800 (PST) From: Tzachi Tager To: Giorgos Keramidas In-Reply-To: <20051228032332.GA30303@flame.pc> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-bugs@freebsd.org Subject: Re: using /dev/null in chrooted enviroment X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Dec 2005 09:16:58 -0000 Hi, Giorgos Keramidas wrote: On 2005-12-27 06:49, Tzachi Tager wrote: > Hi, > I'm trying to create chrooted enviroment, i did the folllowing > in the chrooted enviroment: > > mknode c null 0 24 > mknode c zero 0 25 > > And then i did chroot and those files are under /dev, but when > i wrote a short program in C that tries to open /dev/null > (within the chrooted env.) i got: > > "/dev/null-operation is not supported" > You forgot to mention what version of FreeBSD you are using. It > may also help to see the contents of the chrooted /dev directory. Sorry, We are using: FreeBSD freebsd6.0 6.0-RELEASE FreeBSD 6.0-RELEASE #0: Thu Nov 3 09:36:13 UTC 2005 root@x64.samsco.home:/usr/obj/usr/src/sys/GENERIC i386 We tried: 1) To create only /dev/null and /dev/zero (that configuration worked in FreeBSD 5.4) 2) To create the same /dev contents via: tar -cf - /dev | tar -xf - The original system has /dev mounted as: devfs on /dev (devfs, local) > Only by doing mount of devfs it seems to work fine, but i > prefer not to do mount every time (because then i get that my > chrooted enviroment pathname is too long for FreeBSD) > A complete trace of the commands you are running and the exact > error message is probably necessary here. The very simple C program doesn't run in chroot: int main() { if (open ("/dev/null", O_WRONLY) == -1) { perror ("open"); } } It issues: "open: Operation not supported". PS: It seems like if we mount devfs to the chrooted env - everything works. The problem is that chroot directory can be placed everywhere, but mount doesn't accept very long path: # mount -t devfs none dev mount_devfs: File name too long # pwd /tmp/build.debugger-php-4.0.6.5269/debugger-php-4.0.6-DEBUG_SERVER_5_1_0_RC3_20051215 _______________________________________________ freebsd-bugs@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-bugs To unsubscribe, send any mail to "freebsd-bugs-unsubscribe@freebsd.org" --------------------------------- Yahoo! Shopping Find Great Deals on Holiday Gifts at Yahoo! Shopping