Bug 804 - Several problems with Mysql pdb.
Summary: Several problems with Mysql pdb.
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: Domain Control (show other bugs)
Version: 3.0.0
Hardware: All Linux
: P3 normal
Target Milestone: none
Assignee: Jelmer Vernooij
QA Contact:
Depends on:
Reported: 2003-11-24 07:35 UTC by Collen Blijenberg
Modified: 2005-11-14 09:28 UTC (History)
0 users

See Also:

Link winbindd with passdb libs (403 bytes, patch)
2003-11-25 10:33 UTC, Jelmer Vernooij
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Collen Blijenberg 2003-11-24 07:35:33 UTC

I have a few bug'z when using the Mysql backend..
./configure --with-static-modules=pdb_mysql gives a lot of error's
the mysql backend doesn't compile as an static module..

it say's:

- compiling smbd/server.c
- linking bin/smdb
- passdb/pdb_mysql.o (.text+0x1c6) in function 'pdb_mysql_string_fielt'
- : undefind reference to 'mysql_realexcape_string'

and it goes on and on, with these .text/mysql error's and stops compiling

Also if you compile it the normalway (shared) no prob's except,
if one is using the User-Manager from NT4. (the passwd/imap is working fine 
with it!!)

I Use Redhat 9.0 / mysql 3.23.43 / Samba 3.0.1pre3


Collen Blijenberg (MLHJ)
Comment 1 Jelmer Vernooij 2003-11-24 08:48:07 UTC
Hi Again Collen :-)

Can you check whether PASSDBLIBS in Makefile contains -lmysqlclient ?

Comment 2 Collen Blijenberg 2003-11-25 07:36:07 UTC
Well g'day Jelmer.. how's it going..

there is a passdb_libs= -L/usr/lib/mysql -lmysqlclient ............ (and more)
line, so yes there is..

here is also a dump of the error itself.. (just incase..)
Compiling sam/idmap_ldap.c
Compiling sam/idmap_tdb.c
Linking bin/winbindd
passdb/pdb_mysql.o(.text+0x181): In function `pdb_mysql_string_field':
passdb/pdb_mysql.c:125: undefined reference to `mysql_real_escape_string'
passdb/pdb_mysql.o(.text+0x37c): In function `row_to_sam_account':
passdb/pdb_mysql.c:219: undefined reference to `mysql_num_fields'
passdb/pdb_mysql.o(.text+0x384):passdb/pdb_mysql.c:220: undefined reference to 
passdb/pdb_mysql.o(.text+0x99f): In function `mysqlsam_setsampwent':
passdb/pdb_mysql.c:344: undefined reference to `mysql_query'
passdb/pdb_mysql.o(.text+0x9f8):passdb/pdb_mysql.c:358: undefined reference to 
passdb/pdb_mysql.o(.text+0xa2a):passdb/pdb_mysql.c:353: undefined reference to 
passdb/pdb_mysql.o(.text+0xa72):passdb/pdb_mysql.c:357: undefined reference to 
passdb/pdb_mysql.o(.text+0xaee):passdb/pdb_mysql.c:365: undefined reference to 
passdb/pdb_mysql.o(.text+0xbb5): In function `mysqlsam_endsampwent':
passdb/pdb_mysql.c:383: undefined reference to `mysql_free_result'
passdb/pdb_mysql.o(.text+0xe97): In function `mysqlsam_select_by_field':
passdb/pdb_mysql.c:433: undefined reference to `mysql_real_escape_string'
passdb/pdb_mysql.o(.text+0x11c5):passdb/pdb_mysql.c:511: undefined reference to 
passdb/pdb_mysql.o(.text+0x1221):passdb/pdb_mysql.c:519: undefined reference to 
passdb/pdb_mysql.o(.text+0x1252):passdb/pdb_mysql.c:522: undefined reference to 
passdb/pdb_mysql.o(.text+0x1272):passdb/pdb_mysql.c:530: undefined reference to 
passdb/pdb_mysql.o(.text+0x12c4):passdb/pdb_mysql.c:526: undefined reference to 
passdb/pdb_mysql.o(.text+0x17dd): In function `mysqlsam_delete_sam_account':
passdb/pdb_mysql.c:617: undefined reference to `mysql_real_escape_string'
passdb/pdb_mysql.o(.text+0x184b):passdb/pdb_mysql.c:629: undefined reference to 
passdb/pdb_mysql.o(.text+0x18a7):passdb/pdb_mysql.c:637: undefined reference to 
passdb/pdb_mysql.o(.text+0x20cd): In function `mysqlsam_replace_sam_account':
passdb/pdb_mysql.c:849: undefined reference to `mysql_query'
passdb/pdb_mysql.o(.text+0x2122):passdb/pdb_mysql.c:853: undefined reference to 
passdb/pdb_mysql.o(.text+0x25ea): In function `mysqlsam_init':
passdb/pdb_mysql.c:925: undefined reference to `mysql_init'
passdb/pdb_mysql.o(.text+0x26ed):passdb/pdb_mysql.c:931: undefined reference to 
passdb/pdb_mysql.o(.text+0x2732):passdb/pdb_mysql.c:940: undefined reference to 
collect2: ld returned 1 exit status
make: *** [bin/winbindd] Error 1
[root@hermes source]#

dunno where to look for.. ? maby mysql can't be compile in as static module ?
strainge btw, as shared module there where no probs with compiling,
just when using it (You know, the array bound are invalid/stub received bad 
data error..) as passdb backend...


Collen Blijenberg (MLHJ)

Comment 3 Jelmer Vernooij 2003-11-25 10:33:24 UTC
Created attachment 268 [details]
Link winbindd with passdb libs
Comment 4 Jelmer Vernooij 2003-11-25 10:33:51 UTC
Please try the following patch.
Comment 5 Jelmer Vernooij 2003-11-25 11:42:33 UTC
I've tested this at home and verified that the given patch fixes the bug. 
If you still get problems, please not that ./configure (in this case) requires 
both --with-expsam=mysql and --with-static-modules=pdb_mysql
Comment 6 Gerald (Jerry) Carter (dead mail address) 2005-08-24 10:18:22 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.
Comment 7 Gerald (Jerry) Carter (dead mail address) 2005-11-14 09:28:44 UTC
database cleanup