<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi,<br>
<br>
I have a question about using unnamed pipes with procfs.
<br>
<br>
Suppose a chrooted environment with proc mounted as procfs. I am
trying to use bash process substitution feature and get this:
<br>
<br>
$ cat <(echo hello)
<br>
cat: /dev/fd/63: No such file or directory
<br>
<br>
While on the normal system:
<br>
$ cat <(echo hello)
<br>
hello
<br>
<br>
As I understand, the problem is that when fuse making getattr on
file '/dev/fd/63' - it determines that it is symlink. The next step
is readlink, which gives something like that: /25977/fd/63 =>
pipe:[3087676]. And at the final step getattr on file
'/25977/fd/pipe:[3087676]' gives no such file or directory.
<br>
<br>
Actually I encouter this issue while working on similar fuse proc
(for jail environments). Then I find procfs, tried it out and get
the same failure.
<br>
<br>
I've also tried to change logic of getattr in the next way. First
make normal stat of file. If it is not S_ISFIFO - make lstat. In
that way the process hangs forever on open syscall:
<br>
$ strace cat <(echo hello)
<br>
...
<br>
open("/dev/fd/63", O_RDONLY
<br>
<br>
<br>
Is there any workaround for this problem?<br>
<br>
<div class="moz-txt-sig"><font color="#000000">--<br>
Timofey Kirillov</font><br>
</div>
<br>
</body>
</html>