Bug in parsing/expanding %% #1866

Closed
llogar opened this Issue Dec 6, 2016 · 0 comments

Comments

Projects
None yet
1 participant

llogar commented Dec 6, 2016

A %% within XLAT_ALTERNATE produces a sequence of XLAT_LITERAL entries, but only the first one is used in expanded output, as can be clearly seen from the output below where %s','now') is missing in expanded text.

Tue Dec 6 12:42:38 2016 : Debug: UPDATE radacct SET acctstarttime = %{%{integer:Event-Timestamp}:-strftime('%%s','now')} WHERE AcctUniqueId = '%{Acct-Unique-Session-Id}'
Tue Dec 6 12:42:38 2016 : Debug: Parsed xlat tree:
Tue Dec 6 12:42:38 2016 : Debug: literal --> UPDATE radacct SET acctstarttime =
Tue Dec 6 12:42:38 2016 : Debug: if {
Tue Dec 6 12:42:38 2016 : Debug: xlat --> integer
Tue Dec 6 12:42:38 2016 : Debug: {
Tue Dec 6 12:42:38 2016 : Debug: literal --> Event-Timestamp
Tue Dec 6 12:42:38 2016 : Debug: }
Tue Dec 6 12:42:38 2016 : Debug: }
Tue Dec 6 12:42:38 2016 : Debug: else {
Tue Dec 6 12:42:38 2016 : Debug: literal --> strftime('
Tue Dec 6 12:42:38 2016 : Debug: literal --> %
Tue Dec 6 12:42:38 2016 : Debug: literal --> s','now')
Tue Dec 6 12:42:38 2016 : Debug: }
Tue Dec 6 12:42:38 2016 : Debug: literal --> WHERE AcctUniqueId = '
Tue Dec 6 12:42:38 2016 : Debug: attribute --> Acct-Unique-Session-Id
Tue Dec 6 12:42:38 2016 : Debug: literal --> '
Tue Dec 6 12:42:38 2016 : Debug: (5) sql: EXPAND UPDATE radacct SET acctstarttime = %{%{integer:Event-Timestamp}:-strftime('%%s','now')} WHERE AcctUniqueId = '%{Acct-Unique-Session-Id}'
Tue Dec 6 12:42:38 2016 : Debug: (5) sql: --> UPDATE radacct SET acctstarttime = strftime(' WHERE AcctUniqueId = '45c3f44b4867f5c6be55f2325cea6973'

radius version:

radiusd: FreeRADIUS Version 3.0.11, for host mipsel-openwrt-linux-gnu, built on Dec 3 2016 at 20:07:03

@alandekok alandekok added a commit that referenced this issue Dec 7, 2016

@alandekok alandekok continue to "next" in xlat alternate. Fixes #1866 75c5f59

alandekok closed this in 5835264 Dec 7, 2016

@alandekok alandekok added a commit that referenced this issue Dec 7, 2016

@alandekok alandekok continue to "next" in xlat alternate. Fixes #1866 f12ce0a

@arr2036 arr2036 added a commit to arr2036/freeradius-server that referenced this issue Dec 9, 2016

@alandekok @arr2036 alandekok + arr2036 continue to "next" in xlat alternate. Fixes #1866 bc20068
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment