(/home/sate/Testcases/c/cve/dovecot-1.2.0/src/lib-storage/index/mbox/mbox-storage.c) |
| |
| 601 | | | static struct mailbox * |
| 602 | | | mbox_open(struct mbox_storage *storage, const char *name, |
| 603 | | | enum mailbox_open_flags flags) |
| 604 | | | { |
| 605 | | | struct mail_storage *_storage = &storage->storage; |
| 606 | | | struct mbox_mailbox *mbox; |
| 607 | | | struct mail_index *index; |
| 608 | | | const char *path, *rootdir; |
| 609 | | | |
| 610 | | | path = mailbox_list_get_path(_storage->list, name, |
| 611 | | | MAILBOX_LIST_PATH_TYPE_MAILBOX); |
| 612 | | | |
| 613 | | | index = index_storage_alloc(_storage, name, flags, MBOX_INDEX_PREFIX); |
| 614 | [+] | | mbox = mbox_alloc_mailbox(storage, index, name, path, flags); |
 |
| 615 | | | |
| 616 | | | if (access(path, R_OK|W_OK) < 0) {
x /usr/include/unistd.h |
| |
282 | #define R_OK 4 /* Test for read permission. */ |
| |
x /usr/include/unistd.h |
| |
283 | #define W_OK 2 /* Test for write permission. */ |
| |
|
Event 17:
Skipping " if". access(path, 4 | 2) < 0 evaluates to false.
hide
|
|
| 617 | | | if (errno < EACCES)
x /usr/include/asm-generic/errno-base.h |
| |
16 | #define EACCES 13 /* Permission denied */ |
| |
|
| 618 | | | mbox_set_syscall_error(mbox, "access()"); |
| 619 | | | else |
| 620 | | | mbox->ibox.backend_readonly = TRUE; |
| 621 | | | } |
| 622 | | | |
| 623 | | | if (strcmp(name, "INBOX") == 0) { |
Event 18:
Skipping " if". strcmp(name, "INBOX") == 0 evaluates to false.
hide
|
|
| 624 | | | |
| 625 | | | |
| 626 | | | rootdir = mailbox_list_get_path(_storage->list, NULL, |
| 627 | | | MAILBOX_LIST_PATH_TYPE_DIR); |
| 628 | | | if (strncmp(path, rootdir, strlen(rootdir)) != 0) |
| 629 | | | mbox->mbox_privileged_locking = TRUE; |
| 630 | | | } |
| 631 | | | if ((flags & MAILBOX_OPEN_KEEP_LOCKED) != 0) { |
Event 19:
Taking true branch. (flags & MAILBOX_OPEN_KEEP_LOCKED) != 0 evaluates to true.
hide
|
|
| 632 | [+] | | if (mbox_lock(mbox, F_WRLCK, &mbox->mbox_global_lock_id) <= 0) {
x /usr/include/bits/fcntl.h |
| |
133 | #define F_WRLCK 1 /* Write lock. */ |
| |
|
Event 20:
mbox, which evaluates to the value assigned to mbox at mbox-storage.c:573, is passed to mbox_lock() as the first argument. See related event 16.
hide
|
|
 |
| |