Skip to content

Commit

Permalink
add test for large users file
Browse files Browse the repository at this point in the history
the default buffer size is 8K, so we add a file larger than that.
If the sbuff extension only looks for one byte at a time, then
we will run out of data in the buffer while there is still pending
data to read.  The users file reader will then return an error.

By updating the sbuffs to read more than 1 character, we ensure
that there's enough data in the buffer for most parsing purposes.
  • Loading branch information
alandekok committed Nov 1, 2023
1 parent 02ec7cd commit 18cdeae
Show file tree
Hide file tree
Showing 5 changed files with 1,057 additions and 0 deletions.
5 changes: 5 additions & 0 deletions raddb/mods-available/files
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,8 @@ files {
acctusersfile = ${moddir}/accounting
preproxy_usersfile = ${moddir}/pre-proxy
}

files subnet {
key = %{Framed-IP-Address}
filename = ${confdir}/subnet_policies
}
10 changes: 10 additions & 0 deletions src/tests/modules/files/module.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,13 @@ files compound_key {
key = "%{Tmp-String-0}:%{Tmp-String-1}"
filename = $ENV{MODULE_TEST_DIR}/compound_key
}

#
#
#
#
#
files subnet3 {
key = %{Framed-IP-Address}
filename = $ENV{MODULE_TEST_DIR}/subnet3
}
Loading

0 comments on commit 18cdeae

Please sign in to comment.