XhE
2007-Aug-26 00:41 UTC
[Dovecot] authentication with mysql - problem with table name escaping
Found a problem with dovecot 1.0.3 and mysql authentication I got a problem with escaping of mysql table names. Usually, when a mysql table name has some special character (in my case there is a table beginning with the # character) one has to put into these special quotes --- ` ---; others like ' oder " are not recognized. But dovecot somehow doesn't allow me to do that. After switchting auth_verbose to true I get entries in /var/log/messages stating: Password query failed: Incorrect table name ' ' Regards, XhE
Timo Sirainen
2007-Aug-26 12:18 UTC
[Dovecot] authentication with mysql - problem with table name escaping
On 26.8.2007, at 3.41, XhE wrote:> Found a problem with dovecot 1.0.3 and mysql authentication > > I got a problem with escaping of mysql table names. Usually, when a > mysql table name has some special character (in my case there is a > table beginning with the # character) one has to put into these > special quotes --- ` ---; others like ' oder " are not recognized. > But dovecot somehow doesn't allow me to do that.I don't know what you mean by putting into special quotes. Can you given an example? But if you tried to use # it would be treated as a comment, so you'd have to put the whole setting inside quotes: password_query = "select password, from #table where .." -------------- next part -------------- A non-text attachment was scrubbed... Name: PGP.sig Type: application/pgp-signature Size: 186 bytes Desc: This is a digitally signed message part URL: <http://dovecot.org/pipermail/dovecot/attachments/20070826/eb88715a/attachment-0002.bin>
Luuk
2007-Aug-26 12:47 UTC
[Dovecot] authentication with mysql - problem with table name escaping
Hi, for more info see: http://dev.mysql.com/doc/refman/5.0/en/identifiers.html where is stated: "The identifier quote character is the backtick (?`?):" greetings, Luuk> On 26.8.2007, at 3.41, XhE wrote: > >> Found a problem with dovecot 1.0.3 and mysql authentication >> >> I got a problem with escaping of mysql table names. Usually, when a >> mysql table name has some special character (in my case there is a >> table beginning with the # character) one has to put into these >> special quotes --- ` ---; others like ' oder " are not recognized. >> But dovecot somehow doesn't allow me to do that. > > I don't know what you mean by putting into special quotes. Can you > given an example? But if you tried to use # it would be treated as a > comment, so you'd have to put the whole setting inside quotes: > > password_query = "select password, from #table where .." > >