Index: libvtv/configure.ac
===================================================================
--- libvtv/configure.ac	(revision 201639)
+++ libvtv/configure.ac	(working copy)
@@ -149,4 +149,7 @@ _EOF
 ])
 fi
 
+AC_GNU_SOURCE
+AC_CHECK_FUNCS([__secure_getenv secure_getenv])
+
 AC_OUTPUT
Index: libvtv/vtv_utils.cc
===================================================================
--- libvtv/vtv_utils.cc	(revision 201639)
+++ libvtv/vtv_utils.cc	(working copy)
@@ -31,6 +31,7 @@
 #include <fcntl.h>
 #include <stdarg.h>
 #include <stdio.h>
+#include <stdlib.h>
 #include <string.h>
 #include <execinfo.h>
 #include <unistd.h>
@@ -38,24 +39,45 @@
 
 #include "vtv_utils.h"
 
-/* This is the directory into which all vtable verication log files
-   get written.  */
-static const char * const logs_dir = "/tmp/vtv_logs";
-static int vtv_failures_log_fd = -1;
-
+#ifndef HAVE_SECURE_GETENV
+#  ifdef HAVE___SECURE_GETENV
+#    define secure_getenv __secure_getenv
+#  else
+#    define secure_getenv getenv
+#  endif
+#endif
 
+static int vtv_failures_log_fd = -1;
 
 /* This function takes the NAME of a log file to open, attempts to
    open it in the logs_dir directory, and returns the resulting file
-   decriptor.  */
+   decriptor. 
+
+   This function first checks to see if the user has specifed (via
+   the environment variable VTV_LOGS_DIR) a directory to use for the
+   vtable verification logs.  If that fails, the function will open
+   the logs in the current directory.
+*/
 
 int
 __vtv_open_log (const char *name)
 {
-  char log_name[256];
-  snprintf (log_name, sizeof (log_name), "%s/%s", logs_dir, name);
-  mkdir (logs_dir, S_IRWXU);
-  int fd = open (log_name, O_WRONLY | O_APPEND | O_CREAT, S_IRWXU);
+  char log_name[1024];
+  char log_dir[512];
+  uid_t user_id = getuid ();
+  pid_t process_id = getpid ();
+  char *logs_prefix;
+
+  logs_prefix = secure_getenv ("VTV_LOGS_DIR");
+  if (!logs_prefix || strlen (logs_prefix) == 0)
+    logs_prefix = (char *) ".";
+  mkdir (logs_prefix, S_IRWXU);
+  snprintf (log_dir, sizeof (log_dir), "%s/vtv_logs", logs_prefix);
+  mkdir (log_dir, S_IRWXU);
+
+  snprintf (log_name, sizeof (log_name), "%s/%d_%d_%s", log_dir,
+	    (unsigned) user_id, (unsigned) process_id, name);
+  int fd = open (log_name, O_WRONLY | O_APPEND | O_CREAT | O_NOFOLLOW, S_IRWXU);
   if (fd == -1)
     __vtv_add_to_log (2, "Cannot open log file %s %s\n", name,
                     strerror (errno));
