[PATCH] pdb_set_*

Andrew Bartlett abartlet at samba.org
Mon Oct 7 21:06:00 GMT 2002


"Stefan (metze) Metzmacher" wrote:
> 
> 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);
> 

make it PDB_, to avoid namespace pollution.

> >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.

Hmm, I still think this should be 'changed'.  This is set when a
password is changed, so isn't the value changed here?  This is just the
error case for account_policy_get(), the rest of the call is still
successful.

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