[PATCH] pdb_set_*

Stefan (metze) Metzmacher metze at metzemix.de
Mon Oct 7 13:39:01 GMT 2002


At 21:51 07.10.2002 +1000, Andrew Bartlett wrote:
>"Stefan (metze) Metzmacher" wrote:
> >
> > Hi Andrew,
> >
> > here're the first steps of my pdb_set_* patch (THIS is NOT ready!!!)
> >
> > every pdb_set function gets a uint8 flag (DEFAULT | SET | CHANGED)
> >
> > then the backends can decide to only store changed values...
> >
> > metze
>
>Looks like a good start - a few comments below...

:-)


> > +#define FLAG_SAM_ACCTDESC_CHANGED      0x00000006
>
>Why not make this an enum?  Then create 3 bitmasks.

I make it with 2 bitmaps
sampass->private.change_flags;
sampass->private.set_flags;

>I think every element should have a 'default', 'set' and 'changed'
>state.

should I make a:
enum(DEFAULT=0,SET,CHANGED);

or:

enum(PDB_DEFAULT=0,PDB_SET,PDB_CHANGED);

???

>I'm not sure if this logic looks quite right.  As I mentioned above, I
>think it's easist to make this identical for all the attributes.  This
>would allow us to make a new procecure:
>
>BOOL set_init_flags(uint32 element, flag);

BOOL pdb_Set_init_flags(SAM_ACCOUNT  *sampass, uint32 flag, uint8 value_flag);


>That would do this swtich 'in general'.  I would set every element as
>'default' when we create a SAM_ACCOUNT, and make the changes when we
>actually modify it.  So 'changed' would mark both 'set' and 'changed',
>while 'default' would mark none (clear both), and 'set' would just mark
>'set' (clear changed).  Hmm, I think this means we only need 2
>bitmaps...

yep


> > @@ -1041,12 +1527,12 @@ BOOL pdb_set_pass_changed_now (SAM_ACCOU
> >
> >         if (!account_policy_get(AP_MAX_PASSWORD_AGE, &expire)
> >             || (expire==(uint32)-1)) {
> > -               if (!pdb_set_pass_must_change_time (sampass, 
> get_time_t_max(), False))
> > +               if (!pdb_set_pass_must_change_time (sampass, 
> get_time_t_max(), SET))
>
>Hmm, shouldn't this be 'changed'?

yes to DEFAULT.



metze
-----------------------------------------------------------------------------
Stefan "metze" Metzmacher <metze at metzemix.de>




More information about the samba-technical mailing list