Getting the setsampwent functions to 'work right'

Andrew Bartlett abartlet at samba.org
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 pcug.org.au
Manager, Authentication Subsystems, Samba Team  abartlet at samba.org
Student Network Administrator, Hawker College   abartlet at hawkerc.net
http://samba.org     http://build.samba.org     http://hawkerc.net




More information about the samba-technical mailing list