search for: p_new

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

Did you mean: __new
2004 Aug 30
0
[PATCH] [RFC] epoll based ioloop handler (now with patch)
..._pos; + struct epoll_event *events; + + unsigned int idx_size; + struct io_list **fd_index; +}; + +struct io_list { + int count; + struct io *ios[EPOLL_IOS_PER_FD]; +}; + +void io_loop_handler_init(struct ioloop *ioloop) +{ + struct ioloop_handler_data *data; + + ioloop->handler_data = data = + p_new(ioloop->pool, struct ioloop_handler_data, 1); + + data->events_pos = 0; + data->events_size = INITIAL_EPOLL_EVENTS; + data->events = p_new(ioloop->pool, struct epoll_event, + data->events_size); + + data->idx_size = INITIAL_EPOLL_EVENTS; + data->fd_index = p_new(ioloo...
2005 Dec 14
2
Patch: ioloop using kqueue/kevent for FreeBSD
...struct fdrecord *fds; +}; + +struct fdrecord { + /* IO_READ | IO_WRITE | IO_ERROR */ + unsigned char mode : 3; +}; + + +void io_loop_handler_init(struct ioloop *ioloop) +{ + struct ioloop_handler_context *ctx; + + ioloop->handler_context = ctx = + p_new(ioloop->pool, struct ioloop_handler_context, 1); + ctx->evbuf_size = INITIAL_BUF_SIZE; + ctx->evbuf = p_new(ioloop->pool, struct kevent, ctx->evbuf_size); + memset(ctx->evbuf, 0, sizeof(struct kevent) * ctx->evbuf_size); + ctx->kq = kqueue (); +...
2004 Oct 25
0
[PATCH] Request for testing: BSD kqueue ioloop handler
..._handler_data { + int kq; + + unsigned int events_size, events_pos, events_changed; + struct kevent *events; + + unsigned int idx_size; + struct io_list **fd_index; +}; + +void io_loop_handler_init(struct ioloop *ioloop) +{ + struct ioloop_handler_data *data; + + ioloop->handler_data = data = + p_new(ioloop->pool, struct ioloop_handler_data, 1); + + data->events_pos = 0; + data->events_changed = 0; + data->events_size = INITIAL_KQUEUE_EVENTS; + data->events = p_new(ioloop->pool, struct kevent, data->events_size); + + data->idx_size = INITIAL_KQUEUE_EVENTS; + data->fd_...
2008 Jul 05
1
AIX: mntctl implementation for NFS quota support
...added mntctl support to 'lib/mountpoint.c' today. My tests are looking good and so I'd like to share the patch. While I'm still not really familiar with dovecots memory management, I need someone who is familiar with it to have a look on my lines of code. Especially the usage or p_new, t_strconcat and p_free should be checked. :-) To activate the patch you have to add "#define HAVE_VMOUNT_H 1" do 'config.h'. Maybe someone wants to alter configure* to do this automatically? And of course Timo, if you find it useful, you may include the code in one of the n...
2015 Jan 04
0
[PATCH] LAYOUT=imapdir is broken in v2.2
...list/mailbox-list-maildir.c b/src/lib-storage/list/mailbox-list-maildir.c index c99a2900a6d6..ae5f35d955ac 100644 --- a/src/lib-storage/list/mailbox-list-maildir.c +++ b/src/lib-storage/list/mailbox-list-maildir.c @@ -46,6 +46,7 @@ static struct mailbox_list *imapdir_list_alloc(void) list = p_new(pool, struct maildir_mailbox_list, 1); list->list = imapdir_mailbox_list; list->list.pool = pool; + list->sep = '.'; list->global_temp_prefix = IMAPDIR_GLOBAL_TEMP_PREFIX; list->temp_prefix = p_strconcat(pool, list->global_temp_prefi...
2004 Aug 25
0
[PATCH] move highest_fd calculations to ioloop-select.c
...andle_remove(current_ioloop, io); io->destroyed = TRUE; - /* check if we removed the highest fd */ - if (io->fd == current_ioloop->highest_fd) - update_highest_fd(current_ioloop); - io->fd = -1; } @@ -275,7 +248,6 @@ struct ioloop *io_loop_create(pool_t poo ioloop = p_new(pool, struct ioloop, 1); pool_ref(pool); ioloop->pool = pool; - ioloop->highest_fd = -1; io_loop_handler_init(ioloop); diff -urpNX /usr/share/dontdiff -x Makefile dovecot-1.0-test35.vanilla/src/lib/ioloop-select.c dovecot-1.0-test35/src/lib/ioloop-select.c --- dovecot-1.0-test35.van...
2006 Feb 03
0
rquotad (NFS) quota plugin
...void rquotad_quota_root_update(struct rquotad_quota_root *root); + + static struct quota *rquotad_quota_init(const char *data) + { + struct rquotad_quota *quota; + const char *const *qroots; + size_t qr_idx; + pool_t pool; + + pool = pool_alloconly_create("quota", 1024); + quota = p_new(pool, struct rquotad_quota, 1); + quota->pool = pool; + quota->quota = rquotad_quota; + + debugmsg("starting quota init"); + qroots = t_strsplit(data, ","); + for (qr_idx = 0; qroots[qr_idx] != NULL; qr_idx++) { + /* NOTHING */; + } + debugmsg("found %d quot...
2009 Aug 06
2
[PATCH] hvm emul: fix cmpxchg emulation to use an atomic operation
...rc; +} +#endif + static int hvmemul_cmpxchg( enum x86_segment seg, unsigned long offset, @@ -528,8 +705,32 @@ unsigned int bytes, struct x86_emulate_ctxt *ctxt) { - /* Fix this in case the guest is really relying on r-m-w atomicity. */ - return hvmemul_write(seg, offset, p_new, bytes, ctxt); + struct hvm_emulate_ctxt *hvmemul_ctxt = + container_of(ctxt, struct hvm_emulate_ctxt, ctxt); + struct vcpu *v = current; + unsigned long addr, old[2], new[2]; + unsigned long reps = 1; + int rc; + + rc = hvmemul_virtual_to_linear(seg, offset, bytes, &re...
2008 Oct 02
1
Bug in ACL Plugin
Hello! Names of groups should be stored in backend memory pool. --- acl-backend.c.old 2008-10-02 11:43:05.000000000 +0400 +++ acl-backend.c 2008-10-02 11:43:48.000000000 +0400 @@ -62,7 +62,7 @@ backend->groups = p_new(backend->pool, const char *, group_count); for (i = 0; i < group_count; i++) - backend->groups[i] = groups[i]; + backend->groups[i] = p_strdup(backend->pool, groups[i]); qsort(backend->groups, group_count...
2004 Oct 07
0
[PATCH] add missing error check in epoll code
...ll.c dovecot-1.0-test46/src/lib/ioloop-epoll.c --- dovecot-1.0-test46.vanilla/src/lib/ioloop-epoll.c 2004-09-06 00:59:47.000000000 +0400 +++ dovecot-1.0-test46/src/lib/ioloop-epoll.c 2004-10-05 21:39:52.000000000 +0400 @@ -57,6 +47,8 @@ void io_loop_handler_init(struct ioloop data->fd_index = p_new(ioloop->pool, struct io_list *, data->idx_size); data->epfd = epoll_create(INITIAL_EPOLL_EVENTS); + if (data->epfd < 0) + i_panic("epoll_create(): %m"); } void io_loop_handler_deinit(struct ioloop *ioloop) -------------- next part -------------- A non-text attachme...
2010 Jul 29
1
Patch: New event "mailbox_create" for the mail_log plugin
...G_EVENT_MAILBOX_CREATE) == 0) + return 0; + + i_info("Mailbox created: %s", str_sanitize(name, MAILBOX_NAME_LOG_LEN)); + return 0; +} + static void mail_log_mail_storage_created(struct mail_storage *storage) { union mail_storage_module_context *lstorage; @@ -604,6 +623,7 @@ lstorage = p_new(storage->pool, union mail_storage_module_context, 1); lstorage->super = storage->v; storage->v.mailbox_open = mail_log_mailbox_open; + storage->v.mailbox_create = mail_log_mailbox_create; MODULE_CONTEXT_SET_SELF(storage, mail_log_storage_module, lstorage); -- Tobias Joch Dipl....
2014 Feb 11
1
Order of istream and ostream chains
...i_stream_unref(&input); return mmail->super.istream_opened(_mail, stream); } static void scrambler_mail_allocated(struct mail *_mail) { struct mail_private *mail = (struct mail_private *)_mail; struct mail_vfuncs *v = mail->vlast; union mail_module_context *mmail; mmail = p_new(mail->pool, union mail_module_context, 1); mmail->super = *v; mail->vlast = &mmail->super; v->istream_opened = scrambler_istream_opened; MODULE_CONTEXT_SET_SELF(mail, scrambler_mail_module, mmail); } How can I reverse the order of istreams? Should I use another hook or vfu...
2014 Apr 24
0
Help implementing username_format in auth PAM driver
...pam", "pam_start() failed: %s", pam_strerror(pamh, status)); @@ -331,6 +344,7 @@ pam_preinit(pool_t pool, const char *args) { struct pam_passdb_module *module; const char *const *t_args; + const char *format = PASSDB_PAM_DEFAULT_USERNAME_FORMAT; int i; module = p_new(pool, struct pam_passdb_module, 1); @@ -367,9 +381,14 @@ pam_preinit(pool_t pool, const char *args) } } else if (t_args[i+1] == NULL) { module->service_name = p_strdup(pool, t_args[i]); + } else if (strncmp(t_args[i], "username_format=", 16) == 0) { + format = auth...
2020 Nov 15
2
[patch] enhancement for tika server protected by user/password basic auth
...for fts_solr. fts_tika = https://user:password at tika_host/tika John --- dovecot-2.3.11.3-orig/src/plugins/fts/fts-parser-tika.c???? 2020-08-12 14:20:41.000000000 +0200 +++ dovecot-2.3.11.3/src/plugins/fts/fts-parser-tika.c? 2020-11-15 15:18:24.351281064 +0100 @@ -57,7 +57,7 @@ ??????? tuser = p_new(user->pool, struct fts_parser_tika_user, 1); ??????? MODULE_CONTEXT_SET(user, fts_parser_tika_user_module, tuser); -?????? if (http_url_parse(url, NULL, 0, user->pool, +?????? if (http_url_parse(url, NULL, HTTP_URL_ALLOW_USERINFO_PART, user->pool, ?????????????????????????? &tuser-&gt...
2005 Jul 13
0
Minor bugs still in test77
Thinking of patches I always apply, I've got a couple (attached) that fix minor bugs and maybe should be applied - or implemented better and then applied ;) - to the main distribution? 1) LIST bugs: LIST "~/mail/" "" and LIST "" "~/mail/" (where "~/mail/" is a namespace prefix) don't reply the same way as UW-IMAP does and in at
2014 Dec 12
0
PATCH - add username_format to the PAM auth module
...} + str_free(&username); return result; } @@ -319,6 +344,7 @@ } expanded_service = t_str_new(64); + var_expand(expanded_service, module->service_name, auth_request_get_var_expand_table(request, NULL)); service = str_c(expanded_service); @@ -338,6 +364,8 @@ module = p_new(pool, struct pam_passdb_module, 1); module->service_name = "dovecot"; + module->username_format = "%u"; + module->pam_allow_transform = 1; /* we're caching the password by using directly the plaintext password given by the auth mechanism */ module->mod...
2010 Apr 14
4
PostgreSQL driver supporting [round-robin] load balancing and redundancy [LONG]
..._start; + unsigned c, semi_count; + + while ((c = *s) && isspace(c)) ++s; + + if (!c) { + if (!ofs) i_fatal("%s: empty connect string", __func__); + + dprintf(("%s: end of connect_string, %u pgcs", + __func__, ofs)); + + pgdb->n_pgcs = ofs; + pgdb->pgcs = p_new(pgdb->pool, struct multi_pgsql_pgc, ofs); + return; + } + + semi_count = 0; + lws_start = NULL; + r = s; + do { + if (c == ';') { + if (++semi_count == 3) break; + continue; + } + + semi_count = 0; + + if (isspace(c)) { + if (!lws_start) lws_start = r; + continue; + } +...
2006 Feb 03
1
passwd-userdb with args
...ream_reply_add(reply, args[i], value); + } callback(reply, auth_request); + t_pop(); + } + + static struct userdb_module * + passwd_preinit(struct auth_userdb *auth_userdb, const char *args) + { + struct passwd_userdb_module *module; + const char *const *tmp, *key, *value; + + module = p_new(auth_userdb->auth->pool, struct passwd_userdb_module, 1); + + tmp = t_strsplit_spaces(args, " "); + ARRAY_CREATE(&module->template, auth_userdb->auth->pool, + const char *, strarray_length(tmp)); + + t_push(); + for (; *tmp != NULL; tmp++) { + value = str...
2004 Jul 22
1
[PATCH] add LOGIN authentication mechanism
...} + +static void mech_login_auth_free(struct auth_request *auth_request) +{ + pool_unref(auth_request->pool); +} + +static struct auth_request *mech_login_auth_new(void) +{ + struct auth_request *auth; + pool_t pool; + + pool = pool_alloconly_create("login_auth_request", 256); + auth = p_new(pool, struct auth_request, 1); + + auth->refcount = 1; + auth->pool = pool; + auth->auth_initial = mech_login_auth_initial; + auth->auth_continue = mech_login_auth_continue; + auth->auth_free = mech_login_auth_free; + + return auth; +} + +const struct mech_module mech_login = { + &qu...
2017 Nov 03
1
Bug: lmtp proxy does not quote local parts with spaces
...domain); + str_append_maybe_escape(dest, local_part, FALSE); + str_append(dest, domain); + } + + return str_free_without_data(&dest); +} + int lmtp_proxy_add_rcpt(struct lmtp_proxy *proxy, const char *address, const struct lmtp_proxy_rcpt_settings *set) { @@ -301,10 +320,10 @@ rcpt = p_new(proxy->pool, struct lmtp_proxy_recipient, 1); rcpt->idx = array_count(&proxy->rcpt_to); rcpt->conn = conn; - rcpt->address = p_strdup(proxy->pool, address); + rcpt->address = lmtp_proxy_escape_address(proxy->pool, address); array_append(&proxy->rcpt_to, &amp...