On Tue, 2019-09-24 at 17:47 +0100, Rowland penny via samba wrote:> On 24/09/2019 17:36, Marco Gaiarin via samba wrote: > > I've coded some scripts that extract some info from a smb.conf > > section. > > > > In DC works: > > > > root at vdcsv1:~# samba-tool -V > > 4.5.16-Debian > > root at vdcsv1:~# samba-tool testparm --section sysvol > > > > [sysvol] > > path = /var/lib/samba/sysvol > > read only = No > > root at vdcsv1:~# samba-tool testparm --section-name=sysvol > > > > [sysvol] > > path = /var/lib/samba/sysvol > > read only = No > > > > > > in DM no: > > > > root at vdmsv1:~# samba-tool -V > > 4.8.12-Debian > > root at vdmsv1:~# samba-tool testparm --section users > > ERROR(<type 'exceptions.TypeError'>): uncaught exception - > > File "/usr/lib/python2.7/dist- > > packages/samba/netcmd/__init__.py", line 177, in _run > > return self.run(*args, **kwargs) > > File "/usr/lib/python2.7/dist- > > packages/samba/netcmd/testparm.py", line 105, in run > > lp[section_name].dump(verbose) > > root at vdmsv1:~# samba-tool testparm --section-name=users > > ERROR(<type 'exceptions.TypeError'>): uncaught exception - > > File "/usr/lib/python2.7/dist- > > packages/samba/netcmd/__init__.py", line 177, in _run > > return self.run(*args, **kwargs) > > File "/usr/lib/python2.7/dist- > > packages/samba/netcmd/testparm.py", line 105, in run > > lp[section_name].dump(verbose) > > > > But note that: > > > > root at vdmsv1:~# samba-tool testparm --section-name=users -- > > parameter-name=path > > /home > > > > works. > > > > > > I've hit a bug?! Thanks. > >G'Day Marco, Yes, looks like a bug. Please file a bug or even better submit a patch via a GitLab merge request if you can determine what the trouble is. It would be very helpful if you could work out what difference causes the trouble. The code in question doesn't really know or care about being a DC or domain member, so it will be something either a bit more subtle or a bit more silly, like the share name not existing case-wise. Particularly if you can work it out, posting both smb.conf files might help demonstrate if you don't mind.> No, the last time we discussed 'testparm' vs 'samba-tool testparm', > we > were discussing a DC ;-) > > 'samba-tool testparm' is what is used on a DC > > 'testparm' is what is used all other Samba servers. > > So your command on the Unix Domain member should be: > > testparm --section-name=users --parameter-name=path > > Complicated, isn't it ? ;-)G'Day Rowland, Regardless of the use case, both tools should parse the file quite successfully. The only exceptions I'm aware of are: - the 'registry' configuration, which is only known about by 'testparm'. - include statements that use % modifiers. Again, these only work in the file server and so are only known about by testparm. Otherwise, if there is a behaviour difference it is a bug that should be fixed. Thanks! Andrew Bartlett -- Andrew Bartlett https://samba.org/~abartlet/ Authentication Developer, Samba Team https://samba.org Samba Developer, Catalyst IT https://catalyst.net.nz/services/samba
On 24/09/2019 19:20, Andrew Bartlett wrote:> > G'Day Rowland, > > Regardless of the use case, both tools should parse the file quite > successfully. The only exceptions I'm aware of are: > - the 'registry' configuration, which is only known about by > 'testparm'. > - include statements that use % modifiers. Again, these only work in > the file server and so are only known about by testparm. > > Otherwise, if there is a behaviour difference it is a bug that should > be fixed. > > Thanks! > > Andrew BartlettGood Evening Andrew, Yes both tools should parse the smb.conf, but it is a matter of horses for courses ;-) If you use just 'testparm' on a DC, you will get a different result than if you use 'samba-tool testparm'. If you use 'samba-tool testparm' on a Unix domain member, it throws an exception. Yes, this probably is a bug, it probably should print something like 'Do not use most of the samba-tool subcommands on a Unix domain member' Easiest way out of this (well for me anyway, seeing as I cannot seem to get patches into Samba), advise users to use samba-tool only on a DC. Rowland
On Tue, 2019-09-24 at 19:41 +0100, Rowland penny wrote:> On 24/09/2019 19:20, Andrew Bartlett wrote: > > > > G'Day Rowland, > > > > Regardless of the use case, both tools should parse the file quite > > successfully. The only exceptions I'm aware of are: > > - the 'registry' configuration, which is only known about by > > 'testparm'. > > - include statements that use % modifiers. Again, these only > > work in > > the file server and so are only known about by testparm. > > > > Otherwise, if there is a behaviour difference it is a bug that > > should > > be fixed. > > > > Thanks! > > > > Andrew Bartlett > > Good Evening Andrew, > > Yes both tools should parse the smb.conf, but it is a matter of > horses > for courses ;-)I would rather our tools 'just worked'. All these legacy gaps in the seam between the former branches need addressing, not embedding in our culture.> If you use just 'testparm' on a DC, you will get a different result > than > if you use 'samba-tool testparm'.Then we need to fix that.> If you use 'samba-tool testparm' on a Unix domain member, it throws > an > exception.Again, we need to fix that.> Yes, this probably is a bug, it probably should print something like > 'Do > not use most of the samba-tool subcommands on a Unix domain member' > > Easiest way out of this (well for me anyway, seeing as I cannot seem > to > get patches into Samba), advise users to use samba-tool only on a DC.I do realise that this (such advise) is the tool that you know well, as you freely dispense it. That said, we have sharp edges in Samba, and while we can tell tell users to avoid them endlessly, we should also improve them. The reason you don't often see the reverse, that is 'source3' tools failing spectacularly on the AD DC is because when merging the two codebases, I put significant effort into compatability code to ensure they would continue to 'just work'. That is why smbpasswd and pdbedit all function quite fine against the AD DC. We should continue to weave this project into one seamless cloth. I'm sorry you have trouble getting patches merged. I see you almost got to the end with https://gitlab.com/samba-team/samba/merge_requests/602 and I encourage you to persist. I hope this clarifies things, Andrew Bartlett -- Andrew Bartlett https://samba.org/~abartlet/ Authentication Developer, Samba Team https://samba.org Samba Developer, Catalyst IT https://catalyst.net.nz/services/samba
Mandi! Andrew Bartlett via samba In chel di` si favelave...> Yes, looks like a bug. Please file a bug or even better submit a patch > via a GitLab merge request if you can determine what the trouble is.Ahem, i don't know python... sorry but no patch... Supposing as you have stated DC/DM does not matter, i've only posted the error and the smb.conf. Bug on: https://bugzilla.samba.org/show_bug.cgi?id=14143 Thanks. -- dott. Marco Gaiarin GNUPG Key ID: 240A3D66 Associazione ``La Nostra Famiglia'' http://www.lanostrafamiglia.it/ Polo FVG - Via della Bont?, 7 - 33078 - San Vito al Tagliamento (PN) marco.gaiarin(at)lanostrafamiglia.it t +39-0434-842711 f +39-0434-842797 Dona il 5 PER MILLE a LA NOSTRA FAMIGLIA! http://www.lanostrafamiglia.it/index.php/it/sostienici/5x1000 (cf 00307430132, categoria ONLUS oppure RICERCA SANITARIA)