(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/index/maildir/maildir-storage.c) |
| |
| 346 | | | static int maildir_check_tmp(struct mail_storage *storage, const char *dir) |
| 347 | | | { |
| 348 | | | const char *path; |
| 349 | | | struct stat st; |
| 350 | | | |
| 351 | | | |
| 352 | [+] | | path = t_strconcat(dir, "/tmp", NULL); |
 |
| 353 | | | if (stat(path, &st) < 0) { |
Event 33:
path, which evaluates to the value assigned to ret at data-stack.c:335, is passed to stat64() as the first argument. See related event 32.
hide
Event 34:
stat64() accesses the file named path, where 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 33.
hide
Event 35:
Skipping " if". stat(path, &st) < 0 evaluates to false.
hide
|
|
| 354 | | | if (errno == ENOENT)
x /usr/include/asm-generic/errno-base.h |
| |
5 | #define ENOENT 2 /* No such file or directory */ |
| |
|
| 355 | | | return 0; |
| 356 | | | if (errno == EACCES) {
x /usr/include/asm-generic/errno-base.h |
| |
16 | #define EACCES 13 /* Permission denied */ |
| |
|
| 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) {
x /usr/include/bits/stat.h |
| |
94 | # define st_atime st_atim.tv_sec /* Backward compatibility. */ |
| |
x /usr/include/bits/stat.h |
| |
96 | # define st_ctime st_ctim.tv_sec |
| |
|
Event 36:
Taking false branch. st.st_atim.tv_sec > st.st_ctim.tv_sec + 36 * 60 * 60 evaluates to false.
hide
|
|
| 366 | | | |
| 367 | | | |
| 368 | | | } else if (st.st_atime < ioloop_time - MAILDIR_TMP_SCAN_SECS) {
x /usr/include/bits/stat.h |
| |
94 | # define st_atime st_atim.tv_sec /* Backward compatibility. */ |
| |
|
Event 37:
Taking true branch. st.st_atim.tv_sec < ioloop_time - 8 * 60 * 60 evaluates to true.
hide
|
|
| 369 | | | |
| 370 | | | (void)unlink_old_files(path, "", |
Event 38:
path, which evaluates to the value assigned to ret at data-stack.c:335, is passed to unlink_old_files() as the first argument. See related event 32.
hide
|
|
| 371 | [+] | | ioloop_time - MAILDIR_TMP_DELETE_SECS); |
 |
| |