libsasl2 - auxprop - sql.c - logging problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi everyone,

I have a little "problem" with the sasl logging. In case of many errors
in my logs regarding "missing plugins for sql" and Kerberos, I switched
from saslauthd to auxprop. Everythings works fine but I get tons of this
debug entries in /var/log/auth.log:

Aug 18 18:43:42 mailsrv cyrus/imapd[5324]: sql auxprop plugin using
mysql engine
Aug 18 18:43:42 mailsrv cyrus/imapd[5324]: sql plugin Parse the username
xxxx.xxxx.xx
Aug 18 18:43:42 mailsrv cyrus/imapd[5324]: sql plugin try and connect to
a host
Aug 18 18:43:42 mailsrv cyrus/imapd[5324]: sql plugin trying to open db
'maildb' on host 'localhost'
Aug 18 18:43:42 mailsrv cyrus/imapd[5324]: sql plugin Parse the username
xxxx.xxxx.xx
Aug 18 18:43:42 mailsrv cyrus/imapd[5324]: sql plugin try and connect to
a host
Aug 18 18:43:42 mailsrv cyrus/imapd[5324]: sql plugin trying to open db
'maildb' on host 'localhost'
Aug 18 18:43:42 mailsrv cyrus/imapd[5324]: begin transaction
Aug 18 18:43:42 mailsrv cyrus/imapd[5324]: sql plugin create statement
from userPassword xxxx.xxxx.xx mailsrv
Aug 18 18:43:42 mailsrv cyrus/imapd[5324]: sql plugin doing query SELECT
pwd FROM users WHERE user = 'xxxx.xxxx.xx';
Aug 18 18:43:42 mailsrv cyrus/imapd[5324]: sql plugin create statement
from cmusaslsecretPLAIN xxxx.xxxx.xx mailsrv
Aug 18 18:43:42 mailsrv cyrus/imapd[5324]: sql plugin doing query SELECT
pwd FROM users WHERE user = 'xxxx.xxxx.xx';
Aug 18 18:43:42 mailsrv cyrus/imapd[5324]: commit transaction

<snip>

I tried to set "sql_verbose" in smtpd.conf to 0, false and "no", but
this doesn't take effect.

Then I found a Patch for /plugins/sql.c [1] and gave it a try. Patching
was fine, but rebuilding the Debian Package failed with many warnings
und errors:

