Index: libvtv/vtv_utils.cc
===================================================================
--- libvtv/vtv_utils.cc	(revision 201606)
+++ 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,36 @@
 
 #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;
 
-
-
 /* 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 tries to get
+   the user's home directory.  If that also 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);
+  char log_name[1024];
+  uid_t user_id = getuid ();
+  pid_t process_id = getpid ();
+  char *logs_dir;
+
+  logs_dir = getenv ("VTV_LOGS_DIR");
+  if (!logs_dir)
+    logs_dir = getenv ("HOME");
+  if (!logs_dir)
+    logs_dir = ".";
+  snprintf (log_name, sizeof (log_name), "%s/vtv_logs/%d_%d_%s", logs_dir,
+	    (unsigned) user_id, (unsigned) process_id, name);
   mkdir (logs_dir, S_IRWXU);
-  int fd = open (log_name, O_WRONLY | O_APPEND | O_CREAT, S_IRWXU);
+  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));
