After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 161887 - after sudo the original user homedir theme is not found anymore
after sudo the original user homedir theme is not found anymore
Status: RESOLVED DUPLICATE of bug 142568
Product: gtk+
Classification: Platform
Component: Widget: Other
2.6.x
Other Linux
: Normal normal
: Small fix
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2004-12-21 14:08 UTC by danny.milo
Modified: 2005-05-20 22:12 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10



Description danny.milo 2004-12-21 14:08:21 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
Comment 1 danny.milo 2004-12-21 14:10:49 UTC
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.


Comment 2 shimon 2004-12-21 14:26:09 UTC
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
Comment 3 Luis Villa 2005-01-03 05:35:36 UTC
Confirming.
Comment 4 Owen Taylor 2005-01-03 19:19:19 UTC
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.
Comment 5 shimon 2005-01-10 13:17:26 UTC
so
Its Not A Bug Its A Feature(tm)
Comment 6 danny.milo 2005-01-28 07:54:13 UTC
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  :)
Comment 7 Matthias Clasen 2005-05-20 22:12:15 UTC

*** This bug has been marked as a duplicate of 142568 ***