zxpxyz
求助:tftp-hpa remap-file
man in.tftpd如下
FILENAME REMAPPING
The -m option specifies a file which contains filename remapping rules. Each non-comment line (comments begin with hash marks, #)
contains an operation, specified below; a regex, a regular expression in the style of egrep; and optionally a replacement pattern.
The operation indicated by operation is performed if the regex matches all or part of the filename. Rules are processed from the
top down, and by default, all rules are processed even if there is a match.
The operation can be any combination of the following letters:
r Replace the substring matched by regex by the replacement pattern. The replacement pattern may contain escape sequences; see
below.
g Repeat this rule until it no longer matches. This is always used with r.
i Match the regex case-insensitively. By default it is case sensitive.
e If this rule matches, end rule processing after executing the rule.
s If this rule matches, start rule processing over from the very first rule after executing this rule.
a If this rule matches, refuse the request and send an access denied error to the client.
G This rule applies to GET (RRQ) requests only.
P This rule applies to PUT (WRQ) requests only.
~ Inverse the sense of this rule, i.e. execute the operation only if the regex doesn?AF>t match. Cannot used together with r.
配置文件如下
ri ^[a-z]:
rg // /
rg /# @
rg /../ /..no../
rg "A" "a"
rg B b
rg C c
rg D d
rg E e
rg F f
rg G g
rg H h
rg I i
rg J j
rg K k
rg L l
rg M m
rg N n
rg O o
rg P p
rg Q q
rg R r
rg S s
rg T t
rg U u
rg V v
rg W w
rg X x
rg Y y
rg Z z
r ^/(.*) /1
日志报告如下
Mar 15 08:12:54 localhost in.tftpd[20657]: r rules cannot be inverted, line 1: ^[a-z]:
Mar 15 08:12:54 localhost in.tftpd[20657]: r rules cannot be inverted, line 2: // /
Mar 15 08:12:54 localhost in.tftpd[20657]: r rules cannot be inverted, line 3: /# @
Mar 15 08:12:54 localhost in.tftpd[20657]: r rules cannot be inverted, line 4: /../ /..no../
Mar 15 08:12:54 localhost in.tftpd[20657]: r rules cannot be inverted, line 5: "A" "a"
Mar 15 08:12:54 localhost in.tftpd[20657]: r rules cannot be inverted, line 6: B b
Mar 15 08:12:54 localhost in.tftpd[20657]: r rules cannot be inverted, line 7: C c
Mar 15 08:12:54 localhost in.tftpd[20657]: r rules cannot be inverted, line 8: D d
Mar 15 08:12:54 localhost in.tftpd[20657]: r rules cannot be inverted, line 9: E e
Mar 15 08:12:54 localhost in.tftpd[20657]: r rules cannot be inverted, line 10: F f
Mar 15 08:12:54 localhost in.tftpd[20657]: r rules cannot be inverted, line 11: G g
Mar 15 08:12:54 localhost in.tftpd[20657]: r rules cannot be inverted, line 12: H h
Mar 15 08:12:54 localhost in.tftpd[20657]: r rules cannot be inverted, line 13: I i
Mar 15 08:12:54 localhost in.tftpd[20657]: r rules cannot be inverted, line 14: J j
Mar 15 08:12:54 localhost in.tftpd[20657]: r rules cannot be inverted, line 15: K k
Mar 15 08:12:54 localhost in.tftpd[20657]: r rules cannot be inverted, line 16: L l
Mar 15 08:12:54 localhost in.tftpd[20657]: r rules cannot be inverted, line 17: M m
Mar 15 08:12:54 localhost in.tftpd[20657]: r rules cannot be inverted, line 18: N n
Mar 15 08:12:54 localhost in.tftpd[20657]: r rules cannot be inverted, line 19: O o
Mar 15 08:12:54 localhost in.tftpd[20657]: r rules cannot be inverted, line 20: P p
Mar 15 08:12:54 localhost in.tftpd[20657]: r rules cannot be inverted, line 21: Q q
Mar 15 08:12:54 localhost in.tftpd[20657]: r rules cannot be inverted, line 22: R r
Mar 15 08:12:54 localhost in.tftpd[20657]: r rules cannot be inverted, line 23: S s
Mar 15 08:12:54 localhost in.tftpd[20657]: r rules cannot be inverted, line 24: T t
Mar 15 08:12:54 localhost in.tftpd[20657]: r rules cannot be inverted, line 25: U u
Mar 15 08:12:54 localhost in.tftpd[20657]: r rules cannot be inverted, line 26: V v
Mar 15 08:12:54 localhost in.tftpd[20657]: r rules cannot be inverted, line 27: W w
Mar 15 08:12:54 localhost in.tftpd[20657]: r rules cannot be inverted, line 28: X x
Mar 15 08:12:54 localhost in.tftpd[20657]: r rules cannot be inverted, line 29: Y y
Mar 15 08:12:54 localhost in.tftpd[20657]: r rules cannot be inverted, line 30: Z z
Mar 15 08:12:54 localhost in.tftpd[20657]: r rules cannot be inverted, line 31: ^/(.*) /1
到底是什么地方错了?烦请知道的兄弟解释一下。