Strange error

James Berry jberry at macports.org
Sun May 13 17:09:38 PDT 2007


Hey Randall,

On May 13, 2007, at 11:34 AM, Randall Wood wrote:

> My $HOME environment variable is correctly set, but the Security  
> Frameworks do not set this variable. When I 'sudo port ...' it works.

Does this occur because you're invoking the darwinports framework  
directly without going through a shell which would otherwise be  
setting HOME?

I'm not quite sure what to do about this issue. I did make a small  
change to the code to call file normalize instead of relying on the  
file name handling to do the conversion, but it looks to me like it  
boils down to the same thing in the end.

One possibility is that (since we know we're on a mac), we could just  
set $HOME based on the uid, if it's not set. This seems fraught with  
a bit of peril. Another possibility might be to just require that  
HOME be set, pushing the problem back into your court. If you're  
invoking through the darwinports api, can you set HOME prior to init?  
Other ideas?

> BTW: port creates the ~/.macports directory with root ownership,  
> but should create it with the same ownership as the $HOME directory.

I guess I have two choices:

	(1) Always create the directory with ownership its parent directory

	(2) Always create the directory with ownership of the uid, rather  
than euid.

#1 is probably better. Anybody else?

James



More information about the macports-dev mailing list