postgresql passdb backend problem and patch

Jelmer Vernooij jelmer at vernstok.nl
Mon Apr 19 15:51:23 GMT 2004


Hi,

On Mon, Apr 19, 2004 at 03:49:57PM +0200, CIURLIA Angelo wrote about 'postgresql passdb backend problem and patch':
> i try tu use samba with the postgresql passdb backend.

> i had minor problem , i dont know if anyone has deal with it  but that
> my solution.

> an sql db dump sample  exist for mysql not for posgresql, so 
> samba-3.0.2a/examples/pdb/pgsql/pdb_pgsql.sql is a schema dump that work
> for me.
> And samba-3.0.2a/examples/pdb/pgsql/smb.pgsql.conf is a sample conf to
> add at smb.conf.

> in last when i insert user whith pdbedit, that's done in lowercase, but
> when authentificating with win98 the query field is in uppercase. in
> postgresql unlike mysql(it seems) the equal string operator is case
> sensitive.
> so :

> samba-3.0.2a/source/passdb/pdb_sql.c
> "SELECT ... FROM %s WHERE %s = '%s'",
> "SELECT ... FROM %s WHERE %s ILIKE '%s'",

> but ilke operator doesn't seems exist in mysql....
> "SELECT ... FROM %s WHERE lower(%s) = 'lower(%s)'",
> may be a better solution(more compatible) ??? i don't test it
> or maybe make to function one for mysql, one for postgresql.... as you
> like.
ILIKE doesn't exist in MySQL, so you'll have to come up with a
different solution - perhaps there's a common strtolower() function
both postgresql and mysql have? Is there any way you can specify that
fields are case-insensitive in postgresql?

Cheers,

Jelmer

-- 
Jelmer Vernooij <jelmer at vernstok.nl> - http://jelmer.vernstok.nl/
Todo: 0


More information about the samba-technical mailing list