Text   |  XML   |  ReML   |   Visible Warnings:

File System Race Condition  at unlink-old-files.c:24

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

maildir_check_tmp

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/index/maildir/maildir-storage.c)expand/collapse
Show more  
 346  static int maildir_check_tmp(struct mail_storage *storage, const char *dir)
 347  {
 348          const char *path;
 349          struct stat st;
 350   
 351          /* if tmp/ directory exists, we need to clean it up once in a while */
 352[+]         path = t_strconcat(dir, "/tmp", NULL);
 353          if (stat(path, &st) < 0) {
 354                  if (errno == ENOENT)
 355                          return 0;
 356                  if (errno == EACCES) {
 357                          mail_storage_set_critical(storage, "%s",
 358                                  mail_error_eacces_msg("stat", path));
 359                          return -1;
 360                  }
 361                  mail_storage_set_critical(storage, "stat(%s) failed: %m", path);
 362                  return -1;
 363          }
 364   
 365          if (st.st_atime > st.st_ctime + MAILDIR_TMP_DELETE_SECS) {
 366                  /* the directory should be empty. we won't do anything
 367                     until ctime changes. */
 368          } else if (st.st_atime < ioloop_time - MAILDIR_TMP_SCAN_SECS) {
 369                  /* time to scan */
 370                  (void)unlink_old_files(path, "",
 371[+]                                        ioloop_time - MAILDIR_TMP_DELETE_SECS);
expand/collapse

unlink_old_files

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/unlink-old-files.c)expand/collapse
Show more  
 75  int unlink_old_files(const char *dir, const char *prefix, time_t min_time)
 76  {
 77          int ret;
 78   
 79          T_BEGIN {
 80[+]                 ret = unlink_old_files_real(dir, prefix, min_time);
expand/collapse

unlink_old_files_real

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib/unlink-old-files.c)expand/collapse
Show more  
 16  unlink_old_files_real(const char *dir, const char *prefix, time_t min_time)
 17  {
 18          DIR *dirp;
 19          struct dirent *d;
 20          struct stat st;
 21          string_t *path;
 22          unsigned int prefix_len, dir_len;
 23   
 24          dirp = opendir(dir);
Show more  
Show more  
Show more  




Change Warning 7368.24966 : File System Race Condition

Priority:
State:
Finding:
Owner:
Note: