(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/index/maildir/maildir-keywords.c) |
| |
| 351 | | | static int maildir_keywords_commit(struct maildir_keywords *mk) |
| 352 | | | { |
| 353 | | | struct dotlock *dotlock; |
| 354 | | | const char *lock_path; |
| 355 | | | mode_t old_mask; |
| 356 | | | int i, fd; |
| 357 | | | |
| 358 | | | mk->synced = FALSE; |
| 359 | | | |
| 360 | | | if (!mk->changed || mk->mbox == NULL) |
Event 1:
Skipping " if". - mk->changed evaluates to true.
- mk->mbox == (void *)0 evaluates to false.
hide
|
|
| 361 | | | return 0; |
| 362 | | | |
| 363 | [+] | | lock_path = t_strconcat(mk->path, ".lock", NULL); |
 |
| 364 | | | (void)unlink(lock_path); |
Event 34:
lock_path, which evaluates to the value assigned to ret at data-stack.c:335, is passed to unlink(). See related event 33.
hide
Event 35:
unlink() accesses the file named lock_path, where lock_path is the value assigned to ret at data-stack.c:335. - The same name is used to access a file later, but it is not safe to assume that it will be the same underlying file.
See related event 34.
hide
|
|
| 365 | | | |
| 366 | | | for (i = 0;; i++) { |
| 367 | | | |
| 368 | | | |
| 369 | | | |
| 370 | | | old_mask = umask(0777 & ~mk->mbox->ibox.box.file_create_mode); |
| 371 | | | fd = file_dotlock_open(&mk->dotlock_settings, mk->path, |
| 372 | | | DOTLOCK_CREATE_FLAG_NONBLOCK, &dotlock); |
| 373 | | | umask(old_mask); |
| 374 | | | if (fd != -1) |
Event 36:
Taking true branch. fd != -1 evaluates to true.
hide
|
|
| 375 | | | break; |
| 376 | | | |
| 377 | | | if (errno != ENOENT || i == MAILDIR_DELETE_RETRY_COUNT) {
x /usr/include/asm-generic/errno-base.h |
| |
5 | #define ENOENT 2 /* No such file or directory */ |
| |
|
| 378 | | | mail_storage_set_critical(mk->storage, |
| 379 | | | "file_dotlock_open(%s) failed: %m", mk->path); |
| 380 | | | return -1; |
| 381 | | | } |
| 382 | | | |
| 383 | | | |
| 384 | | | if (!maildir_set_deleted(mk->mbox)) |
| 385 | | | return -1; |
| 386 | | | } |
| 387 | | | |
| 388 | [+] | | if (maildir_keywords_write_fd(mk, lock_path, fd) < 0) { |
Event 37:
lock_path, which evaluates to the value assigned to ret at data-stack.c:335, is passed to maildir_keywords_write_fd() as the second argument. See related event 33.
hide
|
|
 |
| |