Date: Sat, 11 Jun 2011 22:27:48 +0300 From: Kostik Belousov <kostikbel@gmail.com> To: Jaakko Heinonen <jh@freebsd.org>, "Justin T. Gibbs" <gibbs@scsiguy.com>, fs@freebsd.org Subject: Re: [CFT] Fix DEVFS aliases in subdirectories. Message-ID: <20110611192748.GM48734@deviant.kiev.zoral.com.ua> In-Reply-To: <20110611104215.GG48734@deviant.kiev.zoral.com.ua> References: <4DF287F0.8080301@scsiguy.com> <20110611070939.GC10793@jh> <20110611104215.GG48734@deviant.kiev.zoral.com.ua>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --]
On Sat, Jun 11, 2011 at 01:42:15PM +0300, Kostik Belousov wrote:
> On Sat, Jun 11, 2011 at 10:09:40AM +0300, Jaakko Heinonen wrote:
> >
> > Hi,
> >
> > On 2011-06-10, Justin T. Gibbs wrote:
> > > The aliased devs are far from the root and so must have "../" entries
> > > added in order to function correctly. I considered making the symlink
> > > paths absolute, but that complicates jail handling.
> Alternatively, you might change devfs_readlink, prepending the absolute
> symlinks with the statfs.f_mntonname. This indeed would have to consider
> the case of a jailed process. No, I am not requesting this.
Just remembered, sometimes links on the devfs point out of devfs.
Look, for instance, on the /dev/log symlink on the running system.
pooma% ls -l /dev/log
lrwxr-xr-x 1 root wheel 12 Jun 11 21:08 /dev/log -> /var/run/log
Wouldn't the patch break it ?
>
> > >
> > > Are there any objections to the attached change?
> >
> > > @@ -584,14 +584,43 @@
> > >
> > > de = devfs_newdirent(s, q - s);
> > > if (cdp->cdp_c.si_flags & SI_ALIAS) {
> > > + char *slash;
> > > + int depth;
> > > + int namelen;
> > > + int buflen;
> > > + int i;
> >
> > style(9) discourages putting declarations inside blocks. Please consider
> > putting symlink name generation to its own helper function.
> > devfs_populate_loop() has already become too large.
[-- Attachment #2 --]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (FreeBSD)
iEYEARECAAYFAk3zwbMACgkQC3+MBN1Mb4hnEQCdEGXGwWNZvFuIz9enb+ikMmTt
SygAoK3KEWyUPrpaAH8dHWLaCDH1esNW
=hRw0
-----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110611192748.GM48734>
