search for: i_free

Displaying 20 results from an estimated 28 matches for "i_free".

2014 Jul 28
2
not able to compile deleted_to_trash Plugin
...L) ^ In file included from /usr/include/dovecot/lib.h:29:0, from deleted-to-trash-plugin.h:4, from deleted-to-trash-plugin.c:2: deleted-to-trash-plugin.c:65:20: error: 'struct last_copy_info' has no member named 'src_mailbox_name' i_free(last_copy.src_mailbox_name); ^ /usr/include/dovecot/mempool.h:89:33: note: in definition of macro 'p_free' (pool)->v->free(pool, mem); \ ^ deleted-to-trash-plugin.c:65:4: note: in expansion of macro 'i_free' i...
2006 Jun 20
1
Group-based filesystem quota
Hello. After using Dovecot for over a year, I have just started experimenting with the filesystem quotas, and I have a suggestion for improvement. On my mail server, I use group-based quotas, and would like to have Dovecot be able to report these quotas. It should be simple to implement, requiring only changes to the quota-fs.c file of the quota plugin. Simply changing USRQUOTA to
2018 May 31
3
use instance-name for syslog?
...t that. Please see the attachment. > Subject: [PATCH 1/2] master: Do not prepend "dovecot-" to a process name Why not? I'd think it would be useful to always find dovecot processes. > - openlog(ident, options, facility); > + static char *syslog_ident = NULL; > + > + i_free(syslog_ident); > + syslog_ident = i_strdup(ident); > + > + openlog(syslog_ident, options, facility); I don't think this is necessary? > + env_put(t_strconcat("INSTANCE_NAME=", set->instance_name, NULL)); Also not needed. But yeah, I guess in general it would make...
2006 Aug 21
2
Filesystem Quota Enhancement Patch
...uid = geteuid(); root->gid = getegid(); return &root->root; } static void fs_quota_mountpoint_free(struct fs_quota_mountpoint *mount) { #ifdef HAVE_Q_QUOTACTL if (mount->fd != -1) { if (close(mount->fd) < 0) i_error("close(%s) failed: %m", mount->path); } i_free(mount->path); #endif i_free(mount->device_path); i_free(mount->mount_path); i_free(mount->type); i_free(mount); } static void fs_quota_deinit(struct quota_root *_root) { struct fs_quota_root *root = (struct fs_quota_root *)_root; if (root->mount != NULL) fs_quota_mountpoin...
2013 Nov 19
6
[PATCH] Btrfs: fix very slow inode eviction and fs unmount
...essive merging and splitting. + */ +static void evict_inode_truncate_pages(struct inode *inode) +{ + struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; + struct extent_map_tree *map_tree = &BTRFS_I(inode)->extent_tree; + struct rb_node *node; + + ASSERT(inode->i_state & I_FREEING); + truncate_inode_pages(&inode->i_data, 0); + + write_lock(&map_tree->lock); + while (!RB_EMPTY_ROOT(&map_tree->map)) { + struct extent_map *em; + + node = rb_first(&map_tree->map); + em = rb_entry(node, struct extent_map, rb_node); + remove_extent_mapping(map_tr...
2007 Dec 10
1
dict: Leaked a t_pop() call in I/O handler
...t_strdup_printf("%s\t%s", username, uri)); i_assert(entry != NULL && entry->refcount > 0); if (--entry->refcount == 0) { hash_remove(cache->dicts, entry->user_uri); dict_deinit(&entry->dict); i_free(entry->user_uri); i_free(entry); } } ---- src/dict/dict-cache.c ---- Notice the "t_push()" call there. So calling t_pop() somewhere before the end of the function, makes dovecot work like a charm (again). P.D: I'm really surprised that nobody noticed this...
2009 Jun 06
2
expire-tool --test: timestamps
...est_ctime = i_strdup(ctime(&oldest)); + i_info("%s: timestamp %s (%.24s) -> %s (%.24s)", + userp, value, expire_ctime, + new_value, oldest_ctime); + i_free(expire_ctime); + i_free(oldest_ctime); } } }
2007 Oct 15
2
auth-ldap not resetting connection state after failed bind
...LDAP_AUTH_SIMPLE); if (msgid == -1) { - db_ldap_connect_finish(conn, ldap_get_errno(conn)); + if (db_ldap_connect_finish(conn, ldap_get_errno(conn)) < 0) { + /* lost connection, close it */ + ldap_conn_close(conn, TRUE); + } i_free(ldap_request); return -1; }
2009 Mar 24
1
Making changes to dovecot log levels
...nges in the future. In the file src/lib-index/mail-index.c: duplicate the function mail_index_set_error to mail_index_set_warning and call this function in /src/lib-index/mail_cache.c instead int mail_index_set_error(struct mail_index *index, const char *fmt, ...) { va_list va; i_free(index->error); if (fmt == NULL) index->error = NULL; else { va_start(va, fmt); index->error = i_strdup_vprintf(fmt, va); va_end(va); i_error("%s", index->error); }...
2006 Apr 28
1
imaptest, with options!
I hacked some command line options into imaptest. I dont think I broke it.. Place into dovecot-source root as usual and compile with: gcc imaptest.c -o imaptest -Wall -W -I. -Isrc/lib -DHAVE_CONFIG_H src/lib/liblib.a As per Timo's instructions. # imaptest -h imaptest [USER at IP:PORTNO] [pass=PASSWORD] [mbox=MBOX] [clients=CC] [msgs=NMSG] [use_authenticate] [PORTNO] USER = template for
2010 Apr 14
4
PostgreSQL driver supporting [round-robin] load balancing and redundancy [LONG]
...+ + return s; +} + +/** error result */ +struct multi_pgsql_error_result { + struct sql_result api; + char *msg; +}; + +static void error_result_free(struct sql_result *r) +{ + struct multi_pgsql_error_result *result; + + result = (void *)r; + dprintf(("%s: %p", __func__, result)); + + i_free(result->msg); + i_free(result); +} + +static void error_result_nop(struct sql_result *r) +{ + dprintf(("%s: %p", __func__, r)); +} + +static int error_result_next_row(struct sql_result *r) +{ + dprintf(("%s: %p", __func__, r)); + return -1; +} + +static char const *error_resu...
2018 May 30
3
use instance-name for syslog?
Hello, When running multiple instances of dovecot on the same host (or running multiple docker container), it is hard to distinguish logs from different processes: the syslog entries are all prefixed with the same identifier "dovecot" It is hardcoded here: https://github.com/dovecot/core/blob/master/src/lib-master/master-service.c#L420 Would it make sense to use the already implemented
2004 Jul 01
3
[PATCH, RFC] add APOP authentication mechanism
...ent, t_strconcat("+OK " PACKAGE " ready.", client->apop_challenge, NULL)); client_set_title(client); return &client->common; } @@ -318,6 +332,7 @@ int client_unref(struct pop3_client *cli i_stream_unref(client->input); o_stream_unref(client->output); + i_free(client->apop_challenge); i_free(client->common.virtual_user); i_free(client); diff -udrpN -X /usr/share/dontdiff -x Makefile dovecot-1.0-test23.vanilla/src/pop3-login/client.h dovecot-1.0-test23/src/pop3-login/client.h --- dovecot-1.0-test23.vanilla/src/pop3-login/client.h 2004-05-31 22...
2006 Feb 03
0
rquotad (NFS) quota plugin
...e); + if (strcmp(iter->boxfs, root->name) == 0) { + debugmsg("Returning root %d", iter->offset); + iter->offset++; + return (struct quota_root *) root; + } + } + return NULL; + } + + static int rquotad_quota_root_iter_deinit(struct quota_root_iter *iter) + { + i_free(iter); + return 0; + } + + static struct quota_root * + rquotad_quota_root_lookup(struct quota *_quota, const char *name) + { + struct rquotad_quota *quota = (struct rquotad_quota *)_quota; + struct rquotad_quota_root *root; + size_t i; + + for (i = 0; i < quota->nroots; i++) { + ro...
2018 Jun 01
0
use instance-name for syslog?
...me > > Why not? I'd think it would be useful to always find dovecot processes. I want to use 'director/*' names, not 'dovecot-director/*' for short name. > > - openlog(ident, options, facility); > > + static char *syslog_ident = NULL; > > + > > + i_free(syslog_ident); > > + syslog_ident = i_strdup(ident); > > + > > + openlog(syslog_ident, options, facility); > > > I don't think this is necessary? Sorry. I'm not expert of Dovecot implementation... > > + env_put(t_strconcat("INSTANCE_NAME=", se...
2011 Aug 04
1
Question about memory management in plugins
...open and there might run many auth requests over the connection before it's freed making the pool grow for long time. Data stack allocation won't work either, since with all this async network and callbacks, there's really no where to place the stack frame. So I end up using i_* and i_free for all data during the lifetime of the connection. Is there a better way? If I could only free my pool-allocated data, but I can't since it's almost never the last allocated data I want to free. /Peter
2012 Feb 23
1
Creating and interacting with array inside plugin
Hi Timo.... I Follow your instruction to look inside quota plugin to get the notification from dovecot that expunged a message, that's Ok. Follow the quota, it's use a array to keep all uids from a email expunged, to compare with uid that is got in notify_sync, that's OK too, but to me i need to keep uid and a char* with my body name, to erase it too. I made this: struct
2009 Aug 21
0
[GIT PULL] btrfs rb corruption fix
...t; entry->vfs_inode.i_ino) - p = &(*p)->rb_left; + p = &parent->rb_left; else if (inode->i_ino > entry->vfs_inode.i_ino) - p = &(*p)->rb_right; + p = &parent->rb_right; else { WARN_ON(!(entry->vfs_inode.i_state & (I_WILL_FREE | I_FREEING | I_CLEAR))); - break; + rb_erase(parent, &root->inode_tree); + RB_CLEAR_NODE(parent); + spin_unlock(&root->inode_lock); + goto again; } } rb_link_node(&BTRFS_I(inode)->rb_node, parent, p); @@ -3126,12 +3133,12 @@ static void inode_tree_del(struct inode *ino...
2006 Sep 07
2
Plugins for Dovecot at FreeBSD 6.0
Hi I met problem developing plug-in under FreeBSD 6.1. First I tried to use internal plugins like quota and acl but I got: IMAP(xxx): module /usr/local/lib/dovecot/imap/lib01_acl_plugin.so: dlsym(acl_plugin_init) failed: Shared object "nss_dns.so.1" not found, required by "imap" This library doesn't exist on FreeBSD 6.1 Same story when u mention any plugin in
2008 Oct 27
1
Empty/corrupt mail leads to duplicate delivery
...commit(struct { struct expire_mailbox *xpr_box = EXPIRE_CONTEXT(t->box); struct expire_transaction_context *xt = EXPIRE_CONTEXT(t); + struct mailbox *box = t->box; time_t new_stamp; bool update_dict = FALSE; int ret; @@ -117,13 +118,14 @@ expire_mailbox_transaction_commit(struct i_free(xt); return -1; } + /* transaction is freed now */ + t = NULL; if (xt->first_expunged || xt->saves) T_BEGIN { const char *key, *value; key = t_strconcat(DICT_PATH_SHARED, expire.username, "/", - t->box->storage->ns->prefix, - t->box->name...