[Patch] fix for bug 11613, samba-tool fsmo throws an error

Rowland Penny repenny241155 at gmail.com
Sat Dec 5 20:40:13 UTC 2015


On 05/12/15 20:16, Andrew Bartlett wrote:
> On Sat, 2015-12-05 at 21:51 +0200, Uri Simchoni wrote:
>> Pushed to autobuild.
>>
>> However, I do see other uses of "assert(len(something) == 1)" in
>> python/samba/netcmd and I have to wonder whether they have to be
>> fixed too.
> If they would indicate a really unlikely situation, then that should be
> fine - much as we don't check every search result before de
> -referencing.
>
> Until this bug was raised, I would have assumed all FSMO roles were
> filled all the time, but if a server has been deleted it certainly
> could appear to be un-filled (links to deleted objects get hidden).
>
> However there is an issue with the original patch, and I'm sorry for
> not getting in earlier with a comment.  The idea of raising an
> exception is fine, but if you look at the other exceptions in that
> file, they raise a CommandError, not the generic Exception, and we
> should do the same here.
>
> This ensures we can catch it correctly and print it nicely, while
> leaving real 'crashes' as backtraces.
>
> Presumably it will be in master by the time you get this, so please
> just apply a new patch using CommandError instead of Exception.
>
> Thanks!
>
> Andrew Bartlett
>

OK Andrew, I will prepare a patch, I just wish you had said something 
sooner.

Rowland




More information about the samba-technical mailing list