Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Dec 2002 21:38:23 +0000
From:      Dima Dorfman <dima@trit.org>
To:        Taavi Talvik <taavi@uninet.ee>
Cc:        freebsd-current@freebsd.org, phk@freebsd.org
Subject:   Re: devfs rules and symbolik links
Message-ID:  <20021202213823.GA653@trit.org>
In-Reply-To: <20021118163413.T80351-100000@valu.uninet.ee>
References:  <20021118163413.T80351-100000@valu.uninet.ee>

next in thread | previous in thread | raw e-mail | index | archive | help
Taavi Talvik <taavi@uninet.ee> 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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021202213823.GA653>