sql.c: In function `_sqlite_open':
sql.c:340: warning: unused parameter `host'
sql.c:340: warning: unused parameter `port'
sql.c:340: warning: unused parameter `usessl'
sql.c:341: warning: unused parameter `user'
sql.c:341: warning: unused parameter `password'
sql.c: In function `sqlite_my_callback':
sql.c:381: warning: unused parameter `argc'
sql.c:382: warning: unused parameter `columnNames'
sql.c: In function `_sqlite_exec':
sql.c:406: error: `settings' undeclared (first use in this function)
sql.c:406: error: (Each undeclared identifier is reported only once
sql.c:406: error: for each function it appears in.)

<snip>

I also downloaded the original source, but without patching, I could not
compile it as described in doc/install.html (tons of errors regarding
berkeley)

gcc -Wall -W -g -O2 -o .libs/dbconverter-2 dbconverter-2.o
../sasldb/.libs/libsasldb.al -lresolv ../lib/.libs/libsasl2.so -ldl
-lresolv -ldb-3.2 -lresolv -Wl,--rpath -Wl,/usr/local/lib
dbconverter-2.o(.text+0x171): In function `berkeleydb_open':
/root/cyrus-sasl2-2.1.19.dfsg1/cyrus-sasl-2.1.19.dfsg1/utils/dbconverter-2.c:214:
undefined reference to `db_create_4002'
dbconverter-2.o(.text+0x228): In function `berkeleydb_close':
/root/cyrus-sasl2-2.1.19.dfsg1/cyrus-sasl-2.1.19.dfsg1/utils/dbconverter-2.c:249:
undefined reference to `db_strerror_4002'
dbconverter-2.o(.text+0x44c): In function `listusers':
/root/cyrus-sasl2-2.1.19.dfsg1/cyrus-sasl-2.1.19.dfsg1/utils/dbconverter-2.c:277:
undefined reference to `db_strerror_4002'
../sasldb/.libs/libsasldb.al(db_berkeley.lo)(.text+0x58): In function
`berkeleydb_open':
/root/cyrus-sasl2-2.1.19.dfsg1/cyrus-sasl-2.1.19.dfsg1/sasldb/db_berkeley.c:85:
undefined reference to `db_create_4002'
../sasldb/.libs/libsasldb.al(db_berkeley.lo)(.text+0x83):/root/cyrus-sasl2-2.1.19.dfsg1/cyrus-sasl-2.1.19.dfsg1/sasldb/db_berkeley.c:102:
undefined reference to `db_strerror_4002'
../sasldb/.libs/libsasldb.al(db_berkeley.lo)(.text+0x16b): In function
`berkeleydb_close':
/root/cyrus-sasl2-2.1.19.dfsg1/cyrus-sasl-2.1.19.dfsg1/sasldb/db_berkeley.c:122:
undefined reference to `db_strerror_4002'
../sasldb/.libs/libsasldb.al(db_berkeley.lo)(.text+0x34c): In function
`_sasldb_getdata':
/root/cyrus-sasl2-2.1.19.dfsg1/cyrus-sasl-2.1.19.dfsg1/sasldb/db_berkeley.c:198:
undefined reference to `db_strerror_4002'
../sasldb/.libs/libsasldb.al(db_berkeley.lo)(.text+0x51b): In function
`_sasldb_putdata':
/root/cyrus-sasl2-2.1.19.dfsg1/cyrus-sasl-2.1.19.dfsg1/sasldb/db_berkeley.c:284:
undefined reference to `db_strerror_4002'
../sasldb/.libs/libsasldb.al(db_berkeley.lo)(.text+0x56f):/root/cyrus-sasl2-2.1.19.dfsg1/cyrus-sasl-2.1.19.dfsg1/sasldb/db_berkeley.c:296:
undefined reference to `db_strerror_4002'
collect2: ld returned 1 exit status
make[2]: *** [dbconverter-2] Error 1
make[2]: Leaving directory
`/root/cyrus-sasl2-2.1.19.dfsg1/cyrus-sasl-2.1.19.dfsg1/utils'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory
`/root/cyrus-sasl2-2.1.19.dfsg1/cyrus-sasl-2.1.19.dfsg1'
make: *** [all] Error 2

<snip>

imapd.conf:

configdirectory: /var/lib/cyrus
defaultpartition: default
partition-default: /export/spool/cyrus
unixhierarchysep: yes
lmtp_downcase_rcpt: yes
allowanonymouslogin: no
popminpoll: 1
autocreatequota: 200000
umask: 077
sendmail: /usr/sbin/sendmail
sieveusehomedir: false
sievedir: /var/spool/sieve
hashimapspool: true
allowplaintext: yes
sasl_mech_list: PLAIN LOGIN
sasl_pwcheck_method: auxprop
sasl_auxprop_plugin: sql
sasl_auto_transition: no
lmtpsocket: /var/run/cyrus/socket/lmtp
idlesocket: /var/run/cyrus/socket/idle
notifysocket: /var/run/cyrus/socket/notify
##
## auxprop sql configuration
##
sql_engine: mysql
sql_hostnames: localhost
sql_user: user
sql_passwd: passwd
sql_database: database
sql_verbose: no
sql_select: SELECT pwd FROM users WHERE user = '%u'
##
## SASL SQL Configuration
##
sasl_sql_engine: mysql
sasl_sql_hostnames: localhost
sasl_sql_user: user
sasl_sql_passwd: passwd
sasl_sql_database: database
sasl_sql_verbose: no
sasl_sql_select: SELECT pwd FROM users WHERE user = '%u'

log_level: 0
servername: mailsrv
duplicatesuppression: no
reject8bit: no
quotawarn: 90
timeout: 30
poptimeout: 10
dracinterval: 0
drachost: localhost
sieve_maxscriptsize: 32
sieve_maxscripts: 5
lmtp_overquota_perm_failure: yes

<snip>

cyrus.conf:

START {
  recover         cmd="/usr/sbin/ctl_cyrusdb -r"
  delprune        cmd="/usr/sbin/ctl_deliver -E 3"
  tlsprune        cmd="/usr/sbin/tls_prune"
}
SERVICES {
  imap            cmd="imapd -U 30" listen="imap" prefork=0 maxchild=100
  imaplocal   cmd="imapd -C /etc/cyrus/imapd-local.conf"
listen="127.0.0.1:imap" prefork=0
  imaps           cmd="imapd -s -U 30" listen="imaps" prefork=0 maxchild=100
  imapslocal  cmd="imapd -s -C /etc/cyrus/imapd-local.conf"
listen="127.0.0.1:imaps" prefork=0
  pop3            cmd="pop3d -U 30" listen="pop3" prefork=0 maxchild=50
  pop3s           cmd="pop3d -s -U 30" listen="pop3s" prefork=0 maxchild=50
  lmtpunix        cmd="lmtpd" listen="/var/run/cyrus/socket/lmtp"
prefork=0 maxchild=20
  sieve      cmd="timsieved" listen="213.235.249.170:sieve" prefork=0
maxchild=100
  sievelocal cmd="timsieved -C /etc/cyrus/imapd-local.conf"
listen="127.0.0.1:sieve" prefork=0
  notify          cmd="notifyd" listen="/var/run/cyrus/socket/notify"
proto="udp" prefork=1
}
EVENTS {
  checkpoint      cmd="/usr/sbin/ctl_cyrusdb -c" period=30
  delprune        cmd="/usr/sbin/ctl_deliver -E 3" at=0401
  tlsprune        cmd="/usr/sbin/tls_prune" at=0401
}

<snip>

Does anyone have a working patch for sql.c ?

I'm using gcc version 3.3.5 (Debian 1:3.3.5-13) on AMD64

Rgds, Peter

[1]
<http://frost.ath.cx/software/cyrus-sasl-patches/dist/2.1.19/cyrus-sasl-2.1.19-sql.c.patch>

[Index of Archives]     [Info Cyrus]     [Squirrel Mail]     [Linux Media]     [Yosemite News]     [gtk]     [KDE]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux