git://git.exim.org
/
exim.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Copyright updates:
[exim.git]
/
src
/
src
/
auths
/
dovecot.c
diff --git
a/src/src/auths/dovecot.c
b/src/src/auths/dovecot.c
index 5d7713389e04cd22ef91d5db0562bf97e9877ed6..377c09205f4258e1aa68459a12d65e3bb16db4c5 100644
(file)
--- a/
src/src/auths/dovecot.c
+++ b/
src/src/auths/dovecot.c
@@
-1,6
+1,7
@@
/*
/*
- * Copyright (c) The Exim Maintainers 2006 - 202
2
+ * Copyright (c) The Exim Maintainers 2006 - 202
3
* Copyright (c) 2004 Andrey Panin <pazke@donpac.ru>
* Copyright (c) 2004 Andrey Panin <pazke@donpac.ru>
+ * SPDX-License-Identifier: GPL-2.0-or-later
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published
@@
-96,13
+97,15
@@
static int socket_buffer_left;
enable consistency checks to be done, or anything else that needs
to be set up. */
enable consistency checks to be done, or anything else that needs
to be set up. */
-void auth_dovecot_init(auth_instance *ablock)
+void
+auth_dovecot_init(auth_instance * ablock)
{
{
-auth_dovecot_options_block *ob =
+auth_dovecot_options_block *
ob =
(auth_dovecot_options_block *)(ablock->options_block);
if (!ablock->public_name) ablock->public_name = ablock->name;
if (ob->server_socket) ablock->server = TRUE;
(auth_dovecot_options_block *)(ablock->options_block);
if (!ablock->public_name) ablock->public_name = ablock->name;
if (ob->server_socket) ablock->server = TRUE;
+else DEBUG(D_auth) debug_printf("Dovecot auth driver: no server_socket for %s\n", ablock->public_name);
ablock->client = FALSE;
}
ablock->client = FALSE;
}
@@
-303,16
+306,14
@@
auth_defer_msg = US"authentication socket protocol error";
socket_buffer_left = 0; /* Global, used to read more than a line but return by line */
for (;;)
{
socket_buffer_left = 0; /* Global, used to read more than a line but return by line */
for (;;)
{
-debug_printf("%s %d\n", __FUNCTION__, __LINE__);
if (!dc_gets(buffer, sizeof(buffer), &cctx))
OUT("authentication socket read error or premature eof");
if (!dc_gets(buffer, sizeof(buffer), &cctx))
OUT("authentication socket read error or premature eof");
-debug_printf("%s %d\n", __FUNCTION__, __LINE__);
p = buffer + Ustrlen(buffer) - 1;
if (*p != '\n')
OUT("authentication socket protocol line too long");
*p = '\0';
p = buffer + Ustrlen(buffer) - 1;
if (*p != '\n')
OUT("authentication socket protocol line too long");
*p = '\0';
- HDEBUG(D_auth) debug_printf("
received:
'%s'\n", buffer);
+ HDEBUG(D_auth) debug_printf("
DOVECOT<<
'%s'\n", buffer);
nargs = strcut(buffer, args, nelem(args));
nargs = strcut(buffer, args, nelem(args));
@@
-422,12
+423,12
@@
if ((
HDEBUG(D_auth) debug_printf("error sending auth_command: %s\n",
strerror(errno));
HDEBUG(D_auth) debug_printf("error sending auth_command: %s\n",
strerror(errno));
-HDEBUG(D_auth) debug_printf("
sent:
'%s'\n", auth_command);
+HDEBUG(D_auth) debug_printf("
DOVECOT>>
'%s'\n", auth_command);
while (1)
{
while (1)
{
- uschar *temp;
- uschar *auth_id_pre = NULL;
+ uschar *
temp;
+ uschar *
auth_id_pre = NULL;
if (!dc_gets(buffer, sizeof(buffer), &cctx))
{
if (!dc_gets(buffer, sizeof(buffer), &cctx))
{
@@
-436,7
+437,7
@@
while (1)
}
buffer[Ustrlen(buffer) - 1] = 0;
}
buffer[Ustrlen(buffer) - 1] = 0;
- HDEBUG(D_auth) debug_printf("
received:
'%s'\n", buffer);
+ HDEBUG(D_auth) debug_printf("
DOVECOT<<
'%s'\n", buffer);
nargs = strcut(buffer, args, nelem(args));
HDEBUG(D_auth) debug_strcut(args, nargs, nelem(args));
nargs = strcut(buffer, args, nelem(args));
HDEBUG(D_auth) debug_strcut(args, nargs, nelem(args));
@@
-470,6
+471,8
@@
while (1)
#endif
write(cctx.sock, temp, Ustrlen(temp))) < 0)
OUT("authentication socket write error");
#endif
write(cctx.sock, temp, Ustrlen(temp))) < 0)
OUT("authentication socket write error");
+
+ HDEBUG(D_auth) debug_printf(" DOVECOT>> '%s'\n", temp);
break;
case 'F':
break;
case 'F':
@@
-523,7
+526,10
@@
if (cctx.sock >= 0)
close(cctx.sock);
/* Expand server_condition as an authorization check */
close(cctx.sock);
/* Expand server_condition as an authorization check */
-return ret == OK ? auth_check_serv_cond(ablock) : ret;
+if (ret == OK) ret = auth_check_serv_cond(ablock);
+
+HDEBUG(D_auth) debug_printf("dovecot auth ret: %s\n", rc_names[ret]);
+return ret;
}
}