Enumerating password entries
Jeremy Allison
jallison at cthulhu.engr.sgi.com
Tue Oct 27 16:49:51 GMT 1998
Jean Francois Micouleau wrote:
>
> On Fri, 23 Oct 1998, Luke Kenneth Casson Leighton wrote:
>
> > > A cleaner solution, if you don't mind a one-time startup
> > > cost, is to to a startsmbpwent(), getsmbpwent() endsmbpswent()
> > > sequence at startup to count the number of entries the
> > > first time you need it - and then stat() the file to
> > > get the last modified time which you then cache.
> >
> > oh. good call.
>
> Only valid for the smbpasswd file or if you have direct access to the
> file. How to you stat() a NIS+ or LDAP server ?
>
Well yes that is a given :-). I wasn't talking about this
being a general method, but how you might efficiently
code this for the smbpasswd file case behind an abstact interface.
The idea is to have a "getsmbpwnum()" call that returns
the number of entries and then under the covers implement
it like this for the smbpasswd file case.
For LDAP & NIS+ you can do the correct LDAP'y and NIS+'y
things - it's just that I don't know what they are :-).
Jeremy.
--
--------------------------------------------------------
Buying an operating system without source is like buying
a self-assembly Space Shuttle with no instructions.
--------------------------------------------------------
More information about the samba-technical
mailing list