AcctSessionTime missing in Interims-Update / calculated by FR

Alan DeKok aland at deployingradius.com
Mon Mar 26 20:05:44 CEST 2018


On Mar 26, 2018, at 2:00 PM, Michael Markstaller via Freeradius-Users <freeradius-users at lists.freeradius.org> wrote:
> (do I really need 2.2.10?):

  Yes.

  Unless Ubuntu has back-ported security fixes from 2.2.10 to 2.2.8.  Which they might not have done.

  TBH, the fixes between 2.2.8 and 2.2.10 are bug fixes, and only bug fixes.  There's just no reason to run 2.2.8, much less distribute it as part of a "stable" release.

> I want a mainly stable and admin-friendly
> "stock-setup" which is Ubuntu 16.04 here right now..
> And my needs are also IMHO not very sophisticated, just acct to SQL
> mitigating somehow what the ASA-developers obviously have missed while
> reading the RADIUS-RFC :)
> 
> Anyway, there is also no AcctStartTime in Interim-Update packets, so
> Alans' suggestion fails
> 
> 
> --- Debug ---
> ++if (!Acct-Session-Time && Acct-Start-Time) {
> +++update request {
> 	expand: %l / 1000 -> 1522081439 / 1000
> 	expand: %{expr:%l / 1000} - %{Acct-Start-Time} -> 1522081 -
> ERROR: Failed parsing value "1522081 - " for attribute

  Uh... that's *not* what I suggested to do.  Please pay attention.

  The "expr" module does math.  You can't just put random math into the configuration and expect it to work.

  The "%l" is the Unix time in seconds.  Which is the same time system as Acct-Start-Time.  There is no need to divide %l by 1000.

  I said:

	if (!Acct-Session-Time && Acct-Start-Time) {
		update request {
			Acct-Session-Time := "%{expr:%l - %{Acct-Start-Time}}"
		}
	}

  Use that, and it will work.

> Acct-Session-Time: Unknown value 1522081 -  for attribute Acct-Session-Time

  Because "1522081 -" isn't a valid integer.

> Any other ideas besides saving the timestamp %l in another field and
> calculated by crontab-SQL?

  Follow instructions?  Don't make random changes without understanding *what* those changes are.

  Alan DeKok.




More information about the Freeradius-Users mailing list