Skip to content

Commit

Permalink
Check for presence of attributes in the cannon policies
Browse files Browse the repository at this point in the history
  • Loading branch information
arr2036 committed May 7, 2015
1 parent 189fc0b commit 1cde828
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions raddb/policy.d/canonicalization
Expand Up @@ -13,7 +13,7 @@
nai_regexp = '^([^@]*)(@([-[:alnum:]]+\.[-[:alnum:].]+))?$'

split_username_nai {
if (&User-Name =~ /${policy.nai_regexp}/) {
if (&User-Name && (&User-Name =~ /${policy.nai_regexp}/)) {
update request {
&Stripped-User-Name := "%{1}"
&Stripped-User-Domain = "%{3}"
Expand All @@ -33,7 +33,7 @@ split_username_nai {
# If called in post-proxy we modify the proxy-reply message
#
split_username_nai.post-proxy {
if (&proxy-reply:User-Name =~ /${policy.nai_regexp}/) {
if (&proxy-reply:User-Name && (&proxy-reply:User-Name =~ /${policy.nai_regexp}/)) {
update proxy-reply {
&Stripped-User-Name := "%{1}"
&Stripped-User-Domain = "%{3}"
Expand Down Expand Up @@ -84,7 +84,7 @@ rewrite_called_station_id {
# be provided by 802.1X authenticators.
#
rewrite_calling_station_id {
if (&Calling-Station-Id =~ /^${policy.mac-addr-regexp}$/i) {
if (&Calling-Station-Id && (&Calling-Station-Id =~ /^${policy.mac-addr-regexp}$/i)) {
update request {
&Calling-Station-Id := "%{toupper:%{1}-%{2}-%{3}-%{4}-%{5}-%{6}}"
}
Expand Down

0 comments on commit 1cde828

Please sign in to comment.