Re: screen clobbers PATH
Re: screen clobbers PATH
- Subject: Re: screen clobbers PATH
- From: Martin Costabel <email@hidden>
- Date: Thu, 31 Jan 2008 09:18:47 +0100
Juan Manuel Palacios wrote:
[]
I don't have a solution to the problem, but at least a few words of
comfort telling you that I'm also experiencing the exact same problem:
Tiger's screen, OK; MacPorts' screen, OK; Leopard's screen, no PATH. I
have to supply the full path to whatever program I want to run under
Leopard's screen, otherwise I get not found errors.
Thanks. I have now looked some more at the source code, in particular at
the Apple-specific patches, and I am now seeing the point where the deed
is done.
But I am hitting a wall there. To me (but what do I know) it looks like
there is some private undocumented code at work here, something that
smells of Solaris; but that's about the extent of what I am understanding.
The evidence:
1) In screen.c, there is a line, conditioned on #ifdef __APPLE__
if (_vprocmgr_move_subset_to_user(real_uid, "Background") != NULL)
That function _vprocmgr_move_subset_to_user comes from a private header
vproc_private.h, and I haven't found it documented.
2) in windows.c, there is code replacing execve by a call to
/usr/bin/login with the flags "-pflq". Indeed, if you run
/usr/bin/screen on Leopard and look at the started processes with 'ps
x', you see a process "login -pflq". Now the "-l" flag to login is
nowhere documented, as far as I can see.
These two things play together:
- If you only remove 1 and leave 2 in place, screen does not work, it
quits immediately. If you remove both of them, you get standard screen
behavior with the usual unclobbered PATH and no additional login process.
- If you leave 1 and 2 in place and only remove the "l" flag from
"-pflq", you get an unclobbered PATH, too.
- I was not able to test "login -pflq" at the command line, it gives an
error message. This seems to hint that this flag in 2 needs 1 for running.
In conclusion, the cause of this problem seems to be an undocumented
"feature" of Leopard's /usr/bin/login that is used by Apple's variant of
/usr/bin/screen. Why they are doing this, I cannot imagine.
--
Martin
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden