gives a 3rd example to explain the problem and suggests a fix. The pty should be chown() to root after a root program is attached.