Fix for #166298, and plug security hole (don't write to insecure dir
authorbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Mon, 7 Feb 2005 11:23:52 +0000 (11:23 +0000)
committerbillh <billh@e2bd861d-eb25-0410-b326-f6ed22b6b98c>
Mon, 7 Feb 2005 11:23:52 +0000 (11:23 +0000)
w/o checking for symlinks).

git-svn-id: http://svn.gnome.org/svn/at-spi/trunk@732 e2bd861d-eb25-0410-b326-f6ed22b6b98c

ChangeLog
atk-bridge/bridge.c

index bce8041..aa7f5db 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-02-07  Bill Haneman <bill.haneman@sun.com>
+
+       * atk-bridge/bridge.c: 
+       (atk_bridge_init): Added missing NULL in g_strconcat(),
+       also check for symlink before logging to 
+       insecure directory.  Thanks to meissner@suse.de.
+
 2005-01-25  Padraig O'Briain <padraig.obriain@sun.com>
 
        * tests/login-helper-server-test.c: Add return call to main
index e4c0520..d5e9559 100644 (file)
@@ -161,8 +161,10 @@ atk_bridge_init (gint *argc, gchar **argv[])
 
   if (g_getenv ("ATK_BRIDGE_REDIRECT_LOG"))
   {
-      fname = g_strconcat ("/tmp/", g_get_prgname (), ".at-spi-log");
-      freopen (fname, "w", stderr);
+      fname = g_strconcat ("/tmp/", g_get_prgname (), ".at-spi-log", NULL);
+      /* make sure we're not being redirected - security issue */
+      if (!g_file_test (fname, G_FILE_TEST_IS_SYMLINK))
+         freopen (fname, "w", stderr);
       g_free (fname);
   }