Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 02 Dec 2002 22:39:44 +0100
From:      Poul-Henning Kamp <phk@critter.freebsd.dk>
To:        Dima Dorfman <dima@trit.org>
Cc:        Taavi Talvik <taavi@uninet.ee>, freebsd-current@freebsd.org
Subject:   Re: devfs rules and symbolik links 
Message-ID:  <51966.1038865184@critter.freebsd.dk>
In-Reply-To: Your message of "Mon, 02 Dec 2002 21:38:23 GMT." <20021202213823.GA653@trit.org> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <20021202213823.GA653@trit.org>, Dima Dorfman writes:
>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?

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




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