Mailing List Archive

[Bug 449] dovecot authenticator doesn't set $authenticated_id
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

http://www.exim.org/bugzilla/show_bug.cgi?id=449


w@wrzask.pl changed:

What |Removed |Added
----------------------------------------------------------------------------
Summary|dovecot authenticator |dovecot authenticator
|doesn's set |doesn't set
|$authenticated_id |$authenticated_id



--
Configure bugmail: http://www.exim.org/bugzilla/userprefs.cgi?tab=email

--
## List details at http://www.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 449] dovecot authenticator doesn't set $authenticated_id [ In reply to ]
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

http://www.exim.org/bugzilla/show_bug.cgi?id=449





------- Comment #1 from holmgren@lysator.liu.se 2007-01-16 20:43 -------
As you note, $auth1 and $1 are both indeed set by the authenticator. It looks
more like if something unsets it before server_set_id is expanded. And you get
235 Authentication succeeded, which shouldn't happen if server_set_id were set
to a blank value. In any case, it works here over a normal connection as well
as in a -bh test session:

21:42:42 20921 received: OK 6 user=magnus
21:42:42 20921 auth_plain_dovecot authenticator:
21:42:42 20921 $auth1 = magnus
21:42:42 20921 $1 = magnus
21:42:42 20921 expanding: $auth1
21:42:42 20921 result: magnus
21:42:42 20921 SMTP>> 235 Authentication succeeded

--
Configure bugmail: http://www.exim.org/bugzilla/userprefs.cgi?tab=email

--
## List details at http://www.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 449] dovecot authenticator doesn't set $authenticated_id [ In reply to ]
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

http://www.exim.org/bugzilla/show_bug.cgi?id=449





