0

I have 2 users, user A and user B. The user B creates a named pipe with all permissions(rwxrwxrwx).

USER B: execute ./test < input.txt (test is a program that writes from stdinput to the pipe).

USER A : reads from the named pipe

The problem is that the USER B cannot open the pipe as it claims that has no permission to open when clearly that's not the case.

But if i dont redirect the input the USER B has no problem opening it.

What is the problem of redirecting the input?

  • Are the problem present if you have only one user? – Mathieu May 6 at 9:48
  • test and server programs are launched by A user, aren't? – Mathieu May 6 at 9:49
  • You're not telling how the server tries to open the pipe. Is the pipe a named fifo? Or does it try it open it via /dev/fd/, /proc/PID/fd/ or /proc/self/fd/? Please show a little example. – mosvy May 6 at 9:59
  • For the /dev/fd/ case on Linux, that's a well known limitation; eg. (running as root) echo | su other_user -c 'ls -l /dev/fd/0; cat /dev/fd/0' will tell you that /dev/fd/0 is readable by other_user, but will still fail to open it. – mosvy May 6 at 10:05
  • User B creates the named pipe then i do chmod to have full permissions and user A reads from the pipe – Joao Parente May 6 at 10:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.