3 # Sample rule file for the -m (remapping option)
5 # This file has three fields: operation, regex, remapping
7 # The operation is a combination of the following letters:
9 # r - rewrite the matched string with the remapping pattern
10 # i - case-insensitive matching
11 # g - repeat until no match (used with "r")
12 # e - exit (with success) if we match this pattern, do not process
14 # s - start over from the first rule if we match this pattern
15 # a - abort (refuse the request) if we match this rule
16 # G - this rule applies to TFTP GET requests only
17 # P - this rule applies to TFTP PUT requests only
19 # The regex is a regular expression in the style of egrep(1).
21 # The remapping is a pattern, all characters are verbatim except \
22 # \0 copies the full string that matched the regex
23 # \1..\9 copies the 9 first (..) expressions in the regex
26 # "#" begins a comment, unless \-escaped
28 ri ^[a-z]: # Remove "drive letters"
29 rg \\ / # Convert backslashes to slashes
30 rg \# @ # Convert hash marks to @ signs
31 rg /../ /..no../ # Convert /../ to /..no../
32 e ^ok/ # These are always ok
33 r ^[^/] /tftpboot/\0 # Convert non-absolute files
34 a \.pvt$ # Reject requests for private files