xfesty
2002-Nov-07 17:19 UTC
[Samba] smbpasswd (adding machines?) with pdb_mysql doesn't work
Hiya. Still having fun with his mysql module - it appears to read from the mysql database fine, but I can't seem to add machine accounts (and I can't get too far unless I do this). It might also be my own stupidity too - let me know ;-) I've got a machine called "bbmachine" - without pdb_mysql, I can join the domain no problems. However, I need to rejoin the machines to the domain once I use pdb_mysql. Just inserting a machine account into the mysql database (username, nt username, password) doesn't work, so I thought I'd try smbpasswd - I get this error. root@serber[/etc/samba]# smbpasswd -a -m bbmachine$ Connecting to database server, host: localhost, user: sambauser, password: sambapass, database: samba, port: 3306 Error while executing MySQL query: You have an error in your SQL syntax near ';,passcantime;,passmusttime;,username,domain;,ntusername;,fullname;,hom edir;,dir' at line 1 INSERT INTO users (acct_ctrl,passmusttime;,passmusttime;,hourslen;,logondivs;,uid;,gid,use rsid;,groupsid;,username,domain;,fullname;,lanmanpass;,ntpass;) VALUES (128,1038503414,1036689014,21,168,1001,102,'S-1-5-21-185972153- 986818063-2128889050-3002','S-1-5-21-185972153-986818063-2128889050- 1205','bbmachine$','BBNETWORK','BBMACHINE','7A58D4CAF8CB00A46E45D5F10408 CFBD','846758B4FA35D304D8DC817935F4005F') Error executing INSERT INTO users (acct_ctrl,passmusttime;,passmusttime;,hourslen;,logondivs;,uid;,gid,use rsid;,groupsid;,username,domain;,fullname;,lanmanpass;,ntpass;) VALUES (128,1038503414,1036689014,21,168,1001,102,'S-1-5-21-185972153- 986818063-2128889050-3002','S-1-5-21-185972153-986818063-2128889050- 1205','bbmachine$','BBNETWORK','BBMACHINE','7A58D4CAF8CB00A46E45D5F10408 CFBD','846758B4FA35D304D8DC817935F4005F'), You have an error in your SQL syntax near ';,passmusttime;,hourslen;,logondivs;,uid;,gid,usersid;,groupsid;,userna me,domain' at line 1 Failed to add entry for user bbmachine$. Failed to modify password entry for user bbmachine$ Are the ";"'s meant to be there? Looking at the above, there's a "acct_ctrl" column its trying to read out of - this ISN'T mentioned in the README for the module (only acct_desc). What identifier:blah blah column do I use for this, and why isn't it mentioned? Anything else I'm missing? Below is the identifiers for each column out of my smb.conf, and the columns do exist. Cheers R -- mysql:logon time column = logontime mysql:logoff time column = logofftime mysql:kickoff time column = kickofftime mysql:username column = username mysql:nt username column = ntusername; mysql:fullname column = fullname; mysql:workstations column = workstations; mysql:uid column = uid; mysql:gid colun = gid; mysql:user sid column = usersid; mysql:group sid column = groupsid; mysql:lanman pass column = lanmanpass; mysql:nt pass column = ntpass; mysql:plaintext pass column = plaintextpass; mysql:pass last set time column = passlastset; mysql:pass can change time column = passcantime; mysql:pass must change time column = passmusttime; mysql:domain column = domain; mysql:home dir column = homedir; mysql:dir drive column = dirdrive; mysql:logon script column = logonscript; mysql:profile path column = profilepath; mysql:acct desc column = acctdesc; mysql:unknown string column = unknown; mysql:munged dial column = mungeddial; mysql:unknown 3 column = unknown3; mysql:logon divs column = logondivs; mysql:hours len column = hourslen; mysql:unknown 5 column = unknown5; mysql:unknown 6 column = unknown6;
Jelmer Vernooij
2002-Nov-07 18:32 UTC
[Samba] smbpasswd (adding machines?) with pdb_mysql doesn't work
On Fri, Nov 08, 2002 at 04:17:59AM +1100, xfesty wrote about '[Samba] smbpasswd (adding machines?) with pdb_mysql doesn't work':> Hiya.> Still having fun with his mysql module - it appears to read from the > mysql database fine, but I can't seem to add machine accounts (and I > can't get too far unless I do this).> It might also be my own stupidity too - let me know ;-)> I've got a machine called "bbmachine" - without pdb_mysql, I can join > the domain no problems. However, I need to rejoin the machines to the > domain once I use pdb_mysql.> Just inserting a machine account into the mysql database (username, nt > username, password) doesn't work, so I thought I'd try smbpasswd - I > get this error.> Are the ";"'s meant to be there?Nope, they aren't. Your smb.conf is wrong.> Looking at the above, there's a "acct_ctrl" column its trying to read > out of - this ISN'T mentioned in the README for the module (only > acct_desc). What identifier:blah blah column do I use for this, and > why isn't it mentioned?I think I meant acct_desc.> mysql:nt username column = ntusername;Remove the ;... Jelmer -- Jelmer Vernooij <jelmer@nl.linux.org> - http://nl.linux.org/~jelmer/ 19:30:46 up 3:04, 7 users, load average: 0.00, 0.00, 0.00