Text   |  XML   |  ReML   |   Visible Warnings:

Negative file descriptor  at maildir-sync.c:395

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

maildir_scan_dir

(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/index/maildir/maildir-sync.c)expand/collapse
Show more  
 358  static int maildir_scan_dir(struct maildir_sync_context *ctx, bool new_dir)
 359  {
 360          struct mail_storage *storage = &ctx->mbox->storage->storage;
 361          const char *path;
 362          DIR *dirp;
 363          string_t *src, *dest;
 364          struct dirent *dp;
 365          struct stat st;
 366          enum maildir_uidlist_rec_flag flags;
 367          unsigned int i = 0, move_count = 0;
 368          time_t now;
 369          int ret = 1;
 370          bool move_new, check_touch, dir_changed = FALSE;
 371   
 372          path = new_dir ? ctx->new_dir : ctx->cur_dir;
 373          for (i = 0;; i++) {
 374                  dirp = opendir(path);
 375                  if (dirp != NULL)
 376                          break;
 377   
 378                  if (errno != ENOENT || i == MAILDIR_DELETE_RETRY_COUNT) {
 379                          if (errno == EACCES) {
 380                                  mail_storage_set_critical(storage, "%s",
 381                                          eacces_error_get("opendir", path));
 382                          } else {
 383                                  mail_storage_set_critical(storage,
 384                                          "opendir(%s) failed: %m", path);
 385                          }
 386                          return -1;
 387                  }
 388   
 389                  if (!maildir_set_deleted(ctx->mbox))
 390                          return -1;
 391                  /* try again */
 392          }
 393   
 394  #ifdef HAVE_DIRFD 
 395          if (fstat(dirfd(dirp), &st) < 0) {
Show more  




Change Warning 7308.25199 : Negative file descriptor

Priority:
State:
Finding:
Owner:
Note: