"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/doveadm/doveadm-dump-thread.c" between
dovecot-2.3.16.tar.gz and dovecot-2.3.17.tar.gz

About: Dovecot is an IMAP and POP3 server, written with security primarily in mind.

doveadm-dump-thread.c  (dovecot-2.3.16):doveadm-dump-thread.c  (dovecot-2.3.17)
skipping to change at line 94 skipping to change at line 94
*uid += 1; *uid += 1;
while (p != end) { while (p != end) {
if (dump_record(&p, end, uid) < 0) { if (dump_record(&p, end, uid) < 0) {
printf(" - broken\n"); printf(" - broken\n");
return -1; return -1;
} }
} }
return p - data; return p - data;
} }
static void cmd_dump_thread(int argc ATTR_UNUSED, char *argv[]) static void
cmd_dump_thread(const char *path, const char *const *args ATTR_UNUSED)
{ {
unsigned int pos; unsigned int pos;
const void *map, *end; const void *map, *end;
struct stat st; struct stat st;
uint32_t uid; uint32_t uid;
int fd, ret; int fd, ret;
fd = open(argv[1], O_RDONLY); fd = open(path, O_RDONLY);
if (fd < 0) if (fd < 0)
i_fatal("open(%s) failed: %m", argv[1]); i_fatal("open(%s) failed: %m", path);
if (fstat(fd, &st) < 0) if (fstat(fd, &st) < 0)
i_fatal("fstat(%s) failed: %m", argv[1]); i_fatal("fstat(%s) failed: %m", path);
max_likely_index = (st.st_size / 8) * 2; max_likely_index = (st.st_size / 8) * 2;
map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0); map = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fd, 0);
if (map == MAP_FAILED) if (map == MAP_FAILED)
i_fatal("mmap() failed: %m"); i_fatal("mmap() failed: %m");
end = CONST_PTR_OFFSET(map, st.st_size); end = CONST_PTR_OFFSET(map, st.st_size);
pos = dump_hdr(map); pos = dump_hdr(map);
uid = 0; uid = 0;
do { do {
printf("block at offset %u:\n", pos); printf("block at offset %u:\n", pos);
 End of changes. 4 change blocks. 
4 lines changed or deleted 5 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)