tftp/tftpd.remap

Mon, 25 Aug 2014 19:06:31 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Mon, 25 Aug 2014 19:06:31 +0200
changeset 795
ef076e9bc56b
permissions
-rw-r--r--

Import package vendor original specs for necessary manipulations.

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

mercurial