Bug 151 - MySQL PDB Plugin does not work
Summary: MySQL PDB Plugin does not work
Status: VERIFIED INVALID
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: User/Group Accounts (show other bugs)
Version: 3.0.0preX
Hardware: All Linux
: P2 major
Target Milestone: none
Assignee: Jelmer Vernooij
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-06-09 05:54 UTC by Mario Lipinski
Modified: 2005-11-14 09:26 UTC (History)
1 user (show)

See Also:


Attachments
log.smbd with loglevel 5 (12.54 KB, text/plain)
2003-06-10 08:35 UTC, Mario Lipinski
no flags Details
output of smbclient (1.71 KB, text/plain)
2003-06-10 08:40 UTC, Mario Lipinski
no flags Details
output of smbclient with some more errors (11.10 KB, text/plain)
2003-06-10 08:47 UTC, Mario Lipinski
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mario Lipinski 2003-06-09 05:54:24 UTC
I have a problem with loading the MySQL Plugin.
smbclient fails with error: Protocol negotiation failed

var/log.smbd:

[2003/06/09 14:36:29, 0] smbd/server.c:main(747)
  smbd version 3.0.0beta1 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2003
[2003/06/09 14:36:29, 2] param/loadparm.c:do_section(3376)
  Processing section "[homes]"
[2003/06/09 14:36:29, 2] lib/interface.c:add_interface(79)
  added interface ip=192.168.83.1 bcast=192.168.83.255 nmask=255.255.255.0
[2003/06/09 14:36:29, 2] lib/interface.c:add_interface(79)
  added interface ip=172.16.143.1 bcast=172.16.143.255 nmask=255.255.255.0
[2003/06/09 14:36:29, 2] lib/interface.c:add_interface(79)
  added interface ip=172.16.87.1 bcast=172.16.87.255 nmask=255.255.255.0
[2003/06/09 14:36:29, 2] lib/tallocmsg.c:register_msg_pool_usage(57)
  Registered MSG_REQ_POOL_USAGE
[2003/06/09 14:36:29, 2] lib/dmallocmsg.c:register_dmalloc_msgs(71)
  Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED
[2003/06/09 14:36:29, 2] smbd/server.c:open_sockets_smbd(318)
  waiting for a connection
[2003/06/09 14:36:42, 2] passdb/pdb_interface.c:make_pdb_methods_name(438)
  No builtin backend found, trying to load plugin
[2003/06/09 14:36:42, 2] lib/module.c:smb_load_module(56)
  Module '/usr/local/samba/lib/pdb/mysql.so' loaded
[2003/06/09 14:36:42, 0] passdb/pdb_interface.c:make_pdb_methods_name(448)
  No builtin nor plugin backend for mysql found
[2003/06/09 14:36:42, 1] passdb/pdb_interface.c:make_pdb_context_list(529)
  Loading mysql:user failed!
[2003/06/09 14:36:42, 2] passdb/pdb_interface.c:make_pdb_methods_name(438)
  No builtin backend found, trying to load plugin
[2003/06/09 14:36:42, 2] lib/module.c:smb_load_module(56)
  Module '/usr/local/samba/lib/pdb/mysql.so' loaded
[2003/06/09 14:36:42, 0] passdb/pdb_interface.c:make_pdb_methods_name(448)
  No builtin nor plugin backend for mysql found
[2003/06/09 14:36:42, 1] passdb/pdb_interface.c:make_pdb_context_list(529)
  Loading mysql:user failed!



smb.conf:
[global]
   workgroup = GSB
   server string = Samba Server
   log level = 2
   security = user
   encrypt passwords = yes
   socket options = TCP_NODELAY 
   dns proxy = no 

  domain logons = yes
  os level = 65
  preferred master = true
  domain master = true
  wins proxy = yes
  wins support = yes

    passdb backend = mysql:user, guest
    
[homes]
   comment = Home Directories
   browseable = no
   writable = yes


The Problem did not exist for me in the alpha24 iirc
Comment 1 Jelmer Vernooij 2003-06-10 06:43:57 UTC
Could you retry with log level = 5 and post the logs here?  
Comment 2 Mario Lipinski 2003-06-10 08:35:28 UTC
Created attachment 21 [details]
log.smbd with loglevel 5

