Getting the setsampwent functions to 'work right'

Andrew Bartlett abartlet at
Thu Jun 13 21:38:01 GMT 2002

I was talking to tpot recently, and he found an interesting bug in the
current mulitple pdb code.

If we don't implment setsampwent() in a backend, and that is the only
backend then we segfault...

Now the is relitivly easy to 'fix', but I wonder if there is a better
way to do the design:

How about doing all the setsampwent() calls at the start, then storing
the 'getsampwent' and 'endsampwent' fucntion pointers in some sort of
list.  This way we do all memory allocation etc during the 'set', and
not implicitly halfway thought the 'get'.  We can also ensure that we
actually do the 'end' correctly, no matter what modules did/did not
implement this.

I was thinking we should just have two linked lists, one of
'getsampwent' functions, another of 'endsampwent' functions and use them
in the various loops.

How does this sound?

Andrew Bartlett

Andrew Bartlett                                 abartlet at
Manager, Authentication Subsystems, Samba Team  abartlet at
Student Network Administrator, Hawker College   abartlet at

More information about the samba-technical mailing list