Bug 1958 - MySQL backend documentation is vague
Summary: MySQL backend documentation is vague
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: User/Group Accounts (show other bugs)
Version: 3.0.7
Hardware: x86 Linux
: P3 minor
Target Milestone: none
Assignee: Jelmer Vernooij
QA Contact: Samba QA Contact
Depends on:
Reported: 2004-10-21 12:13 UTC by Scott Merrill
Modified: 2005-08-24 10:26 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Scott Merrill 2004-10-21 12:13:20 UTC
The documentation for the configuration of the MySQL backend is vague.

I'm trying to integrate the Samba MySQL columns with the user columns used by
libnss-mysql (http://libnss-mysql.sourceforge.net/), so that a single table can
contain all relevant user info.

According to the Samba MySQL documentation, columns can be de-activated by
setting them to NULL.  That does not seem to be the case.

netbios name = TEST
workgroup = SMBTEST
security = user
domain logons = yes
domain master = yes
passdb backend = mysql:mysql
mysql:mysql host = localhost
mysql:mysql user = samba
mysql:mysql password = samba
mysql:mysql database = samba
mysql:domain column = 'TEST'
# rows we don't use
mysql:logon_time column = NULL
mysql:logoff_time column = NULL
mysql:kickoff_time column = NULL
mysql:workstations column = NULL
mysql:logon_count column = NULL
mysql:unknown string column = NULL
mysql:munged dial column = NULL
mysql:plain pass column = NULL
mysql:acct ctrl column = NULL
mysql:unknown 3 column = NULL
mysql:logon divs column = NULL
mysql:hours len column = NULL
mysql:bad password count column = NULL
mysql:unknown 6 column = NULL
encrypt passwords = yes
map to guest = bad user
guest account = nobody

smerrill@smerrill:~$ sudo /usr/local/samba/bin/smbpasswd -a cinergi
Connecting to database server, host: localhost, user: samba, password: samba,
database: samba, port: 3306
New SMB password:
Retype new SMB password:
Error executing INSERT INTO user
You have an error in your SQL syntax.  Check the manual that corresponds to your
MySQL server version for the right syntax to use near
Failed to add entry for user cinergi.
Failed to modify password entry for user cinergi

If I comment out all the NULL definitions in smb.conf, then `smbpasswd -a
<user>` works as expected.

If the answer is "You must use all the columns", than I'm okay with that.  I'd
just like to see the relevant documentation indicate that.  Otherwise, I'd like
to know that I can define only those columns that are of use to my environment.
Comment 1 Scott Merrill 2004-10-22 07:20:46 UTC
Incidentally, I'd be happy to help improve the official documentation!
Comment 2 Jelmer Vernooij 2004-11-25 18:59:49 UTC
Try NULL: instead of just NULL. 
Comment 3 Jelmer Vernooij 2005-01-17 07:30:07 UTC
Fixed in SVN. Thanks!
Comment 4 Gerald (Jerry) Carter (dead mail address) 2005-08-24 10:26:53 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.