Re: Should g_get_homedir use $HOME



Eric Gillespie <epg pretzelnet org> writes:

> Owen Taylor <otaylor redhat com> writes:
> 
>     > as the target user. Both sudo and usermode get this "wrong"
>     > currently, so this might be an argument that we should ignore
>     > $HOME.
> 
> sudo does not get this wrong.  I'll quote from my comment on this bug
> report:
> 
>  HOME should be tried first.  The reason su and sudo don't change HOME
>  is because you usually want to take your settings with you into
>  superuser-land (.emacs, .zshrc, etc.).  I think all that's being
>  asked for here is sane behavior when HOME is not writable; ignoring
>  it altogether or using it as a last resort is not helpful.

Complicated solutions ($HOME unless it is not writeable) are
almost always wrong because they aren't predictable and people
don't understand how they work.
 
> I think you resolved this bug in the wrong direction.  Your own
> example of the user with the high-contrast theme gets broken by your
> resolution.  

But, as I pointed out, with GTK+-2.0 we have the mechanism of setting
the high constrast theme for the display with XSETTINGS and the
program running as root will pick that up fine.

> The hand-waving about GConf and stuff is irrelevant; i
> have a .gtkrc and i expect it to be respected even when i su.  All the
> GTK+ programs i currently use do that.

Yes, I did read your comments on the bug report before writing my
mail, and I appreciate you taking the time to write them. I'm sorry
you don't like the way I resolved it. I still think it's the right
decision --

Basically, there are two things we could provide as the result
of the function call:

 - A directory that might be the place where we want to 
   look for settings, but that might not be suitable as a place
   to get settings in some circumstances, either becuase
   we don't have permissions, because it isn't suitable 
   for what we are doing, or because it shouldn't be trusted.

 - The current user's home directory

While I can't say that the first would never be more useful, it's
clear that the second is simpler and more robust.

Regards,
                                        Owen



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]