[CFT] Fix DEVFS aliases in subdirectories.
Kostik Belousov
kostikbel at gmail.com
Sat Jun 11 19:27:53 UTC 2011
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-fs/attachments/20110611/bdbec30d/attachment.pgp
More information about the freebsd-fs
mailing list