[PATCH] Upgrade for TDBSAM formatM

Aurélien Degrémont adegremont at idealx.com
Mon Nov 3 17:37:27 GMT 2003


Hi,

The code I provided already contains the upgrader/downgrader for all 
versions (0 and 1).
It automatically upgrades the TDBSAMs to the lastest version, but, it 
can be easily modified to manage upgrade/downgrade in other ways, if you 
prefer.

Aurélien

David Collier-Brown wrote:

>   Avoiding change is good, but if you can't
> avoid change, it is manageble via a couple of related
> tactics.
>   As far back as Multics, data structures contained
> a signature and a two-part versions number, and when
> one wrote a new format that was incompatable, one
> wrote an updater and a downdater function for it.
>
>   For example, if read_tdb found <sam, 1, 5> on
> disk but expected <sam, 2, 0> in memory, it
> would apply the updater to the struct to reformat
> it, and write_tdb could apply a down-dater to convert
> it back if that was necessary.
>
>   If you do expect to add/change fields in the future
> send me mail and I'll write you an example updater/
> downdater pair.
>
> --dave
>





More information about the samba-technical mailing list