Changeset 6687135


Ignore:
Timestamp:
Jul 27, 2010, 9:10:44 PM (11 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
release-1.6
Children:
af16ad3
Parents:
26a1398
git-author:
Nelson Elhage <nelhage@mit.edu> (07/15/10 23:38:45)
git-committer:
Nelson Elhage <nelhage@mit.edu> (07/27/10 21:10:44)
Message:
Open the debug file using O_EXCL and an explicit mode.

We write potentially sensitive data out to the debug log, so we should protect
it.

Reported-by: Geoffrey Thomas <geofft@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • global.c

    r26a1398 r6687135  
    10091009  if (g->debug_file == NULL ||
    10101010      (open_file && strcmp(filename, open_file) != 0)) {
     1011    int fd;
     1012
    10111013    if (g->debug_file)
    10121014      fclose(g->debug_file);
    1013     g->debug_file = fopen(filename, "a");
     1015
     1016    g->debug_file = NULL;
     1017
     1018    fd = open(filename, O_CREAT|O_WRONLY|O_EXCL, 0600);
     1019    if (fd >= 0)
     1020      g->debug_file = fdopen(fd, "a");
    10141021
    10151022    owl_free(open_file);
Note: See TracChangeset for help on using the changeset viewer.