GNOME Bugzilla – Bug 161887
after sudo the original user homedir theme is not found anymore
Last modified: 2005-05-20 22:12:15 UTC
- set gtk settings theme-name (via theme switcher or whatever) to some theme that is present only(!) in the users homedir .theme directory - sudo to another user and start a gtk app - see that the theme is not found anymore
When looking at http://cvs.gnome.org/viewcvs/gtk%2B/gtk/gtkrc.c?rev=1.154&view=markup function gtk_rc_parse_named One can see that only g_get_home_dir is used and that probably gets confused by sudo (this has been confirmed by mclasen). maybe related is bug #142568. (so it could be 'fixed' either in this or in that bug) I'd suggest for loading the theme (which should be quite safe? :)) add g_getenv("HOME") or maybe XDG_DATA_HOME.
as its really my bug and one of the nicest guy on irc reported for me because i am stupid... first sudo doesn't sudo into another user it gives the current user root powers here is a sceeny the left is gtk-demo as a normal user, the right is when opening the program using (gk)sudo screeny: http://img71.exs.cx/img71/1981/screenshot9sa.png
Confirming.
Well, its expected... it's the general fact that we ignore $HOME in favor of the password database entry. Just using the homedir theme blindly could be considered a security risk ... theme engines are arbitrary code that also are searched for in the home directory.
so Its Not A Bug Its A Feature(tm)
what about just for loading the theme change it to do use HOME ? (or lookup the original user's passwd entry instead of the sudoed user's password entry - if that is possible) otherwhise sudo has unexpected results when using a local user theme :) And sudo is quite important for a desktop :)
*** This bug has been marked as a duplicate of 142568 ***