Commit graph

26 commits

Author SHA1 Message Date
H. Peter Anvin
2c86ff58dc remap: *actually* build, and fix masked logic errors
Well, now it is actually being compiled, and should hopefully work
again...

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2024-06-10 21:09:46 -07:00
H. Peter Anvin
33ec23c0dc remap: re-enable in autoconf; fix missing pointer assignment
Need to actually output something, too.

The whole section for remap had gotten dropped from autoconf, with the
obvious results...

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2024-06-10 20:56:27 -07:00
H. Peter Anvin
9a92dec1dc tftpd: make it possible to adjust the remap deadman
Allow the user to tweak the remap deadman counter if it is necessary
for whatever reason.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2024-06-10 20:36:22 -07:00
H. Peter Anvin
ac7f98e4d8 remap: fix timeouts for "g", add a "gg" flag to match sed s///g
Make sure that when using the global option, we still bump the deadman
timer.

The "g" option really should only have applied to the right-hand
unmatched part of the string, like in sed. Add a "gg" option which
does that.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2024-06-10 20:24:46 -07:00
H. Peter Anvin
351907e3f0 tftpd: handle rule filter flags more cleanly
Instead of a bunch of ad hoc tests, keep a bitmask of flags that would
keep this rule from being executed. This also removes the ugly hack of
converting the request mode between opcode and character encodings for
really no good reason.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2024-05-29 17:28:53 -07:00
H. Peter Anvin
6f96fcd1b6 tftpd: allow a rewrite rule to probe for the existence of a file
This adds an "E" flag to the rewrite rules, which exits rule
processing if and only if the result is a valid, accessible
filename. If combined with "r", the rewrite is cancelled if the rule
is not applied.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2024-05-29 17:16:06 -07:00
H. Peter Anvin
18ee96a03f tftpd: allow IPv4/6-specific remapping rules
Allow remapping rules to be conditional on IPv4 vs IPv6.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2014-06-07 12:59:33 -07:00
H. Peter Anvin
0b5732e263 remap: change the mode argument from a boolean to a character
Instead of taking a boolean value for get/put, pass a character; this
allows us to extend the number of possibilities in the future.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2011-05-05 10:08:53 -07:00
H. Peter Anvin
22accddda0 Reformat the source code
The source code was a mix of different styles; normalize on NASM
style; basically K&R style with 4 space indentation.
2008-07-08 17:14:44 -04:00
H. Peter Anvin
80f86e5a04 Get rid of $Id$ tags and update copyright dates 2007-01-30 16:01:24 -08:00
Peter Anvin
8a2f696097 Handle transformations with matches 2005-10-13 10:41:10 -07:00
hpa
9630aae006 Correct bug which caused "r" rules to get incorrectly rejected as "ri" rules 2004-09-23 02:22:02 +00:00
hpa
17b5188b65 - Fix bug in the handling of timeouts.
- Add support for \U..\E and \L..\E.
- Add support for inverse rules.
2004-09-14 22:38:46 +00:00
hpa
b3ec0c58e6 Better error messages. 2002-11-08 01:10:08 +00:00
hpa
c980666bbe Fix bogus sizeof() 2002-05-06 19:14:14 +00:00
hpa
d849153191 Fix macro substitution bug; some Makefile issues 2002-03-08 04:08:05 +00:00
hpa
57044bc5df Interpret the \i and \x escape sequences to insert the IP of the
requesting host
2001-11-16 23:38:29 +00:00
hpa
2c31169f57 Major overhaul of the portability stuff; port to autoconf 2.52 2001-11-12 10:03:04 +00:00
hpa
3df5c1f25c Even more portability work... 2001-11-12 06:46:56 +00:00
hpa
5b21a932a6 Avoid using basename(), it's way too nasty from a portability
standpoint.

Change recvfile, sendfile -> tftp_* due to namespace collision problems.
2001-11-12 05:57:29 +00:00
hpa
5b0cb11445 Support "constipation" -- compile cleanly with -Wwrite-strings 2001-08-10 18:25:08 +00:00
hpa
e3570e4d31 Add support for freeing a remap file datastructure, so we avoid a
memory leak.
2001-08-10 18:07:46 +00:00
hpa
b98d08b5d4 Improve README file; set the default prefix to /usr; add debugging of
the remapping process.
2001-07-26 22:36:14 +00:00
hpa
81822ea738 Fork before performing tcpwrappers check.
Don't rely on nonstandard bsd_signal() function, instead
 require that the platform has sigaction().  This is 2001,
 after all.  This may resolve some potential portability
 problems.

Log a message if memory allocation fails, instead of dying silently.

Clean up the main dispatch loop.

Use <sysexits.h> for exit codes, if it exists.

Reformat tftpd.c to match the other files.
2001-07-20 06:59:54 +00:00
hpa
baf8364f1a Make remap error checking a bit more robust. 2001-07-10 20:47:52 +00:00
hpa
20271a4c87 Initial step in integrating regex-based rewrite engine. 2001-07-10 04:52:06 +00:00