(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/plugins/virtual/virtual-storage.c) |
| |
| 315 | | | static struct mailbox * |
| 316 | | | virtual_mailbox_open(struct mail_storage *_storage, const char *name, |
| 317 | | | struct istream *input, enum mailbox_open_flags flags) |
| 318 | | | { |
| 319 | | | struct virtual_storage *storage = (struct virtual_storage *)_storage; |
| 320 | | | const char *path; |
| 321 | | | struct stat st; |
| 322 | | | |
| 323 | | | if (input != NULL) { |
Event 1:
Skipping " if". input != (void *)0 evaluates to false.
hide
|
|
| 324 | | | mail_storage_set_critical(_storage, |
| 325 | | | "virtual doesn't support streamed mailboxes"); |
| 326 | | | return NULL; |
| 327 | | | } |
| 328 | | | |
| 329 | | | path = mailbox_list_get_path(_storage->list, name, |
Event 3:
path is set to mailbox_list_get_path(...), which evaluates to list->v.get_path(...) from mailbox-list.c:446. See related event 2.
hide
|
|
| 330 | [+] | | MAILBOX_LIST_PATH_TYPE_MAILBOX); |
 |
| 331 | | | if (stat(path, &st) == 0) |
Event 4:
path, which evaluates to list->v.get_path(...) from mailbox-list.c:446, is passed to stat64() as the first argument. See related event 3.
hide
Event 5:
stat64() accesses the file named path, where path is list->v.get_path(...) from mailbox-list.c:446. - 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 4.
hide
Event 6:
Taking false branch. stat(path, &st) == 0 evaluates to false.
hide
|
|
| 332 | | | return virtual_open(storage, name, flags); |
| 333 | | | else if (errno == ENOENT) {
x /usr/include/asm-generic/errno-base.h |
| |
5 | #define ENOENT 2 /* No such file or directory */ |
| |
|
Event 7:
Taking false branch. errno == 2 evaluates to false.
hide
|
|
| 334 | | | mail_storage_set_error(_storage, MAIL_ERROR_NOTFOUND, |
| 335 | | | T_MAIL_ERR_MAILBOX_NOT_FOUND(name));
x /home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/mail-error.h |
| |
19 | #define T_MAIL_ERR_MAILBOX_NOT_FOUND(name) \ |
20 | t_strdup_printf(MAIL_ERRSTR_MAILBOX_NOT_FOUND, name) |
| |
|
| 336 | | | } else if (errno == EACCES) {
x /usr/include/asm-generic/errno-base.h |
| |
16 | #define EACCES 13 /* Permission denied */ |
| |
|
Event 8:
Taking true branch. errno == 13 evaluates to true.
hide
|
|
| 337 | | | mail_storage_set_critical(_storage, "%s", |
| 338 | [+] | | mail_error_eacces_msg("stat", path)); |
Event 9:
path, which evaluates to list->v.get_path(...) from mailbox-list.c:446, is passed to mail_error_eacces_msg() as the second argument. See related events 3 and 4.
hide
|
|
 |
| |