------- Comment #2 from w@wrzask.pl 2007-01-16 20:53 -------
(In reply to comment #1)
> As you note, $auth1 and $1 are both indeed set by the authenticator. It looks
> more like if something unsets it before server_set_id is expanded. And you get
> 235 Authentication succeeded, which shouldn't happen if server_set_id were set
> to a blank value. In any case, it works here over a normal connection as well
> as in a -bh test session:
>
> 21:42:42 20921 received: OK 6 user=magnus
> 21:42:42 20921 auth_plain_dovecot authenticator:
> 21:42:42 20921 $auth1 = magnus
> 21:42:42 20921 $1 = magnus
> 21:42:42 20921 expanding: $auth1
> 21:42:42 20921 result: magnus
> 21:42:42 20921 SMTP>> 235 Authentication succeeded

What could it be that unsets the thing? My authenticator
config is straightforward (it's a copy&paste from the manual).
$authenticated_id works fine with the plaintext authenticator,
so it's not the fault of any spooky ACL or anything.

How can I do more debugging on that?

--
Configure bugmail: http://www.exim.org/bugzilla/userprefs.cgi?tab=email

--
## List details at http://www.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 449] dovecot authenticator doesn't set $authenticated_id [ In reply to ]
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

http://www.exim.org/bugzilla/show_bug.cgi?id=449





------- Comment #3 from w@wrzask.pl 2007-01-18 18:39 -------
(In reply to comment #1)
> 21:42:42 20921 received: OK 6 user=magnus
> 21:42:42 20921 auth_plain_dovecot authenticator:
> 21:42:42 20921 $auth1 = magnus
> 21:42:42 20921 $1 = magnus
> 21:42:42 20921 expanding: $auth1
> 21:42:42 20921 result: magnus
> 21:42:42 20921 SMTP>> 235 Authentication succeeded

Can you show me your dovecot authenticator config?

--
Configure bugmail: http://www.exim.org/bugzilla/userprefs.cgi?tab=email

--
## List details at http://www.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 449] dovecot authenticator doesn't set $authenticated_id [ In reply to ]
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

http://www.exim.org/bugzilla/show_bug.cgi?id=449





------- Comment #4 from holmgren@lysator.liu.se 2007-01-18 20:06 -------
It's as simple as this:

auth_plain_dovecot:
driver = dovecot
public_name = PLAIN
server_set_id = $auth1
server_socket = /var/run/dovecot/auth-client

--
Configure bugmail: http://www.exim.org/bugzilla/userprefs.cgi?tab=email

--
## List details at http://www.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 449] dovecot authenticator doesn't set $authenticated_id [ In reply to ]
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

http://www.exim.org/bugzilla/show_bug.cgi?id=449





------- Comment #5 from w@wrzask.pl 2007-01-19 12:49 -------
(In reply to comment #4)

> auth_plain_dovecot:
> driver = dovecot
> public_name = PLAIN
> server_set_id = $auth1
> server_socket = /var/run/dovecot/auth-client

Mine is identical. I'm clueless then. Here's my -d+all+memory output
for that session, if it does any good:

13:46:09 87667 received: OK 1 user=test.user.2@example.org
13:46:09 87667 dovecot_plain authenticator:
13:46:09 87667 $auth1 = test.user.2@example.org
13:46:09 87667 $1 = test.user.2@example.org
13:46:09 87667 ---0 Get 0x607350 72 expand.c 3061
13:46:09 87667 ---0 Rst 0x607350 ** expand.c 3137 32832
13:46:09 87667 ---0 Get 0x607350 104 string.c 862
13:46:09 87667 ---0 Rst 0x607351 ** expand.c 5403 32832
13:46:09 87667 expanding: $auth1
13:46:09 87667 result:
13:46:09 87667 --Malloc 0x5f51d0 16 string.c 374 32832 16946
13:46:09 87667 SMTP>> 235 Authentication succeeded

I'd really like to hear what else can I set up for more debugging.

--
Configure bugmail: http://www.exim.org/bugzilla/userprefs.cgi?tab=email

--
## List details at http://www.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 449] dovecot authenticator doesn't set $authenticated_id [ In reply to ]
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

http://www.exim.org/bugzilla/show_bug.cgi?id=449





------- Comment #6 from holmgren@lysator.liu.se 2007-01-21 01:05 -------
I don't know ... short of attaching a debugger.

Can anyone else reproduce this?

--
Configure bugmail: http://www.exim.org/bugzilla/userprefs.cgi?tab=email

--
## List details at http://www.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 449] dovecot authenticator doesn't set $authenticated_id [ In reply to ]
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

http://www.exim.org/bugzilla/show_bug.cgi?id=449





------- Comment #7 from w@wrzask.pl 2007-01-22 12:39 -------
(In reply to comment #6)
> I don't know ... short of attaching a debugger.

I can try to make the authenticator very verbose (ie. by making it
log every function call to look at the values. But I need to know
what C variables should I look at.

--
Configure bugmail: http://www.exim.org/bugzilla/userprefs.cgi?tab=email

--
## List details at http://www.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 449] dovecot authenticator doesn't set $authenticated_id [ In reply to ]
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

http://www.exim.org/bugzilla/show_bug.cgi?id=449





------- Comment #8 from ph10@hermes.cam.ac.uk 2007-01-23 11:42 -------
(In reply to comment #7)
>
> I can try to make the authenticator very verbose (ie. by making it
> log every function call to look at the values. But I need to know
> what C variables should I look at.

This finally got to the top of my list. Although I don't run Dovecot, I think
I've found the problem. The Dovecot authenticator was written by an OP; the
problem seems to be that the values of $auth1 etc are left in stack memory, and
can therefore be overwritten. I have a patch that might fix this; I can't
myself test it. I will attach it here shortly for you to try.



--
Configure bugmail: http://www.exim.org/bugzilla/userprefs.cgi?tab=email

--
## List details at http://www.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 449] dovecot authenticator doesn't set $authenticated_id [ In reply to ]
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

http://www.exim.org/bugzilla/show_bug.cgi?id=449





------- Comment #9 from ph10@hermes.cam.ac.uk 2007-01-23 11:43 -------
Created an attachment (id=50)
--> (http://www.exim.org/bugzilla/attachment.cgi?id=50&action=view)
Patch for dovecot.c

Patch may fix lost of $auth1 value problem.

--
Configure bugmail: http://www.exim.org/bugzilla/userprefs.cgi?tab=email

--
## List details at http://www.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 449] dovecot authenticator doesn't set $authenticated_id [ In reply to ]
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

http://www.exim.org/bugzilla/show_bug.cgi?id=449





------- Comment #10 from w@wrzask.pl 2007-01-23 12:09 -------
(In reply to comment #8)

> This finally got to the top of my list. Although I don't run Dovecot, I think
> I've found the problem. The Dovecot authenticator was written by an OP; the
> problem seems to be that the values of $auth1 etc are left in stack memory, and
> can therefore be overwritten. I have a patch that might fix this; I can't
> myself test it. I will attach it here shortly for you to try.

13:06:51 74226 dovecot_plain authenticator:
13:06:51 74226 $auth1 = test.user.2@example.org
13:06:51 74226 $1 = test.user.2@example.org
13:06:51 74226 expanding: $auth1
13:06:51 74226 result: test.user.2@example.org
13:06:51 74226 SMTP>> 235 Authentication succeeded
235 Authentication succeeded

It works!
Thanks. :)

--
Configure bugmail: http://www.exim.org/bugzilla/userprefs.cgi?tab=email

--
## List details at http://www.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 449] dovecot authenticator doesn't set $authenticated_id [ In reply to ]
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

http://www.exim.org/bugzilla/show_bug.cgi?id=449





------- Comment #11 from holmgren@lysator.liu.se 2007-01-23 12:17 -------
Of course. Why didn't I see that? :-/

--
Configure bugmail: http://www.exim.org/bugzilla/userprefs.cgi?tab=email

--
## List details at http://www.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##
[Bug 449] dovecot authenticator doesn't set $authenticated_id [ In reply to ]
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.

http://www.exim.org/bugzilla/show_bug.cgi?id=449


ph10@hermes.cam.ac.uk changed:

What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED




------- Comment #12 from ph10@hermes.cam.ac.uk 2007-01-23 12:23 -------
(In reply to comment #11)
> Of course. Why didn't I see that? :-/

It was easier for me because I'd seen all the previous legwork you had put into
this.

I have committed the patch to CVS.

--
Configure bugmail: http://www.exim.org/bugzilla/userprefs.cgi?tab=email

--
## List details at http://www.exim.org/mailman/listinfo/exim-dev Exim details at http://www.exim.org/ ##