vfs: show unreachable paths in getcwd and proc - breaks screen in chroot env
A message that is not in the archive (sent off-list or not yet received): 20101001215417.GA3469@jama
A message that is not in the archive (sent off-list or not yet received): [email protected]
A message that is not in the archive (sent off-list or not yet received): 20101003131300.GA3205@jama
Quoted 36 lines · Martin Jansa
Quoted 15 lines · Miklos Szeredi
Quoted 7 lines · Martin Jansa
Hi,
your patch
8df9d1a4142311c084ffeeacb67cd34d190eff74
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8df9d1a4142311c084ffeeacb67cd34d190eff74breaks 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_...); ...Quoted 8 lines
This is wrong, it should be doing
fd = open(proc_path, O_...);instead.
Thanks,
MiklosHi,
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>
Quoted 7 lines
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