Extend backend fields

Aurélien Degrémont adegremont at idealx.com
Fri Sep 19 16:34:43 GMT 2003


Hi,

In order to implement new functionnalities to Samba, we may need to add 
new fields to user account structure. (Like 'lock out time', 'password 
uniqueness','TSE information fields')
But, the users accounts are directly linked to the backends and they 
must be adapt each time we modify the structure. But, compatibility is 
really important and must be converve between versions.

Unfortunately, all the backends are not easily extendables.
XML, LDAP and MySQL are not really a problem because fields could be 
added without changing the present datas, without any effects to the 
present format either.
But the matter is totally different concerning tdbsam. The datas stored 
into this backend are directly got from the user account structure 
(SAM_ACOUNT), and so, if we modify this stucture, the compatibility is 
broken.

That's why, i would like we try to find a solution to that.
We had thought about that and we could proposed some solutions.

In the all solutions, something really important must be fixed. The 
SAM_ACCOUNT structure must be separed from the tdbsam, and tdbsam must 
not use directly this struture to store the datas, like the other backends.
In this context, solutions could be guessed to solve the problem.

First, a header or/and version of the file (tdbsam) may be added to new 
version(s) of tdbsam, if no version are available, it guess it's the 
previous version. Important modifications may be added to pdb_tdb.c to 
implements that.

Second possibility. New fields may be added to the end of the records. 
When Samba try to read the file, it could automatically detect the 
'version' (implicit) of the file due to the 'errors' when it reads the 
records. If they are not corresponding with the newest version of the 
tdbsam, it fallbacks to the previous versions, and so on...

I waiting for your comments..

Best regards,

Aurélien Degrémont





More information about the samba-technical mailing list