mysql auxprop redhat 8.0 authentication problems

Luke Johnson luke-list at rushmore.com
Tue Jan 28 06:24:34 EST 2003


Howdy,

Problem:
So, I'm setting up a new Cyrus server, pretty standard config (see below)
It seems that in Simon's mysql auxprop code, the mysql_query() is failing.  I'm always getting back a -1 (error) result????
I'm about to write a test program, to try the mysql libs away from sasl, and see if I can isolate the problem.
So guess I'm just wondering if anybody else has this setup and ran into a similar situation???
Be real nice if there was something small missing, and my authentication would start working tomorrow... ;)
(incidentally, I'm trying against a mysql server that is currently authenticating corectly now for a similar setup: RH7.3, cyrus-imapd-2.19, sasl-2.1.7 w/mysql auxprop)
Finally, I did check both the cyrus-sasl and info-cyrus lists, didn't seem to see any mention of a similar problem...

Hmmm, any advice appreciated, and thanks in advance,
LukeJ.

cyrus-sasl-2.1.10
./configure \
--sysconfdir=/usr/local/etc \
--disable-krb4 \
--with-dbpath=/usr/local/etc/sasldb \
--includedir=/usr/local/include \
--enable-plain \
--enable-login \
--disable-java \
--disable-gssapi \
--with-mysql=/usr \
--without-pam \
--with-rc4=openssl \
--with-mysqlauxprop \
--with-saslauthd \
--with-bdb-incdir=/usr/local/include/db4 \
--with-bdb-libdir=/usr/local/lib

cyrus-imapd-2.1.11
./configure \
--prefix=/usr/include \
--with-cyrus-prefix=/usr/cyrus \
--with-dbdir=/usr/local \
--with-cyrus-group=mail \
--with-cyrus-user=cyrus \
--with-auth=unix \
--without-zephyr \
--with-com-err \
--with-ucdsnmp=/usr/lib \
--with-sasl=/usr/include

[root at mail cyrus-sasl-2.1.10]# rpm -qa | grep mysql
mysql-3.23.54a-4
mysql-devel-3.23.54a-4
mysql-server-3.23.54a-4

...and RedHat 8.0 with errata RPMs (mysql, etc...),
...and of course followed the setup guides (ie /usr/lib/sasl2 -> /usr/local/lib/sasl2)...

--------------------------------------------------------------------------------------------------------------

imapd.conf:
configdirectory: /var/imap
partition-default: /var/spool/imap
admins: cyrus
allowanonymouslogin: no
allowplaintext: yes
umask: 077
quotawarn: 90
#going to use mysql... don't need saslauthd
#sasl_pwcheck_method: saslauthd
sasl_pwcheck_method: auxprop

### Get auth directly from xxx - START ###
sasl_mysql_hostnames: 208.xxx.xxx.xxx
sasl_mysql_user: authuser
sasl_mysql_passwd: xxx
sasl_mysql_database: xxx
sasl_mysql_statement: select pass from email where eaddr ='%u' and mid=1 and active=1"
### Get auth directly from xxx - END ###

sasl_mysql_verbose: true

--------------------------------------------------------------------------------------------------------------

code (sorry if it wraps badly):
/* create a statment that we will use */
query = mysql_create_statement(sparams, settings->mysql_statement, realname,escap_userid, escap_realm);
if (settings->mysql_verbose)
    sparams->utils->log(NULL, SASL_LOG_WARN, "mysql plugin doing query: %s\n", query);

/* run the query */
int qresult;
if ( (qresult = mysql_query(sock,query)) < 0 || !(result=mysql_store_result(sock))) {
    sparams->utils->free(query);
    if (settings->mysql_verbose)
        sparams->utils->log(NULL, SASL_LOG_WARN, "LHJ - mysql query returned:  result:%i store:%i\n", qresult,result);
    continue;
}

--------------------------------------------------------------------------------------------------------------

logs:
Jan 28 04:11:22 bhmail imapd[4375]: mysql auxprop plugin has been requested
Jan 28 04:11:22 bhmail imapd[4375]: mysql plugin Parse the username luke
Jan 28 04:11:22 bhmail imapd[4375]: mysql plugin try and connect to a host
Jan 28 04:11:22 bhmail imapd[4375]: mysql plugin try and connect to 208.xxx.xxx.xxx
Jan 28 04:11:22 bhmail imapd[4375]: mysql plugin create statement from realname:userPassword uid:luke realm:mail.xxx.com
Jan 28 04:11:22 bhmail imapd[4375]: mysql plugin doing query: select pass from email where eaddr ='luke' and mid=1 and active=1"
Jan 28 04:11:22 bhmail imapd[4375]: LHJ - mysql query returned:  result:-1 store:0
Jan 28 04:11:22 bhmail imapd[4375]: mysql plugin create statement from realname:cmusaslsecretPLAIN uid:luke realm:mail.xxx.com
Jan 28 04:11:22 bhmail imapd[4375]: mysql plugin doing query: select pass from email where eaddr ='luke' and mid=1 and active=1"
Jan 28 04:11:22 bhmail imapd[4375]: LHJ - mysql query returned:  result:-1 store:0
Jan 28 04:11:22 bhmail imapd[4375]: unable to open Berkeley db /usr/local/etc/sasldb: No such file or directory
Jan 28 04:11:22 bhmail imapd[4375]: unable to open Berkeley db /usr/local/etc/sasldb: No such file or directory
Jan 28 04:11:22 bhmail imapd[4375]: mysql plugin Parse the username luke
Jan 28 04:11:22 bhmail imapd[4375]: mysql plugin try and connect to a host
Jan 28 04:11:22 bhmail imapd[4375]: mysql plugin try and connect to 208.xxx.xxx.xxx
Jan 28 04:11:22 bhmail imapd[4375]: badlogin: localhost.localdomain[127.0.0.1] plaintext luke SASL(-13): user not found: checkpass failed

--------------------------------------------------------------------------------------------------------------

Thanks again,
LukeJ.





More information about the Info-cyrus mailing list