This patch changes where the logging file mechanism in libvtv tries to write its log files. Instead of trying to use /tmp, it now first looks for an environment variable "VTV_LOGS_DIR". If it can't find that it looks for the environment variable "HOME". If it can't find that either, it uses the current directory. This also adds O_NOFOLLOW to the open command. There was a request that we also use O_EXCL, but that would cause a problem because we occasionally want to be able to append to existing log files, and adding O_EXCL would cause that to fail. I also added the uid and pid to the log file names.
Is this patch OK to commit? -- Caroline Tice cmt...@google.com 2013-08-08 Caroline Tice <cmt...@google.com> * vtv_utils.cc : Include stdlib.h (log_dirs): Remove file static constant. (__vtv_open_log): Increase size of log file name. Add the user and process ids to the file name. Do not put the log files in /tmp. Instead try to get the directory name from environment variables; if that fails use the current directory. Add O_NOFOLLOW to the flags for 'open'. Update function comment.
vtv-update-tmpdir.patch
Description: Binary data