-
Notifications
You must be signed in to change notification settings - Fork 9
/
mapfile
35 lines (35 loc) · 1.38 KB
/
mapfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#
# Rule file for the -m (remapping option)
#
# This file has three fields: operation, regex, remapping
#
# The operation is a combination of the following letters:
#
# r - rewrite the matched string with the remapping pattern
# i - case-insensitive matching
# g - repeat until no match (used with "r")
# e - exit (with success) if we match this pattern, do not process
# subsequent rules
# s - start over from the first rule if we match this pattern
# a - abort (refuse the request) if we match this rule
# G - this rule applies to TFTP GET requests only
# P - this rule applies to TFTP PUT requests only
#
# The regex is a regular expression in the style of egrep(1).
#
# The remapping is a pattern, all characters are verbatim except \
# \0 copies the full string that matched the regex
# \1..\9 copies the 9 first (..) expressions in the regex
# \\ is an escaped \
# See http://linux.die.net/man/8/tftpd for more info.
#
# "#" begins a comment, unless \-escaped
#
ri ^[a-z]: # Remove "drive letters"
rg \\ / # Convert backslashes to slashes
rg ([A-Z]) \L\1 # Convert uppercase to lowercase
rg \# @ # Convert hash marks to @ signs
rg /../ /..no../ # Convert /../ to /..no../
e ^ok/ # These are always ok
r ^[^/] /\0 # Convert non-absolute files
a \.pvt$ # Reject requests for private files