[Dovecot] Trouble with password scheme module
Hi, all.
About two and a half years ago, I wrote a hack to add an additional MD5-based password scheme to Dovecot, but I wrote it as a hack to src/auth/password_scheme.c since it was relatively easy to do, and I needed to get a machine running since the machine I was replacing, a Sun Ultra 5 running Post.Office, had dying hard drives.
Now, I'm actually sitting down and adapting it as a module and am having trouble getting it to work.
The code tarball itself can be picked up here:
http://www.ian-justman.com/code/dovecot/password_scheme_po_smd5.tar.gz
Before I continued, I made sure that a system-level account worked:
# telnet <server IP> 110 Trying <server IP>... Connected to <server IP>. Escape character is '^]'. +OK Dovecot ready. user <username> +OK pass <password> +OK Logged in. quit +OK Logging out. Connection closed by foreign host.
I then enabled the module, which introduces the password scheme "PO-SMD5". I have Dovecot's default scheme set to SMD5. If I get a password hash whose value has a {PO-SMD5} tag on it, the session looks like the following:
# telnet <server IP> 110
Trying <server IP>...
Connected to <server IP>.
Escape character is '^]'.
+OK Dovecot ready.
user <user with PO-SMD5 password>
+OK
pass
The following entry is deposited into the system log:
Mar 28 17:44:51 <hostname> dovecot: auth: Error: sql(<username>,<server IP>): Unknown scheme PO-SMD5
However, when I try using an account covered by the system (which does work when the plugin isn't loaded in dovecot.conf), the session looks like the following:
mikuru# telnet <server IP> 110
Trying <server IP>...
Connected to <server IP>.
Escape character is '^]'.
+OK Dovecot ready.
user <user with system password>
+OK
pass
The following entry is deposited into the system log:
Mar 28 17:45:13 <hostname> dovecot: pop3: Error: dlopen(/usr/local/lib/dovecot/lib_password_scheme_po_smd5.so) failed: /usr/local/lib/dovecot/lib_password_scheme_po_smd5.so: Undefined symbol "password_scheme_unregister"
Otherwise, the patch I developed under 1.x applies cleanly to 2.0.x's password_scheme.c and works perfectly as a builtin.
This work was done under FreeBSD 8.1-RELEASE amd64.
Any ideas?
--Ian.
-- Ian R. Justman UNIX hacker. Anime fan. Any questions? ianj (at) ian-justman.com
On 03/28/2011 18:05, Ian R. Justman wrote:
[...]
The code tarball itself can be picked up here:
http://www.ian-justman.com/code/dovecot/password_scheme_po_smd5.tar.gz
I now offer the file for download, though I will need to write some quick docs.
[... troubleshooting I did removed ...]
Otherwise, the patch I developed under 1.x applies cleanly to 2.0.x's password_scheme.c and works perfectly as a builtin.
This work was done under FreeBSD 8.1-RELEASE amd64.
Any ideas?
I found that I'm an idiot. The plugin was in entirely the wrong spot. It should have been in /usr/local/lib/dovecot/auth rather than in where I had it, /usr/local/lib/dovecot.
Once I moved the module into place and an unnecessary config fixed, it works fine. I can now continue to use my Post.Office password hashes as before without having to patch the codebase each and every time a new release of Dovecot comes out.
More to come!
--Ian.
-- Ian R. Justman UNIX hacker. Anime fan. Any questions? ianj (at) ian-justman.com
On 03/28/2011 18:49, Ian R. Justman wrote:
On 03/28/2011 18:05, Ian R. Justman wrote:
[...]
The code tarball itself can be picked up here:
http://www.ian-justman.com/code/dovecot/password_scheme_po_smd5.tar.gz
I now offer the file for download, though I will need to write some quick docs.
[...]
More to come!
The tarball now has documentation for how to build, install and use.
--Ian.
-- Ian R. Justman UNIX hacker. Anime fan. Any questions? ianj (at) ian-justman.com
participants (1)
-
Ian R. Justman