Re: vfs: show unreachable paths in getcwd and proc - breaks screen in chroot env

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 2010-10-03 at 15:13 +0200, Martin Jansa wrote:
> On Sat, Oct 02, 2010 at 05:06:50PM +0200, Miklos Szeredi wrote:
> > On Fri, 2010-10-01 at 23:54 +0200, Martin Jansa wrote:
> > > Hi,
> > > 
> > > your patch 8df9d1a4142311c084ffeeacb67cd34d190eff74
> > > http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8df9d1a4142311c084ffeeacb67cd34d190eff74
> > > 
> > > breaks GNU screen when it's used from chroot, is it expected behavior 
> > > or one of the cases of d_path() usage where it shouldn't be touched?
> > 
> > I guess screen is doing something like
> > 
> >    readlink(proc_path, link, linksize);
> >    fd = open(link, O_...);
> >    ...
> > 
> > This is wrong, it should be doing
> > 
> >    fd = open(proc_path, O_...);
> > 
> > instead.
> > 
> > Thanks,
> > Miklos
> 
> Hi,
> 
> screen is using char *ttyname(int fd) call which returns (unreachable)
> too. It also calls own function stripdev on returned string, so for now
> I'll strip "(unreachable)" there as workaround, but ttyname() should be
> still fixed in libc :/, no idea how often it's used in other apps.
> 
> Here is testcase:
> #include <unistd.h>
> #include <stdio.h>
> 
> int main(int argc, char **argv) {
>   char * tty;
>   tty = ttyname(0);
>   printf("ttyname(0): '%s'\n", tty);
> }
> 
> Regards,

Stripping "(unreachable)" from the beginning is not always the correct
answer.  Libc should also verify that the resulting path (which is
basically just a heuristic) does really refer to same device as the file
descriptor.

Thanks,
Miklos

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux