postgresql passdb backend problem and patch

CIURLIA Angelo angelo.ciurlia at laposte.net
Mon Apr 19 13:49:57 GMT 2004


hello,

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 Postgresql "user" is keyword so use it like a table name maybe (is)
problematic
so i propose : smb_user or anything else but not a keyword.
more it seem it possible  to specifie the CONFIG_TABLE_DEFAULT in
smb.conf but i didn't succeed.(if anyone has the good syntax....) 
samba-3.0.2a/source/passdb/pdb_sql.c
-#define CONFIG_TABLE_DEFAULT                           "user"
+#define CONFIG_TABLE_DEFAULT                           "smb_user"
 
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.


-- 
#######################
CIURLIA Angelo
Service Informatique
Mairie de CAUDRY
FRANCE
-------------- next part --------------
A non-text attachment was scrubbed...
Name: passdb-pgsql.patch
Type: application/octet-stream
Size: 3238 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20040419/48f61fb6/passdb-pgsql.obj


More information about the samba-technical mailing list