I'm using GNU screen for remote pair programming. Let's call the local account for the remote user 'pairpair'. I have the following lines in my .screenrc:

multiuser on
acladd pairpair

I have run sudo chmod u+s /usr/bin/screen. However, when the remote user tries to connect to my screen with the command screen -r [my_account_name]/[pid_of_screen] I receive the following message:

Attach attempt with bad pid(xxx)

The pid listed in the error message matches the pid of the screen process run by the remote user. The remote user's screen process hangs; my screen session continues happily along after the error message disappears.

I've tried using both the built-in screen (at /usr/bin/screen) and the screen available from MacPorts, but I get the same error in both cases.

This worked on OS X 10.5 (Leopard).

I've googled around for the error message, but most of the hits relate to some BSD bug from 2003 or so (which was fixed). Has anyone else seen this behavior? Does anyone have any idea how to make multiuser support in screen work in SL?

3 Answers
3

Screen uses a call to kill() with signal zero to validate PIDs. The cause of the issue is that kill() is unexpectedly failing with errno EPERM. This should only happen if the UID and EUID of the calling process is nonzero and doesn't match the UID and EUID of the target process, respectively.

In this particular case, the UID of the two processes in question are different and the inherited EUID of both processes are zero. This would be fine, but as a part of the PID sanity check, the EUID of both processes is set to the UID that owns the screen session. In this particular scenario, even though both EUIDs are the same, kill() still fails with errno EPERM.

I've filed bug 8965041 at bugreport.apple.com. Hopefully this is the correct avenue to have this fixed.

In the meantime, I'm working around the issue by compiling my own screen binary where I've forced CheckPid() to return 0.