view src/login-common/ssl-proxy.c @ 22715:20415dd0b85a

dsync: Add per-mailbox sync lock that is always used. Both importing and exporting gets the lock before they even sync the mailbox. The lock is kept until the import/export finishes. This guarantees that no matter how dsync is run, two dsyncs can't be working on the same mailbox at the same time. This lock is in addition to the optional per-user lock enabled by the -l parameter. If the -l parameter is used, the same lock timeout is used for the per-mailbox lock. Otherwise 30s timeout is used. This should help to avoid email duplication when replication is enabled for public namespaces, and maybe in some other rare situations as well.
author Timo Sirainen <timo.sirainen@dovecot.fi>
date Thu, 28 Dec 2017 14:10:23 +0200
parents cb108f786fb4
children
line wrap: on
line source

/* Copyright (c) 2002-2018 Dovecot authors, see the included COPYING file */

#include "lib.h"
#include "ssl-proxy.h"

bool ssl_initialized = FALSE;

#ifndef HAVE_SSL

/* no SSL support */

int ssl_proxy_alloc(int fd ATTR_UNUSED, const struct ip_addr *ip ATTR_UNUSED,
		    pool_t set_pool ATTR_UNUSED,
		    const struct login_settings *login_set ATTR_UNUSED,
		    const struct master_service_ssl_settings *ssl_set ATTR_UNUSED,
		    struct ssl_proxy **proxy_r ATTR_UNUSED)
{
	i_error("Dovecot wasn't built with SSL support");
	return -1;
}

int ssl_proxy_client_alloc(int fd ATTR_UNUSED, struct ip_addr *ip ATTR_UNUSED,
			   pool_t set_pool ATTR_UNUSED,
			   const struct login_settings *login_set ATTR_UNUSED,
			   const struct master_service_ssl_settings *ssl_set ATTR_UNUSED,
			   ssl_handshake_callback_t *callback ATTR_UNUSED,
			   void *context ATTR_UNUSED,
			   struct ssl_proxy **proxy_r ATTR_UNUSED)
{
	i_error("Dovecot wasn't built with SSL support");
	return -1;
}

void ssl_proxy_start(struct ssl_proxy *proxy ATTR_UNUSED)
{
}

void ssl_proxy_set_client(struct ssl_proxy *proxy ATTR_UNUSED,
			  struct client *client ATTR_UNUSED)
{
}

bool ssl_proxy_has_valid_client_cert(const struct ssl_proxy *proxy ATTR_UNUSED)
{
	return FALSE;
}

bool ssl_proxy_has_broken_client_cert(struct ssl_proxy *proxy ATTR_UNUSED)
{
	return FALSE;
}

int ssl_proxy_cert_match_name(struct ssl_proxy *proxy ATTR_UNUSED,
			      const char *verify_name ATTR_UNUSED)
{
	return -1;
}

const char *ssl_proxy_get_peer_name(struct ssl_proxy *proxy ATTR_UNUSED)
{
	return NULL;
}

bool ssl_proxy_is_handshaked(const struct ssl_proxy *proxy ATTR_UNUSED)
{
	return FALSE;
}

const char *ssl_proxy_get_last_error(const struct ssl_proxy *proxy ATTR_UNUSED)
{
	return NULL;
}

const char *ssl_proxy_get_security_string(struct ssl_proxy *proxy ATTR_UNUSED)
{
	return "";
}

const char *ssl_proxy_get_compression(struct ssl_proxy *proxy ATTR_UNUSED)
{
	return NULL;
}

const char *ssl_proxy_get_cert_error(struct ssl_proxy *proxy ATTR_UNUSED)
{
	return "";
}

void ssl_proxy_destroy(struct ssl_proxy *proxy ATTR_UNUSED) {}

void ssl_proxy_free(struct ssl_proxy **proxy ATTR_UNUSED) {}

unsigned int ssl_proxy_get_count(void)
{
	return 0;
}

void ssl_proxy_init(void) {}
void ssl_proxy_deinit(void) {}

#endif