Logon & Logoff time

Andrew Bartlett abartlet at pcug.org.au
Tue Jan 22 00:39:12 GMT 2002


On Tue, 22 Jan 2002, Jean Francois Micouleau wrote:

>
>
> On Mon, 21 Jan 2002, Steven French wrote:
>
> >  LastLogonTime was updated on every logon (via the WWkstaUserLogon and
> > logoff_time via WWkstaUserLogoff RAP calls) although I don't remember what
> > happened if you logged on to the Backup instead of the Primary Domain
> > Controller.
>
> the LastLogonTime/LastLogoffTime are updated on the BDC. The rest of the
> SAM is read only.
>
> you have to query the PDC and all the BDCs to reliably get a user's
> LastLogonTime.

If sombody actually wants to do this in HEAD, the patch is quite trivial:

Add the approprite new member to the SAM_ACCOUNT struct, and matching
get/set functions.

Then call the 'pdb_set_last_logon_time()' function (via a
pdb_set_last_logon_now() wrapper) in auth/auth_sam.c, just before it
returns.

It will actually be the 'last correct password check' - and it will count
both file-share connects and domain logons.  (It might also be rendered
slightly inaccruate by later PAM account checks).

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