Text   |  XML   |  ReML   |   Visible Warnings:

File System Race Condition  at file-copy.c:25

No properties have been set. | edit properties
Jump to warning location ↓ warning details...
Show Events | Options

check_parameters_file_set

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/master/ssl-init.c)expand/collapse
Show more  
 83  static bool check_parameters_file_set(struct settings *set)
 84  {
 85          const char *path;
 86          struct stat st, st2;
 87          time_t regen_time;
 88   
 89          if (strcmp(set->ssl, "no") == 0)
 90                  return TRUE;
 91   
 92          path = t_strconcat(set->, "/"SSL_PARAMETERS_FILENAME, NULL);
 93          if (stat(path, &st) < 0) {
 94                  if (errno != ENOENT) {
 95                          i_error("stat() failed for SSL parameters file %s: %m",
 96                                  path);
 97                          return TRUE;
 98                  }
 99   
 100                  st.st_mtime = 0;
 101          } else if (st.st_size == 0) {
 102                  /* broken, delete it (mostly for backwards compatibility) */
 103                  st.st_mtime = 0;
 104                  (void)unlink(path);
 105          }
 106   
 107          if (stat(SSL_PARAMETERS_PERM_PATH, &st2) == 0 &&
 108              st.st_mtime < st2.st_mtime) {
 109                  /* permanent parameters file has changed. use it. */
 110[+]                 if (file_copy(SSL_PARAMETERS_PERM_PATH, path, TRUE) > 0) {
expand/collapse

file_copy

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/file-copy.c)expand/collapse
Show more  
 94  int file_copy(const char *srcpath, const char *destpath, bool try_hardlink)
 95  {
 96          int ret;
 97   
 98          T_BEGIN {
 99                  const char *tmppath;
 100   
 101                  tmppath = t_strconcat(destpath, ".tmp", NULL);
 102   
 103[+]                 ret = file_copy_to_tmp(srcpath, tmppath, try_hardlink);
expand/collapse

file_copy_to_tmp

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/file-copy.c)expand/collapse
Show more  
 13  static int file_copy_to_tmp(const char *srcpath, const char *tmppath,
 14                              bool try_hardlink)
 15  {
 16          struct istream *input;
 17          struct ostream *output;
 18          struct stat st;
 19          mode_t old_umask;
 20          int fd_in, fd_out;
 21          off_t ret;
 22   
 23          if (try_hardlink) {
 24                  /* see if hardlinking works */
 25                  if (link(srcpath, tmppath) == 0)
Show more  
Show more  
Show more  




Change Warning 7855.25284 : File System Race Condition

Priority:
State:
Finding:
Owner:
Note: