Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Avoid AppleScript command errors when used via SSH' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Avoid AppleScript command errors when used via SSH
Authored by: geohar on Nov 12, '04 04:32:01AM

It's probably worth having a play with the setsid setting for screen - see man screen, excerpt below:

setsid [on|off]

Normally screen uses different sessions and process groups for the win-dows. If setsid is turned off, this is not done anymore and all windows will be in the same process group as the screen backend process. This also breaks job-control, so be careful. The default is on, of course. This command is probably useful only in rare circumstances.

Hmmm.

I believe it's the session ID that prevents the mach-port opening (for security reasons, mach-init will not allow you to negotiate a port between different login session ids - each user logged in has a separate one and it'd allow you to mess with another user's programs).

Looking at the screen source, I think this controls the pgrp allocations also.


George



[ Reply to This | # ]
Avoid AppleScript command errors when used via SSH
Authored by: geohar on Nov 12, '04 06:33:00AM

My bad. Actually the sid and pgid that ps reports are not (directly) related to the security session ID that you can't 'talk' across.

When I log in remotely I get a different session ID each time. When you detach and reattach you get a new security session ID - it's sshd that spawns a new one on accepting a connection. Each shell/window within screen will share the same security session ID though.

On the original login, screen a session with the tty and is registered as being a remote-initiated connection.

Now when reattaching back to a detached screen session, the session properties are 'root'. A little worrying I think you'll agree. Now because root isn't the user logged in on the 'console' (ie. the graphically logged in user), you can't open a mach port to the gui (which is what applescript needs, reguardless of whether it uses any GUI). However, I believe this flag doesn't result in escalated privalidges, it just implies this is a startup session (the one that spawns all others). As such it can't talk to the session with the GUI.



[ Reply to This | # ]