[Gtkradiant] [Bug 785] ~/.radiant has wrong ownership and permissions

gtkradiant@zerowing.idsoftware.com gtkradiant@zerowing.idsoftware.com
Sun, 14 Sep 2003 04:49:50 -0500


http://zerowing.idsoftware.com/bugzilla/show_bug.cgi?id=785





------- Additional Comments From justin@cam.org  2003-09-14 04:49 -------
In main.cpp, we use g_get_home_dir() from glib to find .radiant. It turns out that this bug was 
resolved with the switch to gtk+2 (which brought in glib2). The problem is discussed at some 
length at <http://bugzilla.gnome.org/show_bug.cgi?id=2311>.

The solution that glib2 adopted was to use the home directory of the current user id, rather than 
the HOME environment variable as glib1 did. So if you're running radiant with sudo, glib2 
considers home to be root's home, not the logged-in user's.

However, since we don't want to run as root anyway, it's still worthwhile in that case to setuid() to 
the logged-in user. See attached patch.