static struct passdb_module * passdb_imap_preinit(pool_t pool, const char *args) { struct imap_passdb_module *module; char **tmp; const char *key, *value; bool port_set = FALSE; module = p_new(pool, struct imap_passdb_module, 1); module->module.default_pass_scheme = "PLAIN"; module->set.port = IMAP_DEFAULT_PORT; module->set.ssl_mode = IMAPC_CLIENT_SSL_MODE_NONE; module->set.username = "******"; module->set.rawlog_dir = ""; for (tmp = p_strsplit(pool, args, " "); *tmp != NULL; tmp++) { key = *tmp; value = strchr(key, '='); if (value == NULL) value = ""; else key = t_strdup_until(key, value++); if (strcmp(key, "host") == 0) module->set.host = value; else if (strcmp(key, "port") == 0) { if (net_str2port(value, &module->set.port) < 0) i_fatal("passdb imap: Invalid port: %s", value); port_set = TRUE; } else if (strcmp(key, "username") == 0) module->set.username = value; else if (strcmp(key, "ssl_ca_dir") == 0) module->set.ssl_ca_dir = value; else if (strcmp(key, "rawlog_dir") == 0) module->set.rawlog_dir = value; else if (strcmp(key, "ssl") == 0) { if (strcmp(value, "imaps") == 0) { if (!port_set) module->set.port = IMAPS_DEFAULT_PORT; module->set.ssl_mode = IMAPC_CLIENT_SSL_MODE_IMMEDIATE; } else if (strcmp(value, "starttls") == 0) { module->set.ssl_mode = IMAPC_CLIENT_SSL_MODE_STARTTLS; } else { i_fatal("passdb imap: Invalid ssl mode: %s", value); } } else { i_fatal("passdb imap: Unknown parameter: %s", key); } } if (module->set.host == NULL) i_fatal("passdb imap: Missing host parameter"); module->set_have_vars = strchr(module->set.username, '%') != NULL || strchr(module->set.host, '%') != NULL; return &module->module; }
static void lmtp_client_parse_capabilities(struct lmtp_client *client, const char *lines) { const char *const *linep; for (linep = t_strsplit(lines, "\n"); *linep != NULL; linep++) { const char *line = *linep; line += 4; /* already checked this is valid */ if (strncasecmp(line, "XCLIENT ", 8) == 0) { client->xclient_args = (void *)p_strsplit(client->pool, line + 8, " "); } } }
static void client_connection_input(struct client_connection *conn) { const char *line; bool ok = TRUE; int ret; if (!conn->handshaked) { if ((line = i_stream_read_next_line(conn->input)) == NULL) { if (conn->input->eof || conn->input->stream_errno != 0) { client_log_disconnect_error(conn); client_connection_destroy(&conn); } return; } if (!version_string_verify(line, "doveadm-server", DOVEADM_SERVER_PROTOCOL_VERSION_MAJOR)) { i_error("doveadm client not compatible with this server " "(mixed old and new binaries?)"); client_connection_destroy(&conn); return; } conn->handshaked = TRUE; } if (!conn->authenticated) { if ((ret = client_connection_authenticate(conn)) <= 0) { if (ret < 0) { o_stream_nsend(conn->output, "-\n", 2); client_connection_destroy(&conn); } return; } o_stream_nsend(conn->output, "+\n", 2); conn->authenticated = TRUE; } while (ok && !conn->input->closed && (line = i_stream_read_next_line(conn->input)) != NULL) { T_BEGIN { char **args; args = p_strsplit(pool_datastack_create(), line, "\t"); ok = client_handle_command(conn, args); } T_END; } if (conn->input->eof || conn->input->stream_errno != 0 || !ok) client_connection_destroy(&conn); }
static void acl_mail_user_create(struct mail_user *user, const char *env) { struct mail_user_vfuncs *v = user->vlast; struct acl_user *auser; auser = p_new(user->pool, struct acl_user, 1); auser->module_ctx.super = *v; user->vlast = &auser->module_ctx.super; v->deinit = acl_user_deinit; auser->acl_lookup_dict = acl_lookup_dict_init(user); auser->acl_env = env; auser->master_user = mail_user_plugin_getenv(user, "master_user"); env = mail_user_plugin_getenv(user, "acl_groups"); if (env != NULL) { auser->groups = (const char *const *)p_strsplit(user->pool, env, ","); } MODULE_CONTEXT_SET(user, acl_user_module, auser); }
static const char * auth_master_reply_hide_passwords(struct auth_master_connection *conn, const char *str) { char **args, *p, *p2; unsigned int i; if (conn->auth->set->debug_passwords) return str; /* hide all parameters that have "pass" in their key */ args = p_strsplit(pool_datastack_create(), str, "\t"); for (i = 0; args[i] != NULL; i++) { p = strstr(args[i], "pass"); p2 = strchr(args[i], '='); if (p != NULL && p < p2) { *p2 = '\0'; args[i] = p_strconcat(pool_datastack_create(), args[i], "=<hidden>", NULL); } } return t_strarray_join((void *)args, "\t"); }
&login_setting_parser_info, NULL }; const struct setting_parser_info **login_set_roots = default_login_set_roots; static struct master_service_settings_cache *set_cache; /* <settings checks> */ static bool login_settings_check(void *_set, pool_t pool, const char **error_r ATTR_UNUSED) { struct login_settings *set = _set; set->log_format_elements_split = p_strsplit(pool, set->login_log_format_elements, " "); if (set->auth_debug_passwords) set->auth_debug = TRUE; if (set->auth_debug) set->auth_verbose = TRUE; return TRUE; } /* </settings checks> */ static const struct var_expand_table * login_set_var_expand_table(const struct master_service_settings_input *input) { static struct var_expand_table static_tab[] = { { 'l', NULL, "lip" }, { 'r', NULL, "rip" },