will also add the output of smbclient
Comment 3 Mario Lipinski 2003-06-10 08:40:02 UTC
Created attachment 22 [details]
output of smbclient

looked more interesting the first time.
will have a look to reproduce that output
Comment 4 Mario Lipinski 2003-06-10 08:47:18 UTC
Created attachment 23 [details]
output of smbclient with some more errors

id did not change anything. this time i called smbclient as a user, but also
got the errors as root
Comment 5 Jelmer Vernooij 2003-06-10 12:51:47 UTC
It looks like there's nothing happening in the init_module() of your plugin. Can
you verify /usr/local/samba/lib/pdb/mysql.so exists and comes from 3.0.0beta1 ?
Comment 6 Mario Lipinski 2003-06-10 13:46:45 UTC
the module exists - im sure.
i think the logs would not print "Module '/usr/local/samba/lib/pdb/mysql.so'
loaded" then.

How should I verify this?
I build samba several times. everytime with a freshbuilt module.
First I had the problem in beta1 (alpha24 worked fine in this point).
Then the problem was in beta1 and also in SAMBA 3 cvs which i am using now.

i am sure to have build the module with the correct version and have copied it
in the right place. before this i deleted the hole samba directory.

i can rebuilt the beta or the cvs and go 100% sure to have done everything right
if this helps you, but im quite sure already.

(sorry for my language... not native and getting a little bit tired)
Comment 7 Jelmer Vernooij 2003-06-10 14:48:31 UTC
The weird thing about this bug is that I don't think anything important changed
between alpha24 and beta1! 

Also, while init_module() appears to be available in the module you have 
installed, the only line in it (with smb_register_passdb) doesn't seem to 
be executed. I'll look more into this tomorrow.
Comment 8 Thimo Eichstädt 2003-06-12 17:06:49 UTC
Hello,

I had the same problems and tried to figure it out:
the problem is in modules.c:

smb_load_modules searches with
sys_dlsym(handle,"init_module");
for a function called "init_module()" in mysql.so, but pdb_mysql.c doesn't have 
such a function, only "pdb_mysql_init()". But this would only be called if it 
would be statically built in.
A simple solution is to copy the pdb_mysql_init() function to init_module() an 
recompile pdb_mysql.c (by the way, I needed to add -lmysqlclient to the 
Makefile to get mysql.so running).

Don't know how the right behaviour should be (init_module() oder pdb_mysql_init
() or through plugin.so (which also doesn't have a init_module() function). :)
Comment 9 Mario Lipinski 2003-06-15 05:33:50 UTC
Thimo Eichstädt's solution works for me also.
I also had to add the -libmysqlclient and recompile whole samba to get it work.
Comment 10 Jelmer Vernooij 2003-06-16 10:36:33 UTC
If everything works correctly, pdb_mysql_init() gets defined to be 
init_module() and -lmysqlclient is added to the linker flags by configure. 
IIRC something changed there in beta1 so I'll look it up...  
Comment 11 Jelmer Vernooij 2003-06-16 10:39:52 UTC
How did you configure samba? --with-expsam? --with-shared-modules=pdb-mysql ? 
Comment 12 Mario Lipinski 2003-06-16 11:38:20 UTC
neither nor, just ./configure without any options
Comment 13 Jelmer Vernooij 2003-06-16 12:00:13 UTC
Ah, ok. Jerry added the '--with-expsam' option in 3.0beta1. You need to specify
that in order to be able to build the mysql plugin. It is build in 'make all' then 
as well.
Comment 14 Mario Lipinski 2003-06-16 15:08:27 UTC
seems to work configured with '--with-expsam=mysql'
Comment 15 Gerald (Jerry) Carter (dead mail address) 2005-02-07 08:39:13 UTC
originally reported against 3.0.0beta1.  CLeaning out 
non-production release versions.
Comment 16 Gerald (Jerry) Carter (dead mail address) 2005-11-14 09:26:53 UTC
database cleanup