Using a non-root user, I'm creating a pseudo terminal with socat like this:

socat -d -d PTY,link=$HOME/.wine/dosdevices/com1,raw,echo=0 PTY,link=/tmp/com1-pty,raw,echo=0

and I need a root application to open this /tmp/com1-pty. Any attempt to do this results in a permission denied and the following syslog message:

Feb 10 17:21:06 ti0085 kernel: [  590.692819] type=1702 audit(1392060065.998:1004788): op=follow_link action=denied pid=6091 comm="menu" path="/tmp/com1-pty" dev="sda1" ino=48758820

I have tried many things, including setting permissions for both /tmp/com1-pty and the device to witch it links to 777. Also I have added root to dialout group - even though I don't believe it would make any difference, for I would expect the root to be able to open anything.

What I'm doing wrong?

  • That is like when you break a link, and try to edit it. Even as root, there's "permission denied". The kernel doesn't allow users to mess with the interns of the system so easily. I suspect your error message is the same kind of thing. – JMCF125 Feb 10 '14 at 20:09
  • Maybe, I didn't know about this broken link thing... But the interesting thing is that the dual scenario works. When I run socat as root, set the permissions to 777, and then run the apps as non-root, everything works fine. – Tarc Feb 10 '14 at 21:39
  • 1
    That is odd. You should post that as an answer, including any explanation you “theorise” (and leave it unaccepted for others to try to find explanations). – JMCF125 Feb 10 '14 at 22:52

I set the root app to open directly the device in /dev/pts/X and it worked, although continued to fail with the sym. link. I also got non-root applications opening the symbolic links created by socat and communicating properly with the root app without problem.

It is also worth noting that if socat were to be run as root, everything worked without a problem as long as the permissions of the symbolic links were set appropriately.


You are running SELinux, Apparmor, or one of the other linux security modules that further restricts access, even to root.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.