Bug 622 - problems adding users to a mysql pdb
problems adding users to a mysql pdb
Product: Samba 3.0
Classification: Unclassified
Component: User/Group Accounts
All Linux
: P3 normal
: none
Assigned To: Jelmer Vernooij
Depends on:
  Show dependency treegraph
Reported: 2003-10-14 11:01 UTC by Francesco Mosca
Modified: 2005-11-14 09:25 UTC (History)
0 users

See Also:

strace of smbpasswd -a foo (26.73 KB, text/plain)
2003-10-24 02:18 UTC, Francesco Mosca
no flags Details
some relevant mysql queries (7.60 KB, text/plain)
2003-10-24 02:18 UTC, Francesco Mosca
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Francesco Mosca 2003-10-14 11:01:11 UTC
i'm experimenting a bit with the mysql backend. i'm integrating both nss
(throught libnss-mysql) lookups and samba users, in the same db, and (!) in the
same table. the only fields shared among samba and nss are username, uid and gid. 
here comes the problems: 
i normally add a posix user in the db, setting username, uid, gid and the other
nss-sensible fields.

[problem 1] then, if i try a smbpasswd -a <username>, when smbpasswd checks for
the existance of the user in the db, it segfaults (immediately after the select
query, as i can see from mysql.log)

[problem 2] pdbedit -a -u <username> seems to work perfectly, but when i check
in the db, it added a second record regarding the user, instead of updating the
existing one with the posix infos, so that nss obviusly get confused. 

i hope i have been clear enough,

PS: i hope i've been right to assign this directly to Jelmer, too.
Comment 1 Jelmer Vernooij 2003-10-19 11:08:44 UTC
Can you get a backtrace of problem 1 ? Also, what exactly is the configuration
you're using (smb.conf and MySQL table layout) ?
Assigning to me directly is ok, btw. Saves us some work :-)
Comment 2 Francesco Mosca 2003-10-24 02:17:13 UTC
well, trying to backtrace problem 1, i haven't been able to reproduce the
segfault. probably there was something weird in the db. 
now, smbpasswd -a acts exactly as pdbedit in problem 2. i'm attaching a strace
of "smbpasswd -a foo", with some other info about the queries and the table
structure. the relevant part in smb.conf is the default one: 

        passdb backend = mysql:itc
        itc:mysql user = system
        itc:mysql password = XXX
        itc:mysql database = system

Comment 3 Francesco Mosca 2003-10-24 02:18:05 UTC
Created attachment 221 [details]
strace of smbpasswd -a foo
Comment 4 Francesco Mosca 2003-10-24 02:18:50 UTC
Created attachment 222 [details]
some relevant mysql queries
Comment 5 Jelmer Vernooij 2003-11-09 06:14:33 UTC
Try creating a unique key on the uid field. 
Comment 6 Jelmer Vernooij 2003-11-25 12:16:42 UTC

Any progress?
Comment 7 Francesco Mosca 2003-11-25 15:47:55 UTC
i've an incumbent deadline so i'll test it as soon as i can, but don't know how
soon :)
thanks for your patience, meanwhile i'll try to test it also on 3.0.1-preX
Comment 8 Gerald (Jerry) Carter 2004-04-22 19:58:26 UTC
no response.  closing
Comment 9 Gerald (Jerry) Carter 2005-11-14 09:25:45 UTC
database cleanup