Multiuser GNU screen sessions

I am attempting to set up multi user screen sessions on Mac OS 10.7.3 and I run into the error Attach attempt with invalid pid(xxx)!.

If set it up as follows:

Initial configuration of system:

Make the proper permisions for the screen command

sudo chmod u+s $(which screen)
sudo mkdir /var/run/screen/
sudo chmod 755 /var/run/screen/

Screen setup

From <user_sharing_screen>

Initialize the screen with specified session name:

screen -S <session_name>

Make the screen multiuser:

C-a :multiuser on
C-a :acladd <user_to_share_with>

From <user_to_share_with> on the same system connect to the shared screen

screen -x <user_sharing_screen>/<session_name>

Then I get the error message Attach attempt with invalid pid(xxx)!


[Update]The screen utility is broken according to a superuser.com post starting from Mac OS X 10.6.

I was able to compile a working version of screen from MacPorts.org. If you're familiar with MacPorts I could provide you with an updated screen x86_64 binary or the source code patch file (changing one line in socket.c).[/Update]

Update2 Add diff of socket.c

--- screen-4.0.3/socket.c   2003-09-08 16:26:50.000000000 +0200
+++ /Users/fluffy/screen-4.0.3/socket.c 2012-03-10 22:58:57.000000000 +0100
@@ -745,7 +745,7 @@
   if (eff_uid == real_uid)
     return kill(pid, 0);
   if (UserContext() > 0)
-    UserReturn(kill(pid, 0));
+    return 0;
   return UserStatus();
 }