From owner-freebsd-current Mon Dec 2 13:38:33 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0F6EF37B401; Mon, 2 Dec 2002 13:38:32 -0800 (PST) Received: from client1.solarflare.com (client1.solarflare.com [216.237.3.222]) by mx1.FreeBSD.org (Postfix) with ESMTP id 854B143EBE; Mon, 2 Dec 2002 13:38:31 -0800 (PST) (envelope-from dima@trit.org) Received: from vagabond.solarflarecom.com (vagabond [10.20.40.41]) by client1.solarflare.com (8.12.1/8.12.1) with ESMTP id gB2LbwWJ025294; Mon, 2 Dec 2002 13:37:58 -0800 (PST) Received: from vagabond.solarflarecom.com (mail.trit.org [127.0.0.1]) by vagabond.solarflarecom.com (8.12.6/8.12.5) with ESMTP id gB2LcP7c001158; Mon, 2 Dec 2002 21:38:25 GMT (envelope-from dima@trit.org) Received: (from dima@localhost) by vagabond.solarflarecom.com (8.12.6/8.12.6/Submit) id gB2LcNNt001157; Mon, 2 Dec 2002 21:38:23 GMT X-Authentication-Warning: vagabond.solarflarecom.com: dima set sender to dima@trit.org using -f Date: Mon, 2 Dec 2002 21:38:23 +0000 From: Dima Dorfman To: Taavi Talvik Cc: freebsd-current@freebsd.org, phk@freebsd.org Subject: Re: devfs rules and symbolik links Message-ID: <20021202213823.GA653@trit.org> References: <20021118163413.T80351-100000@valu.uninet.ee> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20021118163413.T80351-100000@valu.uninet.ee> User-Agent: Mutt/1.4i Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Taavi Talvik wrote: > > I'i try to set up jail with following script, however > as result, urandom/stdin/stdout/stderr will not appear. > > They exist before applying devfs rules, but I cannot find > rules how to unhide those. Any ideas!? Please try the attached patch, which should be able to match symlinks based on pathname in order to unhide them. This is only lightly tested, and I'm not entirely sure why I didn't do this before (ISTR having trouble getting it to work, but this seems absurdly logical and simple), but it seems to work. phk, does this look okay to you? Dima. Index: devfs_rule.c =================================================================== RCS file: /a/ncvs/src/sys/fs/devfs/devfs_rule.c,v retrieving revision 1.3 diff -u -r1.3 devfs_rule.c --- devfs_rule.c 8 Oct 2002 04:21:54 -0000 1.3 +++ devfs_rule.c 2 Dec 2002 21:20:04 -0000 @@ -634,7 +634,8 @@ dev = devfs_rule_getdev(de); if (dev != NULL) pname = dev->si_name; - /* XXX: Support symlinks (check d_type == DT_LNK here). */ + else if (de->de_dirent->d_type == DT_LNK) + pname = de->de_dirent->d_name; else return (0); KASSERT(pname != NULL, ("devfs_rule_matchpath: NULL pname")); To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message