From owner-freebsd-current Mon Dec 2 13:39:54 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 3079D37B401 for ; Mon, 2 Dec 2002 13:39:53 -0800 (PST) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 55DDA43EBE for ; Mon, 2 Dec 2002 13:39:52 -0800 (PST) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.6/8.12.6) with ESMTP id gB2LdifN051967; Mon, 2 Dec 2002 22:39:45 +0100 (CET) (envelope-from phk@critter.freebsd.dk) To: Dima Dorfman Cc: Taavi Talvik , freebsd-current@freebsd.org Subject: Re: devfs rules and symbolik links In-Reply-To: Your message of "Mon, 02 Dec 2002 21:38:23 GMT." <20021202213823.GA653@trit.org> Date: Mon, 02 Dec 2002 22:39:44 +0100 Message-ID: <51966.1038865184@critter.freebsd.dk> From: Poul-Henning Kamp 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 In message <20021202213823.GA653@trit.org>, Dima Dorfman writes: >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? If it works I'm ok with it. >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")); > -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message