patch logon time, samba-3.0.2pre1

Andrew Bartlett abartlet at samba.org
Fri Jan 9 11:08:15 GMT 2004


On Fri, Jan 09, 2004 at 12:02:59PM +0100, Jianliang Lu wrote:
> Now the user logon time is updated every time the logon is successful.
> 
> Patch:
> 
> --- samba-3.0.2pre1/source/auth/auth_sam.c.orig	Thu Jan  8 18:01:12 2004
> +++ samba-3.0.2pre1/source/auth/auth_sam.c	Thu Jan  8 17:58:51 2004
> @@ -216,6 +216,17 @@
>  		pdb_free_sam(&sampass);
>  		return nt_status;
>  	}
> +	if (pdb_get_acct_ctrl(sampass) &ACB_NORMAL){
> +		if (!pdb_set_logon_time(sampass, time(NULL), PDB_CHANGED))
> +	             DEBUG(0, ("auth_sam.c : pdb_set_logon_time fialed!\n"));
> +
> + 		become_root();
> +		if(!pdb_update_sam_account(sampass))
> +			DEBUG(0, ("Failed to modify entry for user % s.\n",
> +						user_info-
> >internal_username.str));
> +		unbecome_root();
> +	}          
> +

This will massivly increse the load on LDAP servers, as each login is
now a write.  We need an smb.conf parameter to control this behaviour,
as each login can be every Squid HTTP request.  Does win2k update this
for every login, or just for interactive logins?

My understanding is that on NT4, this is not consistant between
servers - we might instead offer to store the last login time in a
tdb, per-server.

If this is only updated on interactive logins, I will be much happier.

Andrew Bartlett


More information about the samba-technical mailing list