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

Bug#381543: libgnorba27 should honor TMPDIR like orbit



retitle 381543 libgnorba27 should honor TMPDIR like orbit
reassign 381543 libgnorba27 1.4.2-32
tag 381543 patch
thanks

Simon Brandmair <sbrandmair@gmx.net> writes:

> On 05.08.2006 13:07 (Saturday), Matej Vela wrote:
>> Simon Brandmair <sbrandmair@gmx.net> writes:
>> > When pam_tmpdir is enabled, mgt fails to start:
>> > Failed to open CORBA cookie file `/tmp/orbit-simi/cookie': No such file or
>> directory
>> > Failed to obtain CORBA authentication cookie, exiting
>> 
>> Does the same error appear when you run goad-browser?
>
> Yes, exactly the same error message.

Ah, found it.  orbit has been patched to honor TMPDIR (#42615), and
libgnorba hasn't:

  orbit-0.5.17/src/orb/orb.c:190:
    g_string_sprintf(tmpstr, "%s/orbit-%s", g_get_tmp_dir(), g_get_user_name());

  gnome-libs-1.4.2/libgnorba/orbitgtk.c:133:
    name = g_strconcat ("/tmp/orbit-", pwent->pw_name, "/cookie", NULL);

Untested patch below.  (Like orbit, it uses g_get_user_name(), which
may return a different value from getpwuid().)

--- gnome-libs-1.4.2~/libgnorba/orbitgtk.c
+++ gnome-libs-1.4.2/libgnorba/orbitgtk.c
@@ -118,19 +118,12 @@
 static char *
 _gnorba_get_cookie_reliably (const char *setme)
 {
-	struct passwd *pwent;
 	char buf[64];
 	char *random_string = NULL;
 	char *name = NULL;
 	int fd = -1;
 	
-	pwent = getpwuid(getuid());
-	if(!pwent) {
-		fprintf(stderr,_("Failed to get user details for UID %d (%s)\n"), getuid(),strerror(errno));
-		goto out;
-	}
-	
-	name = g_strconcat ("/tmp/orbit-", pwent->pw_name, "/cookie", NULL);
+	name = g_strconcat (g_get_tmp_dir (), "/orbit-", g_get_user_name (), "/cookie", NULL);
 	
 	if(setme) {
 		

Cheers,

Matej



Reply to: